A Course On Software Test Automation Design

3y ago
35 Views
3 Downloads
370.09 KB
263 Pages
Last View : 14d ago
Last Download : 3m ago
Upload by : Kaydence Vann
Transcription

A Course on SoftwareTest Automation DesignDoug Hoffman, BA, MBA, MSEE, ASQ-CSQESoftware Quality Methods, LLC. m.orgWinter 2003Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 1

Copyright NoticeThese slides are distributed under the Creative Commons License.In brief summary, you may make and distribute copies of these slides so long as you givethe original author credit and, if you alter, transform or build upon this work, you distributethe resulting work only under a license identical to this one.For the rest of the details of the license, see code.The class and these notes may include technical recommendations, but you arenot Doug Hoffman’s client and Doug is not providing specific advice in thenotes or in the course. Even if you ask questions about a specific situation, youmust understand that you cannot possibly give enough information in aclassroom setting to receive a complete, competent recommendation. I may useyour questions as a teaching tool, and answer them in a way that I believewould “normally” be true but my answer could be completely inappropriate foryour particular situation. I cannot accept any responsibility for any actions thatyou might take in response to my comments in this course.The practices recommended and discussed in this course are useful for testing andtest automation, but more experienced testers will adopt additional practices. Thiscourse was made with the mass-market software development industry in mind.Mission-critical and life-critical software development efforts involve specific andrigorous procedures that are not described in this course.CopyrightCopyright 1994-2003 2000-2003CemSQM,KanerLLC.and SQM, LLC.All Rights Reserved. 2

About Doug HoffmanI advocate and provide advice and services in software testing and quality assurance.Software quality assurance, and especially software testing, have a reputation of being where failed programmers orprogrammer “wanta be ’s” congregate. I don’t believe it’s true, and it’s through courses like this that we can change theperception. I gravitated into quality assurance from engineering. I’ve been a production engineer, developer, supportengineer, tester, writer, instructor, and I’ve managed manufacturing quality assurance, software quality assurance,technical support, software development , and documentation. Along the way I have learned a great deal about softwaretesting and measurement. I enjoy sharing what I’ve learned with interested people.Current employment President of Software Quality Methods, LLC. (SQM) Management consultant in strategic and tactical planning for software quality. Adjunct Instructor for UCSC Extension.Education MBA, 1982. MS in Electrical Engineering, (digital design and information science) 1974. B.A. in Computer Science, 1972.Professional Past Chair, Silicon Valley Section, American Society for Quality (ASQ). Founding Member and Past Chair, Santa Clara Valley Software Quality Association (SSQA, 1992-1997) Certified in Software Quality Engineering (ASQ, 1995). Previously a Registered ISO 9000 Lead Auditor, (RAB 1993). I also participate in the Los Altos Workshops on Software Testing.CopyrightCopyright 1994-2003 2000-2003CemSQM,KanerLLC.and SQM, LLC.All Rights Reserved. 3

Acknowledgment to Cem Kaner(Original Co-author)He’s in the business of improving software customer satisfaction.He has worked as a programmer, tester, writer, teacher, user interface designer, software salesperson, organizationdevelopment consultant, as a manager of user documentation, software testing, and software development, and as anattorney focusing on the law of software quality. These have provided many insights into relationships betweencomputes, software, developers, and customers.Current employment Professor of Software Engineering, Florida Institute of Technology Private practice in the Law Office of Cem KanerBooks Testing Computer Software (1988; 2nd edition with Hung Nguyen and Jack Falk,1993). This received the Awardof Excellence in the Society for Technical Communication’s Northern California Technical PublicationsCompetition and has the lifetime best sales of any book in the field. Bad Software: What To Do When Software Fails (with David Pels). Ralph Nader called this book “a how-to bookfor consumer protection in the Information Age.” Lessons Learned in Software Testing (2002, with James Bach and Bret Pettichord) Doug describes the chapter ontest automation better than any book on the subject available today.Education J.D. (law degree, 1993). Elected to the American Law Institute, 1999. Ph.D. (experimental psychology, 1984) (trained in measurement theory and in human factors, the field concernedwith making hardware and software easier and safer for humans to use). B.A. (primarily mathematics and philosophy, 1974). Certified in Quality Engineering (American Society for Quality, 1992). Examiner (1994, 1995) for the CaliforniaQuality Awards. He also co-founded and/or co-host the Los Altos Workshops on Software Testing, the Software Test Managers’Roundtable, the Austin Workshop on Test Automation, the Workshop on Model-Based Testing, and the Workshopon Heuristic & Exploratory Techniques.Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 4

AcknowledgmentMany of the ideas in this presentation were presented and refinedin Los Altos Workshops on Software Testing and The AustinWorkshops on Test Automation.LAWST 5 focused on oracles. Participants were Chris Agruss,James Bach, Jack Falk, David Gelperin, Elisabeth Hendrickson, DougHoffman, Bob Johnson, Cem Kaner, Brian Lawrence, Noel Nyman,Jeff Payne, Johanna Rothman, Melora Svoboda, Loretta Suzuki, andNed Young.LAWST 1-3 focused on several aspects of automated testing.Participants were Chris Agruss, Tom Arnold, Richard Bender,James Bach, Jim Brooks, Karla Fisher, Chip Groder, ElizabethHendrickson, Doug Hoffman, Keith W. Hooper, III, Bob Johnson,Cem Kaner, Brian Lawrence, Tom Lindemuth, Brian Marick,Thanga Meenakshi, Noel Nyman, Jeffery E. Payne, BretPettichord, Drew Pritsker, Johanna Rothman, Jane Stepak, MeloraSvoboda, Jeremy White, and Rodney Wilson.Bret Pettichord organized and led AWTA 1, 2, and 3.Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 5

Demographics:How long have you worked in: software testing management0-3 months 3-6 months6 mo-1 year 1-2 years2-5 years 5 years programming» Any experience» Production programming test automation» Test development» Tools creationCopyright 1994-2003 Cem Kaner and SQM, LLC.» Any management» Testing group marketingdocumentationcustomer caretraditional QCAll Rights Reserved. 6

OutlineDay 1Automation ExampleFoundational ConceptsSome Simple Automation ApproachesAutomation ArchitecturesPatterns for Automated Software TestsDay 2Quality AttributesCosts and Benefits of AutomationTest OraclesContext, Structure, and StrategiesCopyrightCopyright 1994-2003 2000-2003CemSQM,KanerLLC.and SQM, LLC.All Rights Reserved. 7

Starting ExerciseBefore I start talking about the different typesof automation, I’d like to understand where you areand what you’re thinking about (in terms ofautomation).So . . . .Please take a piece of paper and write outwhat you think automation would look like in yourenvironment.Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 8

Automation in Your EnvironmentCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 9

An Example toIntroduce the ChallengesAutomatedGUI Regression TestsCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 10

The Regression Testing StrategySummary “Repeat testing after changes.”Fundamental question or goal Manage the risks that (a) a bug fix didn’t fix the bug, (b)an old bug comes back or (c) a change had a side effect.Paradigmatic cases Bug regression (Show that a bug was not fixed.) Old fix regression (Show that an old bug fix was broken.) General functional regression (Show that a changecaused a working area to break.)Strengths Reassuring, confidence building, regulator-friendly.Blind spots Anything not covered in the regression series. Maintenance of this test set can be extremely costly.Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 11

Automating Regression TestingThe most common regression automationtechnique: conceive and create a test case run it and inspect the output results if the program fails, report a bug and try again later if the program passes the test, save the resulting outputs in future tests, run the program and compare the outputto the saved results report an exception whenever the current output and thesaved output don’t matchCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 12

A GUI Regression Test ModelUserj GUIjkmTestq Toolkj Launch toolk Test; tool captures scriptl Test; capture resultm Launch automated runn Play scripto Capture SUT responsep Read recorded resultsq Compare and reportknloSUT GUIn p lScriptsResultsCopyrightCopyright 1994-2003 2000-2003CemSQM,KanerLLC.and SQM, LLC.System UnderTestAll Rights Reserved. 13

But, Is This Really Automation?Analyze productDesign testRun test 1st timeEvaluate resultsReport 1st bugSave codeSave resultDocument manRe-run the test--MACHINEWe reallyget themachine todo a whole lotof our work!(Maybe, butnot this way.)Evaluate result-MACHINE(plus human is needed if there’s any mismatch)Maintain result--humanCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 14

Automated Regression Pros and ConsAdvantages Dominant automationparadigm Conceptually simple Straightforward Same approach for all tests Fast implementation Variations are easy Repeatable testsDisadvantages Breaks easily (GUI based) Tests are expensive Pays off late Prone to failure because: difficult financing, architectural, and maintenance issues Low power even whensuccessful (finds few defects)Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 15

ScriptingCOMPLETE SCRIPTING is favored by people who believethat repeatability is everything and who believe that withrepeatable scripts, we can delegate to cheap labor.1 Pull down the Task menu2 Select First Number3 Enter 34 Enter 25 Press return6 The program displays 5Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 16

Scripting: The Bus Tour of Testing Scripting is the Greyhound Bus of softwaretesting:“Just relax and leave the thinking to us.” To the novice, the test script is the whole tour. The testergoes through the script, start to finish, and thinks he’sseen what there is to see. To the experienced tester, the test script is a tour bus.When she sees something interesting, she stops the busand takes a closer look. One problem with a bus trip. It’s often pretty boring, andyou might spend a lot of time sleeping.Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 17

GUI Automation is Expensive Test case creation is expensive. Estimates run from 3-5 times thetime to create and manually execute a test case (Bender) to 3-10times (Kaner) to 10 times (Pettichord) or higher (LAWST). You usually have to increase the testing staff in order to generateautomated tests. Otherwise, how will you achieve the samebreadth of testing? Your most technically skilled staff are tied up in automation Automation can delay testing, adding even more cost (albeithidden cost.) Excessive reliance leads to the 20 questions problem. (Fullydefining a test suite in advance, before you know the program’sweaknesses, is like playing 20 questions where you have to askall the questions before you get your first answer.)Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 18

GUI Automation Pays off Late GUI changes force maintenance of tests» May need to wait for GUI stabilization» Most early test failures are due to GUI changes Regression testing has low power» Rerunning old tests that the program has passed isless powerful than running new tests» Old tests do not address new features Maintainability is a core issue because our mainpayback is usually in the next release, not this one.Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 19

Maintaining GUI Automation GUI test tools must be tuned to the product and theenvironment GUI changes break the tests» May need to wait for GUI stabilization» Most early test failures are due to cosmetic changes False alarms are expensive» We must investigate every reported anomaly» We have to fix or throw away the test when we finda test or tool problem Maintainability is a key issue because our mainpayback is usually in the next release, not this one.Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 20

GUI Regression AutomationBottom LineExtremely valuable under some circumstancesTHERE ARE MANY ALTERNATIVESTHAT MAY BE MORE APPROPRIATEAND MORE VALUABLE.If your only tool is a hammer, everyproblem looks like a nail.Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 21

Brainstorm ExerciseI said: Regression testing has low power because:» Rerunning old tests that the program has passed is lesspowerful than running new tests.OK, is this always true?When is this statement more likely tobe true and when is it less likely to be true?Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 22

NotesCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 23

GUI Regression Strategies:Some Papers of InterestChris Agruss, Automating Software Installation TestingJames Bach, Test Automation Snake OilHans Buwalda, Testing Using Action WordsHans Buwalda, Automated testing with Action Words:Abandoning Record & PlaybackElisabeth Hendrickson, The Difference between TestAutomation Failure and SuccessCem Kaner, Avoiding Shelfware: A Manager’s View ofAutomated GUI TestingJohn Kent, Advanced Automated Testing ArchitecturesBret Pettichord, Success with Test AutomationBret Pettichord, Seven Steps to Test Automation SuccessKeith Zambelich, Totally Data-Driven Automated TestingCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 24

Software Test Automation:Foundational ConceptsWhy To AutomateCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 25

The Mission of Test AutomationWhat is your test mission? What kind of bugs are you looking for? What concerns are you addressing? Who is your audience?Make automation serve your mission.Expect your mission to change.Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 26

Possible Missions for Test Automation Find important bugs fast Measure and document product quality Verify key features Keep up with development Assess software stability, concurrency,scalability Provide serviceCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 27

Possible Automation MissionsEfficiencyService Reduce testing costs Reduce time spent in thetesting phase Automate regression tests Improve test coverage Make testers look good Reduce impact on the bottomline Tighten build cyclesEnable “refactoring” andother risky practicesPrevent destabilizationMake developers look goodPlay to computer and humanstrengthsIncrease managementconfidence in the productCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 28

Possible Automation MissionsExtending our reachMultiply our resources API based testingUse hooks and scaffoldingComponent testingModel based testsData driven testsInternal monitoring and controlPlatform testingConfiguration testingModel based testsData driven testsCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 29

Software Test Automation:Foundational ConceptsTesting ModelsCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 30

Simple [Black Box] Testing ModelTest InputsSystemUnderTestCopyrightCopyright 1994-2003 2000-2003CemSQM,KanerLLC.and SQM, LLC.Test ResultsAll Rights Reserved. 31

Implications of the Simple Model We control the inputs We can verify resultsBut, we aren’t dealing with all the factors Memory and data Program state System environmentCopyrightCopyright 1994-2003 2000-2003CemSQM,KanerLLC.and SQM, LLC.All Rights Reserved. 32

Expanded Black Box Testing ModelTest InputsPrecondition DataPreconditionProgram StateTest Copyright 1994-2003 2000-2003CemSQM,KanerLLC.and SQM, LLC.Post-condition DataPost-conditionProgram StateEnvironmentalResultsAll Rights Reserved. 33

Implications of the Expanded ModelWe don’t control all inputsWe don’t verify everythingMultiple domains are involvedThe test exercise may be the easy partWe can’t verify everythingWe don’t know all the factorsCopyrightCopyright 1994-2003 2000-2003CemSQM,KanerLLC.and SQM, LLC.All Rights Reserved. 34

An Example Model For SUTUserAPIGUIRemote GUIUserFunctionalEngineDataSetSystem Under TestCopyrightCopyright 1994-2003 2000-2003CemSQM,KanerLLC.and SQM, LLC.All Rights Reserved. 35

NotesCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 36

Software Test Automation:Foundational ConceptsThe Power of TestsCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 37

Size Of The Testing Problem Input one value in a 10 character field 26 UC, 26 LC, 10 Numbers Gives 6210 combinations How long at 1,000,000 per second?What is your domain size?We can only run a vanishinglysmall portion of the possibleCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved.tests38

A Question of Software TestabilityEase of testing a productDegree to which software can beexercised, controlled and monitoredProduct's ability to be tested vs. testsuite's ability to testSeparation of functional componentsVisibility through hooks and interfacesAccess to inputs and resultsForm of inputs and resultsStubs and/or scaffoldingAvailability of oraclesCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 39

An Excellent Test Case Reasonable probability of catching an error Not redundant with other tests Exercise to stress the area of interest Minimal use of other areas Neither too simple nor too complex Makes failures obvious Allows isolation and identification of errorsCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 40

Good Test Case Design:Neither Too Simple Nor Too Complex What makes test cases simple or complex? (A simpletest manipulates one variable at a time.) Advantages of simplicity? Advantages of complexity? Transition from simple cases to complex cases (Youshould increase the power and complexity of tests over time.) Automation tools can bias your development towardoverly simple or complex testsRefer to Testing Computer Software, pages 125, 241, 289, 433Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 41

Testing Analogy: Clearing WeedsweedsThanks to James Bach for letting us use his slides.Copyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 42

Totally repeatable testswon’t clear the weedsweedsfixesCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 43

Variable Tests areOften More EffectiveweedsfixesCopyright 1994-2003 Cem Kaner and SQM, LLC.All Rights Reserved. 44

Why Are Regression Tests Weak? Does the same thing over and over Most defects are found during test creation Software doesn’t break or wear out Any other test is equally likely to stumbleover unexpected side effects Automation reduces test variability Only verifies things programmed into the testCopyrightCopyright 1994-2003 2000-2003CemSQM,KanerLLC.and SQM, LLC.All Rights Reserved. 45

Regression Testing:Some Papers of InterestBria

He’s in the business of improving software customer satisfaction. He has worked as a programmer, tester, writer, teacher, user interface designer, software salesperson, organization development consultant, as a manager of user documentation, software testing, and software development, and as an attorney focusing on the law of software quality.

Related Documents:

tres tipos principales de software: software de sistemas, software de aplicación y software de programación. 1.2 Tipos de software El software se clasifica en tres tipos: Software de sistema. Software de aplicación. Software de programación.

akuntansi musyarakah (sak no 106) Ayat tentang Musyarakah (Q.S. 39; 29) لًََّز ãَ åِاَ óِ îَخظَْ ó Þَْ ë Þٍجُزَِ ß ا äًَّ àَط لًَّجُرَ íَ åَ îظُِ Ûاَش

Collectively make tawbah to Allāh S so that you may acquire falāḥ [of this world and the Hereafter]. (24:31) The one who repents also becomes the beloved of Allāh S, Âَْ Èِﺑاﻮَّﺘﻟاَّﺐُّ ßُِ çﻪَّٰﻠﻟانَّاِ Verily, Allāh S loves those who are most repenting. (2:22

After searching with the keywords: Agile testing software, Scrum agile testing software, Kanban agile testing software, Test Driven Development agile test software, Behavior Driven Development test software, automation test software, the tables 1, 2 and 3 show the number of scientific articles retrieved. This search was made with a restriction

Test-takers do not bring anything into the testing room, and they do not leave until they have finished the test and returned all test materials. If a test-taker must leave the room before completing the test, that test-taker is not permitted to return to the test room and finish the test. Instead, the test-taker is scheduled for retesting with

4. 12 Meter (40') Drop Within Test 5. Fast Cook-Off Within Test 6. Slow Cook-Off Within Test 7. Bullet Impact Within Test 8. Fragment Impact Within Test 9. Sympathetic Detonation Within Test 10. Shaped Charge Jet Impact Within Test 11. Spall Impact Within Test 12. Specialty Within Test 13. Specialty Within Test 14. Specialty Within Test 15 .

LARGE SCALE SOFTWARE TEST DATA GENERATION BASED ON COLLECTIVE CONSTRAINT AND WEIGHTED COMBINATION METHOD . Dalin Zhang, Jianwei Sui, Yunzhan Gong . Original scientific paper Software reliability test is to test software purpose of verifying whether the software achieves reliability requirements and evaluating software with the reliability level.

Test Execution Engine (Test Script) Signal Analysis Firmware UI Automation Database Automation Software Database Firmware Test API Software Test API An off-the-shelf test management program provides the testers an environment to plan, group, and start tests. The test manager runs a script that starts our automation system from the command line.