White-Box Testing Statement coverage Branch coverage Path coverage

Slides:



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

Marking Schema question1: 40 marks question2: 40 marks question3: 20 marks total: 100 marks.
Chapter 6 Path Testing Software Testing
Whitebox Testing Fra: CS Fall Whitebox Testing AKA Structural, Basis Path Test Normally used at unit level Assumes errors at unit level are.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
SIM5102 SOFTWARE EVALUATION
CS 536 Spring Global Optimizations Lecture 23.
White Box Testing Techniques Dynamic Testing. White box testing(1) Source code is known and used for test design While executing the test cases, the internal.
4/25/08Prof. Hilfinger CS164 Lecture 371 Global Optimization Lecture 37 (From notes by R. Bodik & G. Necula)
Software Testing and Quality Assurance
Prof. Fateman CS 164 Lecture 221 Global Optimization Lecture 22.
BASIS PATH TESTING ● By Tom McCabe ● McCabe, T., "A Software Complexity Measure," IEEE Trans. Software Engineering, vol. SE-2, December 1976, pp
Prof. Bodik CS 164 Lecture 16, Fall Global Optimization Lecture 16.
SOFTWARE TESTING WHITE BOX TESTING 1. GLASS BOX/WHITE BOX TESTING 2.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Software Systems Verification and Validation Laboratory Assignment 3
System/Software Testing
Software Testing.
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.
White-Box Testing Eshcar Hillel Michael Beder. White Box Testing 2 Tutorial Outline What is White Box Testing? Flow Graph and Coverage Types Symbolic.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Overview of Software Testing 07/12/2013 WISTPC 2013 Peter Clarke.
Course Outline Traditional Static Program Analysis –Theory –Classic analysis and applications Points-to analysis, CHA, RTA –The Soot analysis framework.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
CPS120: Introduction to Computer Science Decision Making in Programs.
Agenda Introduction Overview of White-box testing Basis path testing
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.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
White-box Testing.
CS 217 Software Verification and Validation Week 7, Summer 2014 Instructor: Dong Si
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
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.
CPS120: Introduction to Computer Science Decision Making in Programs.
Condition Testing. Condition testing is a test case design method that exercises the logical conditions contained in a program module. A simple condition.
CPS120: Introduction to Computer Science Decision Making in Programs.
Cyclomatic Complexity Philippe CHARMAN Last update:
White-Box Testing Techniques I Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 7.
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.
White-Box Testing Techniques. Definition of White-Box Testing Testing based on analysis of internal logic (design, code, etc.). (But expected results.
CS223: Software Engineering Lecture 26: Software Testing.
Software TestIng White box testing.
TQS - Teste e Qualidade de Software (Software Testing and Quality) Test Case Design: White Box Testing João Pascoal Faria.
TQS - Teste e Qualidade de Software (Software Testing and Quality) Test Case Design: White Box Testing João Pascoal Faria.
Software Testing.
White-Box Testing Pfleeger, S. Software Engineering Theory and Practice 2nd Edition. Prentice Hall, Ghezzi, C. et al., Fundamentals of Software Engineering.
Software Testing.
Control Flow Testing Handouts
Handouts Software Testing and Quality Assurance Theory and Practice Chapter 4 Control Flow Testing
Software Engineering (CSI 321)
Condition Testing.
Software Testing and Maintenance 1
Outline of the Chapter Basic Idea Outline of Control Flow Testing
CONTROL FLOW TESTING.
Structural testing, Path Testing
White-Box Testing Techniques
Types of Testing Visit to more Learning Resources.
White Box Testing.
White-Box Testing.
CHAPTER 4 Test Design Techniques
Software Testing (Lecture 11-a)
Sudipto Ghosh CS 406 Fall 99 November 16, 1999
White-Box Testing Techniques I
Whitebox Testing.
White-Box Testing.
Whitebox Testing.
Software Testing.
Unit III – Chapter 3 Path Testing.
Presentation transcript:

White-Box Testing Statement coverage Branch coverage Path coverage Condition coverage Mutation testing Data flow-based testing

Statement Coverage Statement coverage methodology: The principal idea: design test cases so that every statement in a program is executed at least once. The principal idea: unless a statement is executed, we have no way of knowing if an error exists in that statement

Statement coverage criterion Observing that a statement behaves properly for one input value: no guarantee that it will behave correctly for all input values.

Example Euclid's GCD Algorithm int f1(int x, int y){ while (x != y){ if (x>y) then x=x-y; else y=y-x; } return x; }

Euclid's GCD computation algorithm By choosing the test set {(x=3,y=3),(x=4,y=3), (x=3,y=4)} all statements are executed at least once.

Branch Coverage Test cases are designed such that: different branch conditions is given true and false values in turn. Branch testing guarantees statement coverage: a stronger testing compared to the statement coverage-based testing.

Example Test cases for branch coverage can be: {(x=3,y=3), (x=4,y=3), (x=3,y=4)}

Condition Coverage Test cases are designed such that: Example each component of a composite conditional expression given both true and false values. Example Consider the conditional expression ((c1.and.c2).or.c3): Each of c1, c2, and c3 are exercised at least once i.e. given true and false values.

Branch testing Branch testing is the simplest condition testing strategy compound conditions appearing in different branch statements are given true and false values.

Branch testing Condition testing Branch testing stronger testing than branch testing: Branch testing stronger than statement coverage testing.

Condition coverage Consider a Boolean expression having n components: for condition coverage we require 2n test cases. practical only if n (the number of component conditions) is small.

Path Coverage Design test cases such that: Defined in terms of all linearly independent paths in the program are executed at least once. Defined in terms of control flow graph (CFG) of a program.

Control flow graph (CFG) A control flow graph (CFG) describes: the sequence in which different instructions of a program get executed. the way control flows through the program.

How to draw Control flow graph? Number all the statements of a program. Numbered statements: represent nodes of the control flow graph. An edge from one node to another node exists: if execution of the statement representing the first node can result in transfer of control to the other node.

Example int f1(int x,int y){ while (x != y){ if (x>y) then x=x-y; else y=y-x; } return x; }

Example Control Flow Graph 1 2 3 4 5 6

Path A path through a program: A node and edge sequence from the starting node to a terminal node of the control flow graph. There may be several terminal nodes for program.

Independent path Any path through the program: introducing at least one new node that is not included in any other independent paths. It may be straight forward to identify linearly independent paths of simple programs. However For complicated programs it is not so easy to determine the number of independent paths.