Coverage Principle: A Mantra for Software Testing and Reliability Aditya P. Mathur Purdue University August 28, Cadence Labs, Chelmsford Last update:August.

Slides:



Advertisements
Similar presentations
A Systems Approach To Training
Advertisements

Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
Software Testing Part III: Test Assessment and Improvement
Software Testing and QA Theory and Practice (Chapter 2: Theory of Program Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and.
Foundations of Software Testing Chapter 1: Section 1.19 Coverage Principle and the Saturation Effect Aditya P. Mathur Purdue University Last update: August.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 16, 1999.
1 Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Department.
Aditya P. Mathur Professor, Department of Computer Science, Associate Dean, Graduate Education and International Programs Purdue University Wednesday July.
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
State coverage: an empirical analysis based on a user study Dries Vanoverberghe, Emma Eyckmans, and Frank Piessens.
CS 406 Fall 98 Software Testing Part III: Test Assessment and Improvement Aditya P. Mathur Purdue university Last update: July 19, 1998.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
1 Aditya P. Mathur Head and Professor Department of Computer Science, Purdue University ABB, Sweden Monday April 7, 2008 Towards a Radically New Theory.
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec22 1 Lecture 22: Software Measurement Basics of software measurement.
Software Testing. Recap Software testing – Why do we do testing? – When it is done? – Who does it? Software testing process / phases in software testing.
Software Testing and Reliability Software Test Process
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Verification and Validation Overview References: Shach, Object Oriented and Classical Software Engineering Pressman, Software Engineering: a Practitioner’s.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Testing Theory cont. Introduction Categories of Metrics Review of several OO metrics Format of Presentation CEN 5076 Class 6 – 10/10.
© SERG Dependable Software Systems (Mutation) Dependable Software Systems Topics in Mutation Testing and Program Perturbation Material drawn from [Offutt.
Coverage – “Systematic” Testing Chapter 20. Dividing the input space for failure search Testing requires selecting inputs to try on the program, but how.
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.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Foundations of Software Testing Chapter 1: Preliminaries Last update: September 3, 2007 These slides are copyrighted. They are for use with the Foundations.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
CPIS 357 Software Quality & Testing I.Rehab Bahaaddin Ashary Faculty of Computing and Information Technology Information Systems Department Fall 2010.
Software Engineering Chapter 3 CPSC Pascal Brent M. Dingle Texas A&M University.
Testing, Monitoring, and Control of Internet Services Aditya P. Mathur Purdue University Friday, April 15, Washington State University, Pullman,
White Box-based Coverage Testing (© 2012 Professor W. Eric Wong, The University of Texas at Dallas) 111 W. Eric Wong Department of Computer Science The.
Mutation Testing G. Rothermel. Fault-Based Testing White-box and black-box testing techniques use coverage of code or requirements as a “proxy” for designing.
Experimentation in Computer Science (Part 2). Experimentation in Software Engineering --- Outline  Empirical Strategies  Measurement  Experiment Process.
Testing Internet Services Sudipto Ghosh Sambhrama Mundkur Aditya P. Mathur: PI Ramkumar Natarajan Baskar Sridharan Department of Computer Sciences Purdue.
Software Quality Assurance and Testing Fazal Rehman Shamil.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
Mutation Testing Breaking the application to test it.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 23, 1999.
Foundations of Software Testing Chapter 7: Test Adequacy Measurement and Enhancement Using Mutation Last update: September 3, 2007 These slides are copyrighted.
Foundations of Software Testing Chapter 5: Test Selection, Minimization, and Prioritization for Regression Testing Last update: September 3, 2007 These.
Week # 4 Quality Assurance Software Quality Engineering 1.
Foundations of Software Testing Chapter 7: Test Adequacy Measurement and Enhancement Using Mutation Last update: September 3, 2007 These slides are copyrighted.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
CS223: Software Engineering Lecture 25: Software Testing.
Foundations of Software Testing Slides based on: Draft V1.0 August 17, 2005 Test Adequacy Measurement and Enhancement Using Mutation Last update: October.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XVIII. Software Testing.
Aditya P. Mathur Purdue University
Regression Testing with its types
Introduction Edited by Enas Naffar using the following textbooks: - A concise introduction to Software Engineering - Software Engineering for students-
Software Testing.
Software Testing Day 1: Preliminaries
Software Engineering (CSI 321)
Reliability and Validity
Software Testing An Introduction.
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 2 Theory of Program Testing
Aditya P. Mathur Purdue University
Structural testing, Path Testing
Types of Testing Visit to more Learning Resources.
Air Carrier Continuing Analysis and Surveillance System (CASS)
Software Quality Engineering
Introduction Edited by Enas Naffar using the following textbooks: - A concise introduction to Software Engineering - Software Engineering for students-
Software Reliability Models.
Software Testing (Lecture 11-a)
Sudipto Ghosh CS 406 Fall 99 November 16, 1999
Laboratory of Advanced Research on Software Technology
Coverage Principle: A Mantra for Software Testing and Reliability
Software Testing Part III: Test Assessment and Improvement
Presentation transcript:

Coverage Principle: A Mantra for Software Testing and Reliability Aditya P. Mathur Purdue University August 28, Cadence Labs, Chelmsford Last update:August 25, 1998

Coverage Principle2 Summary 4 Errors creep into programs through a natural process. 4 Measurement and use of coverage assists in the discovery of errors. 4 Use of the coverage principle and a knowledge of the saturation effect allows us to design a controlled process for software testing.

Coverage Principle3 Why Coverage Principle? 4 Software testing is often an ill-conceived, poorly organized, and poorly understood task in the software life cycle. Coverage Principle gives birth to a systematic process to improve this state of affairs.

Coverage Principle4 Prerequisites 4 To understand the Coverage Principle, we need to understand –Properties of errors –Test adequacy –Coverage

Coverage Principle5 Errors 4 A variation from the expected often becomes an error. 4 Errors are a part of life. The process for their creation is in-built into nature by nature. 4 They exist for anyone who has the ability to observe.

Coverage Principle6 Error: Elimination or Reduction? 4 In most practical situations, total error elimination is a myth. 4 Error reduction based on the economics of software development is a practical approach.

Coverage Principle7 Errors: Examples 4 TeX (Knuth): 850 errors over a 10 year period. 4 Windows 95: “large” error database maintained by Microsoft (proprietary) 4 Several other error studies published. 4 Error studies have also been published in other diverse fields such as in music, speech, sports, and civil engineering.

Coverage Principle8 Nature of Errors 4 As simple as: –A  should have been  (This was error #536 made by Knuth in TeX.) 4 Or as complex as: –Incorrect algorithm for fixed point multiplication. (This was error #854 made by Knuth in TeX. A similar error occurred in an earlier version of Pentium.)

Coverage Principle9 Languages and Errors 4 The programming language used has no known correlation with the complexity of the errors one can make. 4 It also has no known correlation to the number of errors in a program.

Coverage Principle10 Human Capability and Errors 4 Errors are made by all kinds of people regardless of their individual talents and background. 4 Well known programmers make errors that are also made by freshmen in programming courses.

Coverage Principle11 Errors:Consequences 4 An error might lead to a failure. 4 The failure might cause a minor inconvenience or a catastrophe. 4 The complexity of an error has no known correlation with the severity of a failure. The “misplaced break” is an example of a simple error that caused the AT&T phone- jam in 1990.

Coverage Principle12 Errors:Unavoidable! 4 Errors are bound to creep into software. 4 This belief enhances the importance of testing. 4 Errors that creep in during various phases of development can be removed using a well defined and controlled process of software testing.

Coverage Principle13 Errors:Probability 4 The probability of a program delivered with errors can be reduced to an infinitesimally small quantity.....but not to 0! 4 Exceptions to the above can be concocted with the help of programs that have a finite input domain. 4 Verification and inspection help reduce errors and are complementary to testing.

Coverage Principle14 Error Detection and Removal Develop/correct Test Observe Error? Yes No Test set (T) Requirements Oracle

Coverage Principle15 What is Test Assessment? 4 Given a test set T, a collection of test inputs, we ask: How good is T? 4 Measurement of the goodness of T is test assessment. 4 Test assessment is carried out based on one or more test adequacy criteria.

Coverage Principle16 Test Assessment-continued 4 Test assessment provides the following information: –A metric, also known as the adequacy score or coverage, usually between 0 and 1. –A list of all the weaknesses in T, which when removed, will raise the score to 1. –The weaknesses depend on the criteria used for assessment.

Coverage Principle17 Test Assessment-continued 4 Once coverage has been computed, and the weaknesses identified, one can improve T. 4 Improvement of T is done by examining one or more weaknesses and constructing new test requirements designed to overcome the weaknesses. 4 The new test requirements lead to new test specifications and to further testing of the program.

Coverage Principle18 Test Assessment-continued 4 This is continued until all weaknesses are overcome, i.e. the adequacy criterion is satisfied (coverage=1). 4 In some instances it may not be possible to satisfy the adequacy criteria for one or more of the following reasons: Lack of sufficient manpower Weaknesses that cannot be removed because they are infeasible.

Coverage Principle19 Test Assessment-continued The cost of removing the weaknesses is not justified. 4 While improving T by removing its weaknesses, one usually tests the program more thoroughly than it has been tested so far. 4 This additional testing is likely to result in the discovery of some or all of the remaining errors.

Coverage Principle20 Test Assessment-Summary Measure adequacy of T w.r.t. C. Is T adequate? Select an adequacy criterion C. Improve T More testing is warranted ? No Yes Develop T 0 6

Coverage Principle21 Principle Underlying Test Assessment 4 A uniform principle underlies test assessment throughout the testing process. 4 This principle is known as the coverage principle. 4 It has come about as a result of extensive empirical studies.

Coverage Principle22 Coverage Domains 4 To formulate and understand the coverage principle, we need to understand: –coverage domains –coverage elements 4 A coverage domain is a finite domain that we want to cover. Coverage elements are the individual elements of this domain.

Coverage Principle23 Coverage Domains and Elements Requirements Classes Functions Mutations Exceptions Data-flows Coverage Domains Coverage Elements

Coverage Principle24 The Coverage Principle Measuring test adequacy and improving a test set against a sequence of well defined, increasingly strong, coverage domains leads to improved reliability of the system under test.

Coverage Principle25 Error Detection Effectiveness 4 Each coverage criterion has its error detection ability. This is also known as the error detection effectiveness or simply effectiveness of the criterion. 4 One measure of the effectiveness of criterion C is the fraction of faults guaranteed to be revealed by a test T that satisfies C.

Coverage Principle26 Effectiveness-continued 4 Another measure is the probability that at least fraction f of the faults in P will be revealed by test T that satisfies C. 4 There is no absolute measure of the effectiveness of any given coverage criterion for a general class of programs and for arbitrary test sets.

Coverage Principle27 Effectiveness-continued 4 Empirical studies give us an idea of the relative goodness of various coverage criteria. 4 Thus, for a variety of criteria we can make a statement like: Criterion C1 is definitely better than criterion C2.

Coverage Principle28 Effectiveness-continued 4 In some cases we may be able to say: Criterion C1 is probably better than criterion C2. 4 Such information allows us to construct a hierarchy of coverage criteria. 4 This hierarchy is helpful in organizing and managing testing using feedback control of the development and testing process.

Coverage Principle29 Sample Hierarchy Requirements coverage Function/method coverage Statement coverage Decision coverage Data-flow coverage Mutation coverage Strength Low High

Coverage Principle30 The Saturation Effect 4 The rate at which new faults are discovered reduces as test adequacy, with respect to a finite coverage domain, increases; it reduces to zero when the coverage domain has been exhausted. coverage 01

Coverage Principle31 Saturation Effect: Reliability View FUNCTIONAL, DECISION, DATAFLOW AND MUTATION TESTING PROVIDE TEST ADEQUACY CRITERIA. Reliability Testing Effort True reliability (R) Estimated reliability (R’) Saturation region Mutation Dataflow Decision Functional RmRm R df RdRd RfRf R’ f R’ d R’ df R’ m tfstfs tfetfe tdstds tdetde t df s t df e tmstms tfetfe

Coverage Principle32 Test Strategy 4 One can develop a test strategy based on one or more test adequacy criteria. 4 Example: –A test strategy based on the statement coverage criterion will begin by evaluating a test set T against this criterion. Then new tests will be added to T until all the reachable statements are covered, i.e. T satisfies the criterion.

Coverage Principle33 Reliability Measurement Input domain Valid inputs as per a operational profile Random sampling Program under test Failure data Reliability model Reliability estimate Another operational profile

Coverage Principle34 Reliability and Coverage Reliability Coverage low high Desirable Suspect modelUndesirable Risky

Coverage Principle35 Feedback Control Specifications Program Required Reliability Observed Reliability Effort - + f(e) Additional effort What is f ?

Coverage Principle36 Summary 4 Errors creep into programs through a natural process. 4 Measurement and use of coverage assists in the discovery of errors. 4 Use of the coverage principle and a knowledge of the saturation effect allows us to design a controlled process for software testing.