Ch6: Software Verification. 1 White-box testing  Structural testing:  (In)adequacy criteria  Control flow coverage criteria.

Slides:



Advertisements
Similar presentations
Whitebox Testing Fra: CS Fall Whitebox Testing AKA Structural, Basis Path Test Normally used at unit level Assumes errors at unit level are.
Advertisements

SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
Axiomatic Verification I Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 17.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION TESTING II Autumn 2011.
Chapter 9 Describing Process Specifications and Structured Decisions
Ch6: Software Verification. 1 Statement coverage criterion  Informally:  Formally:  Difficult to minimize the number of test cases and still ensure.
Testing an individual module
1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.
PRE-PROGRAMMING PHASE
Software Testing and QA Theory and Practice (Chapter 4: Control Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
The University of Texas – Pan American
Let us start from the V-Model Verification Phases Requirements analysis System Design Architecture Design Module Design Coding Validation phases Unit.
Implementation Yaodong Bi. Introduction to Implementation Purposes of Implementation – Plan the system integrations required in each iteration – Distribute.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Testing phases. Test data Inputs which have been devised to test the system Test cases Inputs to test the system and the predicted outputs from these.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Chapter 13: Implementation Phase 13.3 Good Programming Practice 13.6 Module Test Case Selection 13.7 Black-Box Module-Testing Techniques 13.8 Glass-Box.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
From Use Cases to Test Cases 1. A Tester’s Perspective  Without use cases testers will approach the system to be tested as a “black box”. “What, exactly,
Chapter 3 Making Decisions
CS /51 Illinois Institute of Technology CS487 Software Engineering Software Testing Techniques Mr. David A. Lash.
Ch6: Software Verification. 1 Decision table based testing  Applicability:  Spec. is described by a decision table.  Tables describe:  How combinations.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
CHAPTER 4: CONDITIONAL STRUCTURES Introduction to Computer Science Using Ruby (c) 2012 Ophir Frieder et al.
Proofs of Correctness: An Introduction to Axiomatic Verification Prepared by Stephen M. Thebaut, Ph.D. University of Florida CEN 5035 Software Engineering.
Agenda Introduction Overview of White-box testing Basis path testing
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
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.
CSE403 Software Engineering Autumn 2001 More Testing Gary Kimura Lecture #10 October 22, 2001.
Software Testing Yonsei University 2 nd Semester, 2014 Woo-Cheol Kim.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
Software Testing. Software testing is the execution of software with test data from the problem domain. Software testing is the execution of software.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
Algorithm Design.
Advanced Program Design. Review  Step 1: Problem analysis and specification –Specification description of the problem’s inputs and output –Analysis generalize.
1 Verification. 2 Outline What are the goals of verification? What are the main approaches to verification? –What kind of assurance do we get through.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
White Box Testing Arun Lakhotia University of Southwestern Louisiana P.O. Box Lafayette, LA 70504, USA
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.
1 Test Coverage Coverage can be based on: –source code –object code –model –control flow graph –(extended) finite state machines –data flow graph –requirements.
Algorithms and Decision Procedures for Regular Languages Chapter 9.
Dynamic White-Box Testing What is code coverage? What are the different types of code coverage? How to derive test cases from control flows?
White-Box Testing Statement coverage Branch coverage Path coverage
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Software Testing. SE, Testing, Hans van Vliet, © Nasty question  Suppose you are being asked to lead the team to test the software that controls.
SOFTWARE TESTING AND QUALITY ASSURANCE. Software Testing.
CS223: Software Engineering Lecture 26: Software Testing.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Testing Integral part of the software development process.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Software Testing.
Software Testing.
Control Flow Testing Handouts
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Software Engineering (CSI 321)
Outline of the Chapter Basic Idea Outline of Control Flow Testing
Structural testing, Path Testing
White-Box Testing.
CHAPTER 4 Test Design Techniques
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Designing and Debugging Batch and Interactive COBOL Programs
Unit# 9: Computer Program Development
Program Design Introduction to Computer Programming By:
Software Testing (Lecture 11-a)
White-Box Testing.
Chapter 11 Describing Process Specifications and Structured Decisions
COSC 4506/ITEC 3506 Software Engineering
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

Ch6: Software Verification

1 White-box testing  Structural testing:  (In)adequacy criteria  Control flow coverage criteria

2 Statement coverage criterion  Informally:  Formally:  Difficult to minimize the number of test cases and still ensure the execution of all statements

3 Statement coverage criterion (contd..) Example read (x); read (y); if x > 0 then write ("1"); else write ("2"); end if; if y > 0 then write ("3"); else write ("4"); end if; {,,, } covers all statements {, } is minimal

4 Statement coverage criterion if x < 0 then x := -x; end if z = :x; This may be rewritten as: if x < 0 then x := -x; else null; end if z := x;

5 Edge coverage criterion  Criterion:  What is a control flow graph, and how to construct it?  Finer than statement coverage criterion

6 Control graph construction rules I/O, assignment, or procedure call GG 1 2 if-then-else G 1 if-then G 1 while loop G 1 G 2 two sequential statements

7 Simplification A sequence of edges can be collapsed into just one edge... nn n n n k-1k12 3 n 1 n k

8 Example: Euclid’s algorithm begin read (x); read (y); while x ≠ y loop if x > y then x := x - y; else y := y - x; end if; end loop; gcd : = x; end;

9 Weakness of edge coverage criterion found := false; counter := 1; while (not found) and counter < number_of_items loop if table (counter) = desired_element then found := true; end if; counter := counter + 1; end loop; if found then write ("the desired element is in the table"); else write ("the desired element is not in the table"); end if; test cases: (1) empty table, (2) table with 3 items, second of which is the item to look for

10 Condition coverage criterion  Condition coverage:  Finer than edge coverage

11 Weakness of condition coverage criterion if x ≠ 0 then y := 5; else z := z - x; end if; if z > 1 then z := z / x; else z := 0; end if; {, } causes the execution of all edges, but fails to expose the risk of a division by zero

12 Path-coverage criterion  Path coverage criteria:  Finer than previous kinds of coverage  Issues with path coverage criteria  Path coverage criterion may be used as a guide to determining a few critical paths.

13 White-box testing (contd..)  Guidelines for testing loops:  Guidelines for IF and CASE statements  Once a criterion has been chosen, actual input values may be chosen.  How do you decide which criterion to use?  Can (and should) different criterion be applied to different modules in the same system?

14 White-box testing (contd..)  The presence of unreachable statements may mean that 100% coverage is not achieved.  In summary, whatever coverage criterion we decide, human intervention is needed to solve problems (reachability, etc.)

15 White-box testing (contd..)  Problems with white-box testing:

16 Black-box testing  What is black-box testing:

17 Black-box testing (contd..) The program receives as input a record describing an invoice. (A detailed description of the format of the record is given.) The invoice must be inserted into a file of invoices that is sorted by date. The invoice must be inserted in the appropriate position: If other invoices exist in the file with the same date, then the invoice should be inserted after the last one. Also, some consistency checks must be performed: The program should verify whether the customer is already in a corresponding file of customers, whether the customer’s data in the two files match, etc. Example specification

18 Black-box testing (contd..) Did you consider these cases? An invoice whose date is the current date An invoice whose date is before the current date (This might be even forbidden by law) This case, in turn, can be split into the two following subcases: An invoice whose date is the same as that some existing invoice An invoice whose date does not exist in any previously recorded invoice Several incorrect invoices, checking different types of inconsistencies

19 Systematic black-box techniques  Syntax-driven testing  Decision table based testing  Cause-effect graph based testing

20 Syntax driven testing  Applicability:  Role of formal specification:

21 Syntax driven testing (contd..) Example Consider testing an interpreter of the following language ::= + | - | ::= * | / | ::= ident | ( )

22 Syntax driven testing (contd..)  How to complete coverage principle:  Automated generation of test cases:  Minimal test set: