Path selection criteria Tor Stålhane & Wande Daramola.

Slides:



Advertisements
Similar presentations
1 Software Unit Test Coverage And Test Adequacy Hong Zhu, Patrick A. V. Hall, John H.R. May Presented By: Arpita Gandhi.
Advertisements

Test Yaodong Bi.
White Box and Black Box Testing Tor Stålhane. What is White Box testing White box testing is testing where we use the info available from the code of.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Lecture 11 Instructor Paulo Alencar.
Grey Box testing Tor Stålhane. What is Grey Box testing Grey Box testing is testing done with limited knowledge of the internal of the system. Grey Box.
Paul Ammann & Jeff Offutt
Introduction to Software Testing Chapter 2.1, 2.2 Overview Graph Coverage Criteria Paul Ammann & Jeff Offutt
Data Flow Testing (DFT) Data flow testing is NOT the same as constructing Design Diagrams in the form of data-flow-diagrams (DFD) or E-R diagrams. It is.
Unit Testing CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 27, 2007.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 16, 1999.
Software Testing and Quality Assurance White Box Testing.
Dependable Software Systems
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 5 Data Flow Testing
State coverage: an empirical analysis based on a user study Dries Vanoverberghe, Emma Eyckmans, and Frank Piessens.
1 1 Slide Simple Linear Regression Chapter 14 BA 303 – Spring 2011.
Topics in Software Dynamic White-box Testing: Data-flow Testing
Test coverage Tor Stålhane. What is test coverage Let c denote the unit type that is considered – e.g. requirements or statements. We then have C c =
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
White Box vs. Black Box Testing Tor Stålhane. What is White Box testing White box testing is testing where we use the info available from the code of.
1 ECE 453 – CS 447 – SE 465 Software Testing & Quality Assurance Instructor Kostas Kontogiannis.
Topics in Software Dynamic White-box Testing Part 2: Data-flow Testing
Data Flow Testing Data flow testing(DFT) is NOT directly related to the design diagrams of data-flow-diagrams(DFD). It is a form of structural testing.
Domain testing Tor Stålhane. Domain testing revisited We have earlier looked at domain testing as a simple strategy for selecting test cases. We will.
Path selection criteria Tor Stålhane & ‘Wande Daramola.
Software testing techniques Testing criteria based on data flow
Presented By Dr. Shazzad Hosain Asst. Prof., EECS, NSU
Software Testing (Part 2)
CMSC 345 Fall 2000 Unit Testing. The testing process.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
What is Software Testing? And Why is it So Hard J. Whittaker paper (IEEE Software – Jan/Feb 2000) Summarized by F. Tsui.
White-Box Testing Techniques II Originals prepared by Stephen M. Thebaut, Ph.D. University of Florida Dataflow Testing.
Overview Graph Coverage Criteria ( Introduction to Software Testing Chapter 2.1, 2.2) Paul Ammann & Jeff Offutt.
Grey Box testing Tor Stålhane. What is Grey Box testing Grey Box testing is testing done with limited knowledge of the internal of the system. Grey Box.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
White-box Testing.
Rescaling Reliability Bounds for a New Operational Profile Peter G Bishop Adelard, Drysdale Building, Northampton Square,
Software Testing and Maintenance Lecture 2.1 Overview Graph Coverage
White Box and Black Box Testing
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
1 Graph Coverage (3). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section 2.2 ◦ Section
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
Software Dynamic White-box Testing Part 2: Data-flow Testing Lecture 7 Prof. Mostafa Abdel Aziem Mostafa.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
CS223: Software Engineering Lecture 26: 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.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
PREPARED BY G.VIJAYA KUMAR ASST.PROFESSOR
Paul Ammann & Jeff Offutt
Software Testing and Maintenance 1
Structural testing, Path Testing
White-Box Testing.
Graph Coverage for Design Elements CS 4501 / 6501 Software Testing
White-Box Testing Techniques II
CHAPTER 4 Test Design Techniques
White-Box Testing Techniques II
Graph Coverage for Design Elements CS 4501 / 6501 Software Testing
Test coverage Tor Stålhane.
Sudipto Ghosh CS 406 Fall 99 November 16, 1999
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Graph Coverage Criteria
Examining Variables on Flow Paths
White-Box Testing Techniques II
Graph Coverage Criteria
White-Box Testing.
Tata Consultancy Services
Whitebox Testing.
Paul Ammann & Jeff Offutt
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Presentation transcript:

Path selection criteria Tor Stålhane & Wande Daramola

Why path selection criteria White box testing using the test-all-paths strategy can be tedious and expensive. The strategies discussed here will reduce the number of paths to be tested. As with all white box tests, it should only be used for small chunks of code – less than say 200 lines.

Variables have a defined life cycle: created, used, and killed (destroyed) { // begin outer block int x; // x is defined as an integer within this outer block …; // x can be accessed here { // begin inner block int y; // y is defined within this inner block...; // both x and y can be accessed here } // y is automatically destroyed at the end of this block...; …;// x can still be accessed, but y is gone } // x is automatically destroyed Data flow testing

define, use, kill (duk) – 1 We define three usages of a variable: d – define the variable u – use the variable k – kill the variable. A large part of those who use this approach will only use define and use – du. Based on the usages we can define a set of patterns potential problems.

duk – 2 We have the following nine patterns: dd: define and then define again – error dk: define and then kill – error ku: kill and then used – error kk: kill and then kill again – error du: define and then use – OK kd: kill and then redefine – OK ud: use and then redefine – OK uk: use and then kill – OK uu: use and then use – OK

duk examples (x) – 1 Define x Use x Define x Use x ddu du

duk examples (y) - 2 Define y Use y Define y Use y Kill y Use y Kill y uduk udk

duk examples (z) - 3 Kill z Use z Kill z Define z Kill z Define z Kill z Use z kuuud kkduud Use z

Dynamic data flow testing Test strategy – 1 Based on the three usages we can define a total of seven testing strategies. We will have a quick look at each All definitions (AD): test cases cover each definition of each variable for at least one use of the variable. All predicate-uses (APU): there is at least one path of each definition to p-use of the variable

Test strategy – 2 All computational uses (ACU): there is at least one path of each variable to each c- use of the variable All p-use/some c-use (APU+C): there is at least one path of each variable to each c- use of the variable. If there are any variable definitions that are not covered then cover a c-use

Test strategy – 3 All c-uses/some p-uses (ACU+P): there is at least one path of each variable to each c-use of the variable. If there are any variable definitions that are not covered then cover a p-use. All uses (AU): there is at least one path of each variable to each c-use and each p- use of the variable.

Test strategy – 4 All du paths (ADUP): test cases cover every simple sub-path from each variable definition to every p-use and c-use of that variable. Note that the “kill” usage is not included in any of the test strategies.

Application of test strategies – 1 Define x c-use x c-use z Kill z c-use x Define z p-use y Kill z Define y p-use z c-use c-use z Kill y Define z All definitions All c-use Define x c-use x c-use z Kill z c-use x Define z p-use y Kill z Define y p-use z c-use c-use z Kill y Define z All p-use

Application of test strategies – 2 Define x c-use x c-use z Kill z c-use x Define z p-use y Kill z Define y p-use z c-use c-use z Kill y Define z ACU APU+C

Relationship between strategies - 1 All paths All du-paths All uses All c/some p All p/some c All c-uses All p-uses All defs Branch Statement The higher up in the hierarchy, the better is the test strategy

Relationship between strategies - 2 To make the relationships clear: The main testing method here is path- testing. However, since full path testing often will require us to execute a large number of paths, the duk-strategy helps us to reduce the number of paths necessary. The diagram on the preceding slide helps us to make the necessary decisions.

Acknowledgement The material on the duk patterns and testing strategies are taken from a presentation made by L. Williams at the North Carolina State University. Available at: Further Reading: An Introduction to data flow testing – Janvi Badlaney et al., 2006 Available at: ftp://ftp.ncsu.edu/pub/tech/2006/TR pdf

Use of coverage measures Tor Stålhane

Model – 1 We will use the following notation: c: a coverage measure r(c): reliability 1 – r(c): failure rate r(c) = 1 – k*exp(-b*c) Thus, we also have that ln[1 – r(c)] = ln(k) – b*c

Model – 2 The equation ln[1 – r(c)] = ln(k) – b*c is of the same type as Y = α*X + β. We can thus use linear regression to estimate the parameters k and b by doing as follows: 1.Use linear regression to estimate α and β 2.We then have –k = exp(α) –b = - β

Coverage measures considered We have studied the following coverage measures: Statement coverage: percentage of statements executed. Branch coverage: percentage of branches executed LCSAJ Linear Code Sequence And Jump

Statement coverage

Graph summary

Equation summary Statements: -ln(F) = C statement, R 2 (adj) = 85.3 Branches: -ln(F) = C branches, R 2 (adj) = 82.6 LCSAJ -ln(F) = C LCSAJ, R 2 (adj) = 77.8

Usage patterns – 1 Not all parts of the code are used equally often. When it comes to reliability, we will get the greatest effect if we have a high coverage for the code that is used most often. This also explains why companies or user groups disagrees so much when discussing the reliability of a software product.

Usage patterns – 2 input domain X X X X X X X X X X Input space A Corrected

Usage patterns – 3 As long as we do not change our input space – usage pattern – we will experience no further errors. New user groups with new ways to use the system will experience new errors.

Usage patterns – 4 input domain X X X X X X Input space A Input space B

Extended model – 1 We will use the following notation: c: coverage measure r(c): reliability 1 – r(c): failure rate r(c) = 1 – k*exp(-a*p*c) p: the strength of the relationship between c and r. p will depend the coupling between coverage and faults. a: scaling constant

Extended model – 2 C 1 - k R(C) 1 Large p Small p Residual unreliability

Extended model - comments The following relation holds: ln[1 – r(c)] = ln(k) – a*p*c Strong coupling between coverage and faults will increase the effect of test coverage on the reliability. Weak coupling will create a residual gap for reliability that cannot be fixed by more testing, only by increasing the coupling factor p – thus changing the usage pattern.

Bishop’s coverage model – 1 Bishop’s model for predicting remaining errors is different from the models we have looked at earlier. It has a Simpler relationship between number of remaining errors and coverage More complex relationship between number of tests and achieved coverage

Bishop’s coverage model – 2 We will use f = P(executed code fails). Thus, the number of observed errors will depend on three factors Whether the code –Is executed – C –Fails during execution – f Coupling between coverage and faults - p N 0 – N(n) = F(f, C(n, p)) C(n) = 1 – 1/(1 + kn p )

Bishop’s coverage model – 3 Based on the assumptions and expression previously presented, we find that If we use the expression on the previous slide to eliminate C(n) we get

A limit result It is possible to show that the following relation holds under a rather wide set of conditions: The initial number of defects – N 0 – must be estimated e.g. based on experience from earlier projects as number of defects per KLOC.

An example from telecom