Systems V & V, Quality and Standards

Slides:



Advertisements
Similar presentations
Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Advertisements

DATAFLOW TESTING DONE BY A.PRIYA, 08CSEE17, II- M.s.c [C.S].
Chapter 9 Code optimization Section 0 overview 1.Position of code optimizer 2.Purpose of code optimizer to get better efficiency –Run faster –Take less.
Data Flow Coverage. Reading assignment L. A. Clarke, A. Podgurski, D. J. Richardson and Steven J. Zeil, "A Formal Evaluation of Data Flow Path Selection.
DETAILED DESIGN, IMPLEMENTATIONA AND TESTING Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Black Box Testing Csci 565 Spring 2009.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
The Application of Graph Criteria: Source Code  It is usually defined with the control flow graph (CFG)  Node coverage is used to execute every statement.
White Box Testing and Symbolic Execution Written by Michael Beder.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 16, 1999.
Software Testing and Quality Assurance
Testing an individual module
Chapter 18 Testing Conventional Applications
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
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
Introduction to Software Testing Chapter 2.3 Graph Coverage for Source Code Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
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.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
Path Testing + Coverage Chapter 9 Assigned reading from Binder.
1 Software Testing. 2 Path Testing 3 Structural Testing Also known as glass box, structural, clear box and white box testing. A software testing technique.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Test Coverage CS-300 Fall 2005 Supreeth Venkataraman.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
CS 217 Software Verification and Validation Week 7, Summer 2014 Instructor: Dong Si
Introduction to Software Testing Chapter 2.3 Graph Coverage for Source Code Paul Ammann & Jeff Offutt
Theory and Practice of Software Testing
SOFTWARE TESTING. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves any activity.
Dynamic Testing.
DETAILED DESIGN, IMPLEMENTATION AND TESTING Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Control Flow Graphs : The if Statement 1 if (x < y) { y = 0; x = x + 1; } else { x = y; } x >= yx < y x = y y = 0 x = x + 1 if (x < y) { y = 0;
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
Dynamic White-Box Testing What is code coverage? What are the different types of code coverage? How to derive test cases from control flows?
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Paul Ammann & Jeff Offutt
Software Testing.
White-Box Testing Pfleeger, S. Software Engineering Theory and Practice 2nd Edition. Prentice Hall, Ghezzi, C. et al., Fundamentals of Software Engineering.
Control Flow Testing Handouts
Software Engineering (CSI 321)
Dataflow Testing, Object-Oriented
Software Testing and Maintenance 1
Paul Ammann & Jeff Offutt
Paul Ammann & Jeff Offutt
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Paul Ammann & Jeff Offutt
Structural testing, Path Testing
White-Box Testing.
White-Box Testing Techniques II
Paul Ammann & Jeff Offutt
CHAPTER 4 Test Design Techniques
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Dataflow Testing G. Rothermel.
White-Box Testing Techniques II
“White box” or “glass box” tests
Paul Ammann & Jeff Offutt
Sudipto Ghosh CS 406 Fall 99 November 16, 1999
Graph Coverage for Source Code
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
White-Box Testing Techniques II
White-Box Testing.
Paul Ammann & Jeff Offutt
Whitebox Testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing.
Unit III – Chapter 3 Path Testing.
Presentation transcript:

Systems V & V, Quality and Standards Dr Sita Ramakrishnan School CSSE Monash University

Test Coverage Criteria based on Data Flow Mechanisms Topics Program Structure Categories of Data Flow Coverage Criteria Data Flow Testing References: Peters J F and Pedrycz W,Software Engineering, An Engineering Approach, McGraW Hill, 2000, (Ch.12, Software Testing, pp.437-500) Horgan J.R., London S., Lyu M.R. Achieving software quality with testing coverage measures. IEEE Computer, Sep. 1994: 60-69 Other references (books included in the slides, conference & journal papers) given in the handout for the unit © S Ramakrishnan

Program Structure Program consists of blocks Block consists of a sequence of statements When a first statement is executed, the following statements are executed in the given order Can be represented by a flow graph © S Ramakrishnan

Testing Coverage Have looked at testing techniques such as: Black-box testing which includes categories such as: Syntax-driven driven testing – where specification is described by a certain grammar. -> Generate test cases such that each production rule is applied/tested at least once Decision-table based testing – may suit if requirements have been written as if-then rules Cause-effect graphs in functional testing – addresses limitations of decision table where all inputs are treated separately although real world problem demand another approach. Boundary-value analysis & equivalence class partition also assume the independence of input Structural testing – includes basic categories such as statement, branch & path coverage tests © S Ramakrishnan

Testing Coverage More on Black-box Testing with Cause-Effect Graphs: Cause-effect graphs capture relationships between specific combination of inputs (causes) and outputs (effects). Helps avoid combinatorial explosion associated with decision table approach Causes and Effects represented as nodes of a cause-effect graph – includes intermediate nodes to link cause & effects in forming logical expressions © S Ramakrishnan

Testing Coverage – Cause-Effect Graphs Eg. of an ATM transaction system. Causes and Effected listed as: Causes: C1 : Command is credit, C2: Command is Debit C3: Account No. is valid, C4: Trans. Amount is valid Effects: E1: Print “invalid command”, E2: “invalid acct no” E3: “debit no. not valid”, E4 & E5: debit & credit a/c respectively or C1 E1 and C2 E2 and C3 E3 and C4 and E4 Cause-effect graph © S Ramakrishnan E5

Testing Coverage – Cause-Effect Graphs 4 input (Cause) nodes & 5 output (Effect) nodes the node in between input (C ) & output (E ) realise “and” or “or” operators Processing node used in cause-effect graph – and, or, negation, and with processing node, “and” - effect occurs if all inputs are true “or” - effect occurs if at least one input is true “negation” – effect occurs if inputs are false Cause-Effect graph helps determine the corresponding test cases © S Ramakrishnan

Testing Coverage – Cause-Effect Graphs Eg. To determine test cases from C-E Graph Want to find out the causes for E3 say given: C2 C3 C4 C1 C2 C3 C4 X 1 1 0 X= (don’t care condition) 1 = true, 0 = false E3 does not depend on Cause (C1) and E3 © S Ramakrishnan

Test coverage based on Data Flow Coverage Criteria Why data flow orientation in testing? Data structures and their usage are essential elements of any code and hence need to be taken into account when looking at software testing Main categories of data flow coverage criteria basic block all-use c-use d-use du-path © S Ramakrishnan

Test coverage based on Data Flow Coverage Criteria In a piece of Java code: Eg sum = 0; Definitions shown in blue prod = 0; i = 1; while (i <= n) { sum+ = i; basic block shown in purple prod* = i; -> prod* = i an eg of “use” i++ -> i++ also an eg of “use” } if “use” appears in a computational if (k == 0) print_results1; expression, the pair is c-use, if in predicate, resulting pair is p-use if (k == 1) compute; © S Ramakrishnan

Test coverage based on Data Flow Coverage Criteria Definition – value stored in a memory location Defined (d) – data structure is defined, created or initialized when it is given a valid state Use – value fetched from a memory location C-use – used in computation or output statement & - associated with each node P-use – used in a predicate& associated with each edge C-uses Decision Basic Block All-uses P-uses Hierarchy of different dataflow coverage criteria © S Ramakrishnan

Test coverage based on Data Flow Coverage Criteria Def-use Graph Obtained from the flow graph Associate with each node the sets C-use (i) - variables which have global c-uses in block i Def (i) - variables with global definitions in block i Associate with each edge (i,j) P-use (i,j) – variables which have p-uses on edge (i,j) Define sets of nodes dpu(x,i) - edges (j,k) such that x Є p-use(j,k) and there is a def-clear path w.r.t. x from i to (j,k) dcu(x,i) - nodes j such that x Є c-use(j) and there is a def-clear path w.r.t. x from i to j © S Ramakrishnan

Test coverage based on Data Flow Coverage Criteria Def-use Graph Paths – Definitions Complete path – path from entry node to exit node Def-clear path w.r.t. x from node i to node j and from node i to edge nm , j a path (i, n1,n2, …n , j) containing no definitions or undefinitions of x in nodes n1, n2, ….n m m © S Ramakrishnan

Test coverage based on Data Flow Coverage Criteria The family of data flow testing criteria is based on requiring that – The test data execute definition-clear paths from each node containing a global definition of a variable to specified nodes containing global c-uses and edge containing p-uses of that variable For each variable definition, data flow testing criteria require that All/some definition-clear paths w.r.t. that variable from the node containing the definition to all/some of that uses/c-uses/p-uses reachable by some such paths be executed © S Ramakrishnan

Test coverage based on Data Flow Coverage Criteria All-def criterion If variable x has a global definition in node i, the all-defs criterion requires the test data to exercise some path which goes from i to some node or edge at which the value assigned to x in node i is used All-uses criterion If variable x has a global definition in node i, the all-uses criterion requires the test data to exercise at least one path which goes from i to each node or edge at which the value assigned to x in node i is used © S Ramakrishnan

Test coverage based on Data Flow Coverage Criteria All-DU-paths criterion If variable x has a global definition in node i, the all-DU-paths criterion requires the test data to exercise all paths which go from i to each node and edge at which the value assigned to x in node i is used Other DF testing criteria All-p-uses All-c-uses All-p-uses/some-c-uses All-c-uses/some-p-uses © S Ramakrishnan

Test coverage based on Data Flow Coverage Criteria Hierarchy of data flow coverage criteria all-paths all-du-paths all-uses all-c-uses-some-p-uses all-p-uses-some-c-uses all-c-uses all-defs all-p-uses all-edges all-nodes © S Ramakrishnan

Test coverage based on Data Flow Coverage Criteria Interprocedural Data Flow Testing Most df testing methods deal with dependencies that exist within a procedure – intra procedural aspect Data dependencies may also exist between procedures Requires analysis of flow of data across these procedure/module boundaries © S Ramakrishnan

Test coverage based on Data Flow Coverage Criteria Homework: Closer look at Table 12.6 Coverage Criteria on P.479 in Peters & Pedrycz text (see slide 1 for Reference details) © S Ramakrishnan