637 – Introduction (Ch 1) Introduction to Software Testing Chapter 1 Jeff Offutt Information & Software Engineering SWE 437 Software Testing www.ise.gmu.edu/~offutt/

Slides:



Advertisements
Similar presentations
Introduction to Software Testing Chapter 1
Advertisements

Verification and Validation
Introduction to Software Testing Chapter 1 Paul Ammann & Jeff Offutt SUMMARY OF PARTS 1 AND 2 FROM LAST WEEK.
Software Verification
CITS5501 Software Testing and Quality Assurance Testing – Introduction Material from Introduction to Software Testing, ed 2, Ammann & Offutt.
COVERAGE CRITERIA FOR TESTING 1. ill-defined terms in Testing  complete testing  exhaustive testing  full coverage Are poorly defined terms because.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation.
Verification and Validation
1CMSC 345, Version 4/04 Verification and Validation Reference: Software Engineering, Ian Sommerville, 6th edition, Chapter 19.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Introduction to Software Testing Chapter 1 Introduction
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Introduction to Software Testing
1 Software testing. 2 Testing Objectives Testing is a process of executing a program with the intent of finding an error. A good test case is in that.
Software Testing Testing types Testing strategy Testing principles.
SWE 637: Test Criteria and Definitions Tao Xie Prepared based on Slides by ©Paul Ammann and Jeff Offutt Revised by Tao Xie.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
637 – Introduction (Ch 1) Introduction to Software Testing Chapter 1 Jeff Offutt Information & Software Engineering SWE 437 Software Testing
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
Today’s Agenda  HW #1  Finish Introduction  Input Space Partitioning Software Testing and Maintenance 1.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
Introduction to Software Testing Paul Ammann & Jeff Offutt Updated 24-August 2010.
Introduction to Software Testing. OUTLINE Introduction to Software Testing (Ch 1) 2 1.Spectacular Software Failures 2.Why Test? 3.What Do We Do When We.
637 – Introduction (Ch 1) Introduction to Software Testing Chapter 1 Jeff Offutt Information & Software Engineering SWE 637 Software Testing
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Introduction to Software Testing Chapter 9.2 Program-based Grammars Paul Ammann & Jeff Offutt
©Ian Sommerville Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation with edits by Dan Fleck Coming up: Objectives.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation with edits by Dan Fleck.
Software Quality Assurance and Testing Fazal Rehman Shamil.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
Workshop on Integrating Software Testing into Programming Courses (WISTPC14:2) Friday July 18, 2014 Introduction to Software Testing.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
637 – Introduction (Ch 1) Introduction to Software Testing Chapter 1 Jeff Offutt Information & Software Engineering SWE 637 Software Testing
Introduction to Software Testing Chapter 1 Introduction Paul Ammann & Jeff Offutt
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
637 – Introduction (Ch 1) Introduction to Software Testing Chapter 1 Jeff Offutt Information & Software Engineering SWE 637 Software Testing
Introduction to Software Testing Model-Driven Test Design and Coverage testing Paul Ammann & Jeff Offutt Update.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Testing Integral part of the software development process.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
CSC 480 Software Engineering
Software Testing Introduction CS 4501 / 6501 Software Testing
Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 9.2 Program-based Grammars
Introduction to Software Testing Chapter 1
Input Space Partition Testing CS 4501 / 6501 Software Testing
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Coverage-Based Test Design CS 4501 / 6501 Software Testing
Faults, Errors, Failures CS 4501 / 6501 Software Testing
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Introduction to Software Testing Chapter 2 Model-Driven Test Design
Introduction to Software Testing
Lecture 09:Software Testing
Introduction to Software Testing Chapter 5.2 Program-based Grammars
Introduction to Software Testing Chapter 1
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

637 – Introduction (Ch 1) Introduction to Software Testing Chapter 1 Jeff Offutt Information & Software Engineering SWE 437 Software Testing A Talk in 3 Parts Dr. Kinga Dobolyi

637 – Introduction (Ch 1) A Talk in 3 Parts 1.Why do we test ? 2.What should we do during testing ? 3.How do we get to “the future of testing” ? We are in the middle of a revolution in how software is tested Research is finally meeting practice © Jeff Offutt,

637 – Introduction (Ch 1) Cost of Testing n In real-world usage, testing is the principle post-design activity n Restricting early testing usually increases cost n Extensive hardware-software integration requires more testing You’re going to spend about half of your development budget on testing, whether you want to or not. © Jeff Offutt,

637 – Introduction (Ch 1) Part 1 : Why Test? n Written test objectives and requirements are rare n How much testing is enough? –Common objective – spend the budget … If you don’t know why you’re conducting a test, it won’t be very helpful. © Jeff Offutt,

637 – Introduction (Ch 1) Why Test? n “The software shall be easily maintainable” n Threshold reliability requirements? n Requirements definition teams should include testers! If you don’t start planning for the test at the time the functional requirements are formed, you’ll never know why you’re conducting the test. © Jeff Offutt,

637 – Introduction (Ch 1) Cost of Not Testing n Not testing is even more expensive n Planning for testing after development is prohibitively expensive Program Managers often say: “Testing is too expensive.” © Jeff Offutt, What are some of the costs of NOT testing?

637 – Introduction (Ch 1) Caveat: Impact of New Tools and Techniques They’re teaching a new way of plowing over at the Grange tonight - you going? Naw - I already don’t plow as good as I know how... “Knowing is not enough, we must apply. Willing is not enough, we must do.” Goethe © Jeff Offutt,

637 – Introduction (Ch 1) Testing in the 21st Century n We are going through a time of change n Software Defines Behavior –network routers –financial networks –telephone switching networks –other infrastructure n Embedded Control Applications –airplanes –spaceships –air traffic control systems –watches –ovens –remote controllers n Safety critical, real-time software n And of course … web apps must be highly reliable! – PDAs – memory seats – DVD players – garage door openers – cell phones Testing ideas have matured enough to be used in practice © Jeff Offutt,

637 – Introduction (Ch 1) Part 2 : What ? But … what should we do ? © Jeff Offutt,

637 – Introduction (Ch 1) Important Terms Validation & Verification n Verification: The process of determining whether the products of a given phase of the software development process fulfill the requirements established during the previous phase –(Are we building the product right) n Validation : The process of evaluating software at the end of software development to ensure compliance with intended usage –(Are we building the right product) IV&V stands for “independent verification and validation” © Jeff Offutt,

637 – Introduction (Ch 1) Test Engineer & Test Managers n Test Engineer : An IT professional who is in charge of one or more technical test activities –designing test inputs –producing test values –running test scripts –analyzing results –reporting results to developers and managers n Test Manager : In charge of one or more test engineers –sets test policies and processes –interacts with other managers on the project –otherwise helps the engineers do their work © Jeff Offutt,

637 – Introduction (Ch 1) Test Engineer Activities Test Designs Output Executable Tests ComputerEvaluate P Test Manager Test Engineer Test Engineer design instantiate execute © Jeff Offutt,

637 – Introduction (Ch 1) Static and Dynamic Testing n Static Testing : Testing without executing the program. –This include software inspections and some forms of analyses. n Dynamic Testing : Testing by executing the program with real inputs © Jeff Offutt,

637 – Introduction (Ch 1) Testing Results n Dynamic testing can only reveal the presence of failures, not their absence n The only validation for non-functional requirements is the software must be executed to see how it behaves n Both static and dynamic testing should be used to provide full V&V coverage © Jeff Offutt,

637 – Introduction (Ch 1) Software Faults, Errors & Failures n Software Fault : A static defect in the software n Software Error : An incorrect internal state that is the manifestation of some fault n Software Failure : External, incorrect behavior with respect to the requirements or other description of the expected behavior Faults in software are design mistakes and will always exist © Jeff Offutt,

637 – Introduction (Ch 1) Software Faults, Errors & Failures public static int numZero (int[] x) { // Effects: if x == null throw NullPointerException // else return the number of occurrences of 0 in x int count = 0; for (int i = 1; i < x.length; i++) { if (x[i] == 0) { count++; } } return count; } Input [1, 2, 0]  Output is 1 Input [0, 1, 2, 0]  Output is 1 © Jeff Offutt,

637 – Introduction (Ch 1) Testing & Debugging n Testing : Finding inputs that cause the software to fail n Debugging : The process of finding a fault given a failure © Jeff Offutt,

637 – Introduction (Ch 1) Fault & Failure Model Three conditions necessary for a failure to be observed 1.Reachability : The location or locations in the program that contain the fault must be reached 2.Infection : The state of the program must be incorrect 3.Propagation : The infected state must propagate to cause some output of the program to be incorrect © Jeff Offutt,

637 – Introduction (Ch 1) Some more terminology used in testing… © Jeff Offutt,

637 – Introduction (Ch 1) Test Case n Test Case Values : The values that directly satisfy one test requirement n Expected Results : The result that will be produced when executing the test if the program satisfies its intended behavior © Jeff Offutt,

637 – Introduction (Ch 1) Observability and Controllability n Software Observability : How easy it is to observe the behavior of a program in terms of its outputs, effects on the environment and other hardware and software components –Software that affects hardware devices, databases, or remote files have low observability n Software Controllability : How easy it is to provide a program with the needed inputs, in terms of values, operations, and behaviors –Easy to control software with inputs from keyboards –Inputs from hardware sensors or distributed software is harder –Data abstraction reduces controllability and observability © Jeff Offutt,

637 – Introduction (Ch 1) Top-Down and Bottom-Up Testing n Top-Down Testing : Test the main procedure, then go down through procedures it calls, and so on n Bottom-Up Testing : Test the leaves in the tree (procedures that make no calls), and move up to the root. –Each procedure is not tested until all of its children have been tested © Jeff Offutt,

637 – Introduction (Ch 1) White-box and Black-box Testing n Black-box testing : Deriving tests from external descriptions of the software, including specifications, requirements, and design n White-box testing : Deriving tests from the source code internals of the software, specifically including branches, individual conditions, and statements This view is really out of date. The more general question is: from what level of abstraction to we derive tests? © Jeff Offutt,

637 – Introduction (Ch 1) Changing Notions of Testing n Old view of testing is of testing at specific software development phases –Unit, module, integration, system … n New view is in terms of structures and criteria –Graphs, logical expressions, syntax, input space © Jeff Offutt,

637 – Introduction (Ch 1) Changing Notions of Testing V-model of development n Old view of testing is of testing at specific software development phases © Jeff Offutt,

637 – Introduction (Ch 1) Old : Testing at Different Levels Class A method mA1() method mA2() Class B method mB1() method mB2() main Class P n Acceptance testing: Is the software acceptable to the user? n Integration testing: Test how modules interact with each other n System testing: Test the overall functionality of the system n Module testing: Test each class, file, module or component n Unit testing: Test each unit (method) individually © Jeff Offutt,

637 – Introduction (Ch 1) New : Test Coverage Criteria  Test Requirements: Specific things that must be satisfied or covered during testing  Test Criterion: A collection of rules and a process that define test requirements A tester’s job is simple :Define a model of the software, then find ways to cover it Testing researchers have defined dozens of criteria, but they are all really just a few criteria on four types of structures … © Jeff Offutt,

637 – Introduction (Ch 1) Example Given a bag of jelly beans, test it. n Test Coverage Criteria: Test every flavor n Using the criteria we develop Test Requirements ( –must test grape, orange, cherry…) n Using those requirements we create test cases: –Select a jelly bean until you get a grape one. Eat it. –Select a jelly bean until you get a cherry one. Eat it. –… © Jeff Offutt, Idea: the criteria if fully satisfied will fully test our system

637 – Introduction (Ch 1) Lets give it a shot n I have a Java application that accepts 3 inputs which are the lengths of sides of a triangle. n The program then outputs the type of triangle: equilateral, isosceles, scalene n Write a set of test cases to attempt to cover the software. We’ll then test it. A test case simply looks like: –5 5 5# That would test an equilateral case n Is this a white box or black box test you’re writing? © Jeff Offutt,

637 – Introduction (Ch 1) Fleck: Coverage Criteria Example n Use tools to support testing n Netbeans has a code coverage plug-in (other IDEs certainly will also) n Given a coverage criteria: cover every line of code, lets score your test case set. n Given known code (white box), what would you change about your test set? © Jeff Offutt,

637 – Introduction (Ch 1) New : Criteria Based on Structures 1.Graphs 2.Logical Expressions 3.Input Domain Characterization 4.Syntactic Structures (not X or not Y) and A and B if (x > y) z = x - y; else z = 2 * x; Structures : Four ways to model software A: {0, 1, >1} B: {600, 700, 800} C: {swe, cs, isa, infs} © Jeff Offutt,

637 – Introduction (Ch 1) 1. Graph Coverage – Structural Node (Statement) Cover every node This graph may represent statements & branches methods & calls components & signals states and transitions Edge (Branch) Cover every edge Path Cover every path … © Jeff Offutt,

637 – Introduction (Ch 1) Defs & Uses Pairs (x, 1, (1,2)), (x, 1, (1,3)) (y, 1, 4), (y, 1, 6) (a, 2, (5,6)), (a, 2, (5,7)), (a, 3, (5,6)), (a, 3, (5,7)), (m, 4, 7), (m, 6, 7) 1. Graph Coverage – Data Flow This graph contains: defs: nodes & edges where variables get values uses: nodes & edges where values are accessed def = {x, y} def = {a, m} def = {a} def = {m} use = {x} use = {a} use = {y} use = {m} use = {y} All Defs Every def used once 1, 2, 5, 6, 7 1, 3, 4, 3, 5, 7 All Uses Every def “reaches” every use 1, 2, 5, 6, 7 1, 2, 5, 7 1, 3, 5, 6, 7 1, 3, 5, 7 1, 3, 4, 3, 5,7 © Jeff Offutt,

637 – Introduction (Ch 1) 1. Graph - FSM Example Memory Seats in a Lexus ES 300 Driver 1 Configuration Driver 2 Configuration [Ignition = off] | Button2 [Ignition = off] | Button1 Modified Configuration sideMirrors ()[Ignition = on] | lumbar ()[Ignition = on] | seatBottom ()[Ignition = on] | seatBack () [Ignition = on] | New Configuration Driver 1 New Configuration Driver 2 [Ignition = on] | Reset AND Button1 [Ignition = on] | Reset AND Button2 Ignition = off (to Modified) Guard (safety constraint) Trigger (input) © Jeff Offutt,

637 – Introduction (Ch 1) 2. Logical Expressions ( (a > b) or G ) and (x < y) Transitions Software Specifications Program Decision Statements Logical Expressions © Jeff Offutt,

637 – Introduction (Ch 1) 2. Logical Expressions n Predicate Coverage : Each predicate must be true and false –( (a>b) or G ) and (x < y) = True, False n Clause Coverage : Each clause must be true and false –(a > b) = True, False –G = True, False –(x < y) = True, False n Combinatorial Coverage : Various combinations of clauses –Active Clause Coverage: Each clause must determine the predicate’s result ( (a > b) or G ) and (x < y) © Jeff Offutt,

637 – Introduction (Ch 1) 2. Logic – Active Clause Coverage ( (a > b) or G ) and (x < y) 1 T F T 2 F F T duplicate 3 F T T 4 F F T 5 T T T 6 T T F With these values for G and (x b) determines the value of the predicate © Jeff Offutt,

637 – Introduction (Ch 1) 3. Input Domain Characterization n Describe the input domain of the software –Identify inputs, parameters, or other categorization –Partition each input into finite sets of representative values –Choose combinations of values n System level –Number of students { 0, 1, >1 } –Level of course { 600, 700, 800 } –Major { swe, cs, isa, infs } n Unit level –Parameters F (int X, int Y) –Possible values X: { 2 }, Y : { 10, 20, 30 } –Tests F (-5, 10), F (0, 20), F (1, 30), F (2, 10), F (5, 20) Equivalence Partition in the Pressman book © Jeff Offutt,

637 – Introduction (Ch 1) Input Domain Characterization (Equivalence Partitioning) Given a program that tells you what game to play, given a number of people available: -Spades (card game) players -Hearts (card game) players -Settlers of Cataan players -Taboo - > 10 players -Apples to Apples - > 10 players © Jeff Offutt,

637 – Introduction (Ch 1) Input Domain Characterization (Equivalence Partitioning) © Jeff Offutt, Between 4 and 10 > 10 < 4 > Between and < Number of input values

637 – Introduction (Ch 1) 4. Syntactic Structures n Based on a grammar, or other syntactic definition n Primary example is mutation testing 1.Induce small changes to the program: mutants 2.Find tests that cause the mutant programs to fail: killing mutants 3.Failure is defined as different output from the original program 4.Check the output of useful tests on the original program n Example program and mutants if (x > y) z = x - y; else z = 2 * x; if (x > y)  if (x >= y) z = x - y;  z = x + y;  z = x – m; else z = 2 * x; © Jeff Offutt,

637 – Introduction (Ch 1) Lets Try It… n Description of mutation operators – – © Jeff Offutt,

637 – Introduction (Ch 1) Coverage n Infeasible test requirements : test requirements that cannot be satisfied –No test case values exist that meet the test requirements –Dead code –Detection of infeasible test requirements is formally undecidable for most test criteria Given a set of test requirements TR for coverage criterion C, a test set T satisfies C coverage if and only if for every test requirement tr in TR, there is at least one test t in T such that t satisfies tr © Jeff Offutt,

637 – Introduction (Ch 1) Coverage Example n Coverage Criteria: test every node n Test Requirements: –Execute Node 1, –Execute Node 2, –Exceute Node … n Test Set: –Test Case 1: 1,2,5,6,7 –Test Case 2: 1,3,4,3,5,7 © Jeff Offutt, Criteria give you a recipe for test requirements

637 – Introduction (Ch 1) Two Ways to Use Test Criteria 1.Directly generate test values to satisfy the criterion often assumed by the research community most obvious way to use criteria. Very hard without automated tools 2.Generate test values externally and measure against the criterion usually favored by industry –sometimes misleading –if tests do not reach 100% coverage, what does that mean? © Jeff Offutt,

637 – Introduction (Ch 1) How to use Coverage Criteria (Direct method) n Define your representation of the system as one of the four models –Graph –Logical Expression –Input Domain –Syntactic Structure n Determine your criteria –What rule will you use (some examples.. There are many more!) We will cover every edge in the graph We will verify each boolean clause as true and false We will verify one value in each input partition (equivalence class) n Using that criteria, determine the set of Test Requirements you need to satisfy your criteria –Must cover graph edge (2,5), (1,6), (4,1), … n Create the test cases that satisfy your test criteria © Jeff Offutt,

637 – Introduction (Ch 1) Example – Direct Method 1. Model model PickSideKick.java as a graph. 1.A block of statements should be modelled as a 2.If there is a decision point, break off into two blocks 2. Generate some mutants 3. Write test cases that kill the mutants Example: –stmt 1; –stmt 2; –if x==1 stmt 3 stmt 4 –else stmt 5 –stmt 6 © Jeff Offutt, A B C E x == 1 I would avoid step 3 if I was you

637 – Introduction (Ch 1) Example – PickSideKick Mutants Line 72: if (currentPowers == null && currentPowers.length == 0) { Line 78: if (age++ > 18) Line 88: (needClaws() && afraidOfLoudNoises()) Line 100: return "Lois Lane”+”Lois Lane”; Line 124: for (int i=10; i<10000; i++) { Line 127: return !true; © Jeff Offutt, You can’t do it… I don’t even know why you’re trying!

637 – Introduction (Ch 1) Generators and Recognizers n Generator : A procedure that automatically generates values to satisfy a criterion n Recognizer : A procedure that decides whether a given set of test values satisfies a criterion n Both problems are provably undecidable for most criteria n It is possible to recognize whether test cases satisfy a criterion far more often than it is possible to generate tests that satisfy the criterion n Coverage analysis tools are quite plentiful © Jeff Offutt,

637 – Introduction (Ch 1) Some Tools n Static Analysis Tools –FindBugs - Finds MANY categories of bugs –Checkstyle - coding standard violations –PMD - Maybe a lot more, but seems to be mainly unused variables, also cut-n-paste code. –Jamit - Java Access Modifier Inference Tool - find tighter access modifiers –UPDATE Spring2010: SQE: A nice integration with Netbeans: – n Unit Testing –Junit – see UnitTesting Slides n Coverage Analysis Tool –Netbeans Plugins - Unit Tests Code Coverage Plugin n Mutation Testers – © Jeff Offutt,

637 – Introduction (Ch 1) Unit Testing n See unit testing slides © Jeff Offutt,

637 – Introduction (Ch 1) Test Coverage Criteria n Traditional software testing is expensive and labor-intensive n Formal coverage criteria are used to decide which test inputs to use n More likely that the tester will find problems n Greater assurance that the software is of high quality and reliability n A goal or stopping rule for testing n Criteria makes testing more efficient and effective But how do we start to apply these ideas in practice? © Jeff Offutt,

637 – Introduction (Ch 1) Static Verification n Don’t forget about static verification using people! n Automated static inspection tools are very effective as an aid to inspections - they are a supplement to but not a replacement for human inspections. n Formal or informal inspections (peer reviews) –Semi-formal approach to document reviews –Intended explicitly for defect detection (not correction). –Defects may be logical errors, anomalies in the code that might indicate an erroneous condition (e.g. an uninitialised variable) or non-compliance with standards. © Jeff Offutt,

637 – Introduction (Ch 1) Static Inspection Process n System overview presented to inspection team. n Code and associated documents are distributed to inspection team in advance. n Inspection takes place and discovered errors are noted. n Modifications are made to repair discovered errors. n Re-inspection may or may not be required. © Jeff Offutt, Use error checklists to focus inspection

637 – Introduction (Ch 1) Part 3 : How ? How do we get there ? Now we know what and why … © Jeff Offutt,

637 – Introduction (Ch 1) Testing Levels Based on Test Process Maturity  Level 0 : There's no difference between testing and debugging  Level 1 : The purpose of testing is to show correctness  Level 2 : The purpose of testing is to show that the software doesn't work  Level 3 : The purpose of testing is not to prove anything specific, but to reduce the risk of using the software  Level 4 : Testing is a mental discipline that helps all IT professionals develop higher quality software © Jeff Offutt,

637 – Introduction (Ch 1) Level 0 Thinking n Testing is the same as debugging n Does not distinguish between incorrect behavior and mistakes in the program n Does not help develop software that is reliable or safe This is what we teach undergraduate CS majors © Jeff Offutt, before CS 421 before CS 421

637 – Introduction (Ch 1) Level 1 Thinking n Purpose is to show correctness n Correctness is impossible to achieve n What do we know if no failures? –Good software or bad tests? n Test engineers have no: –Strict goal –Real stopping rule –Formal test technique –Test managers are powerless This is what hardware engineers often expect © Jeff Offutt,

637 – Introduction (Ch 1) Level 2 Thinking n Purpose is to show failures n Looking for failures is a negative activity n Puts testers and developers into an adversarial relationship n What if there are no failures? This describes most software companies. How can we move to a team approach ?? © Jeff Offutt,

637 – Introduction (Ch 1) Level 3 Thinking n Testing can only show the presence of failures n Whenever we use software, we incur some risk n Risk may be small and consequences unimportant n Risk may be great and the consequences catastrophic n Testers and developers work together to reduce risk This describes a few “enlightened” software companies © Jeff Offutt,

637 – Introduction (Ch 1) Level 4 Thinking A mental discipline that increases quality n Testing is only one way to increase quality n Primary responsibility to measure and improve software quality n Their expertise should help the developers This is the way “traditional” engineering works © Jeff Offutt,

637 – Introduction (Ch 1) Summary n More testing saves money –Planning for testing saves lots of money n Testing is no longer an “art form” –Engineers have a tool box of test criteria n When testers become engineers, the product gets better –The developers get better n Automated tools can help a lot, but don’t do the whole job © Jeff Offutt,