Path Testing Basics By Chandra Kumar R Date : 20-Nov-2004.

Slides:



Advertisements
Similar presentations
Software Testing Techniques
Advertisements

Chapter 14 Software Testing Techniques - Testing fundamentals - White-box testing - Black-box testing - Object-oriented testing methods (Source: Pressman,
Software Testing Technique. Introduction Software Testing is the process of executing a program or system with the intent of finding errors. It involves.
Chapter 14 Testing Tactics
Chapter 6 Path Testing 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.
Creator: ACSession No: 13 Slide No: 1Reviewer: SS CSE300Advanced Software EngineeringFebruary 2006 Testing - Techniques CSE300 Advanced Software Engineering.
Chapter 17 Software Testing Techniques
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.
Ch6: Software Verification. 1 Statement coverage criterion  Informally:  Formally:  Difficult to minimize the number of test cases and still ensure.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
BASIS PATH TESTING ● By Tom McCabe ● McCabe, T., "A Software Complexity Measure," IEEE Trans. Software Engineering, vol. SE-2, December 1976, pp
Testing an individual module
Chapter 18 Testing Conventional Applications
Unit Testing CS 414 – Software Engineering I Don Bagert Rose-Hulman Institute of Technology January 16, 2003.
Software Engineering Lecture 12 Software Testing Techniques 1.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Chapter 13 & 14 Software Testing Strategies and Techniques
Software Systems Verification and Validation Laboratory Assignment 3
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
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.
Prof. Mohamed Batouche Software Testing.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
CSC 480 Software Engineering Lecture 14 Oct 16, 2002.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
Agenda Introduction Overview of White-box testing Basis path testing
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
White-box Testing.
Software Testing and Reliability Southern Methodist University CSE 7314.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
BASIS PATH TESTING.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
White Box Testing Arun Lakhotia University of Southwestern Louisiana P.O. Box Lafayette, LA 70504, USA
Software Construction Lecture 19 Software Testing-2.
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.
White Box Testing by : Andika Bayu H.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.1.
Software Testing Techniques Presented By Dr. Shazzad Hosain.
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.
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.
Testing Integral part of the software development process.
Chapter 17 Software Testing Techniques
Lab 7 Control-Flow Testing
PREPARED BY G.VIJAYA KUMAR ASST.PROFESSOR
BASIS PATH TESTING.
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.
Software Engineering (CSI 321)
Chapter 13 & 14 Software Testing Strategies and Techniques
Data Coverage and Code Coverage
CONTROL FLOW TESTING.
Structural testing, Path Testing
Types of Testing Visit to more Learning Resources.
White Box Testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software Testing (Lecture 11-a)
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 I
Software Testing “If you can’t test it, you can’t design it”
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Unit III – Chapter 3 Path Testing.
Presentation transcript:

Path Testing Basics By Chandra Kumar R Date : 20-Nov-2004

Objective To understand the basic concepts of Path Testing Techniques. To understand the basic concepts of Path Testing Techniques. To know the use of flow graphs in path testing. To know the use of flow graphs in path testing. To get idea for doing the effective testing using the path testing techniques. To get idea for doing the effective testing using the path testing techniques.

Sequence of Presentation Basic Path testing Concepts. Basic Path testing Concepts. Program flow graph. Program flow graph. Cyclomatic complexity. Cyclomatic complexity. Flow graph Vs Flow chart. Flow graph Vs Flow chart. Procedure for path testing. Procedure for path testing. Complete testing. Complete testing. Path testing Criteria. Path testing Criteria. Path selection. Path selection.

Presentation Duration Estimated Time : ~ 45 Minutes Estimated Time : ~ 45 Minutes Presentation : ~ 30 Minutes Presentation : ~ 30 Minutes Queries : ~ 15 Minutes Queries : ~ 15 Minutes

Test based on selecting sets of test paths through the program.Test based on selecting sets of test paths through the program. Requires complete knowledge of program's structure.Requires complete knowledge of program's structure. Applicable to new software for Unit testing.Applicable to new software for Unit testing. Aim is to make sure all the paths are executed.Aim is to make sure all the paths are executed. Basic Path testing Concepts

Describes the program control flow.Describes the program control flow. Any procedural design can be translated into a flow graph.Any procedural design can be translated into a flow graph. Used as a basis for test data selection.Used as a basis for test data selection. Used to derive a logical complexity measure of a procedural design.Used to derive a logical complexity measure of a procedural design. Program flow graph

Flow graph Elements Process/nodeDecision whileuntilsequenceifcase Junction

1.while( counter >= 0 ) { counter-- ; counter-- ; 2. if(EmpNo < 150 ) 3. { 4. if( Exp < 2 ) { printf( “……” ) ; printf( “……” ) ; } 5. else { printf( “……” ) ; printf( “……” ) ; } 7a. } 6. else { printf( “ Invalid Number “ ) ; printf( “ Invalid Number “ ) ; 7b. } 8. } Flow graph Example 1 2 7b7b a7a

Number of tests to test all control statements equals the cyclomatic complexityNumber of tests to test all control statements equals the cyclomatic complexity Gives the number of independent paths in the basis set.Gives the number of independent paths in the basis set. Provides upper bound for the number of tests required.Provides upper bound for the number of tests required. Guarantees for the coverage of all program statements.Guarantees for the coverage of all program statements. Cyclomatic complexity

Flow graph Vs Flow chart Flow graph Flow chart  Flow graph compacts the representation.  Flow graph clarifies the control flow and data flow issues.  Flow chart resembles a control flow graph but too much informative.  Flow Chart forces an expansion of visual complexity.

Derive a flow graph from the design or source code.Derive a flow graph from the design or source code. Determine the Cyclomatic complexity of this flow graph.Determine the Cyclomatic complexity of this flow graph. Determine a basis set of linearly independent paths.Determine a basis set of linearly independent paths. Prepare test cases that will force execution of each path in the basis set.Prepare test cases that will force execution of each path in the basis set. Procedure for path testing

Complete Testing Every path from entry to exit. Every path from entry to exit. Every statement or instruction at least once. Every statement or instruction at least once. Every branch/case statement, in each direction. Every branch/case statement, in each direction.

Continued… if ( x < 0 ) if ( x < 0 ) { goto aa ; goto aa ; } else else { x = x + 1; x = x + 1; } aa : x = x + 1; X < 0 x = x + 1 a Yes No Correct Version

Continued… if ( x < 0 ) if ( x < 0 ) { goto aa ; goto aa ; } aa : x = x + 1; Incorrect Version X < 0 a x = x + 1 Yes No Executing every statement, but not every branch would not reveal the defect in the above incorrect version.

Continued….. X < 0 x = x + 1 b Yes No a if ( x < 0 ) if ( x < 0 ) { goto bb ; goto bb ; } else else { x = x + 1; x = x + 1; goto bb ; goto bb ; } aa : x = x + 1; goto aa ; goto aa ; bb : x = x + 1; Hidden Loop Uncovered in branch coverage.

Path-Testing Criteria Path Testing. Path Testing % path coverage ( c1 + c2 ) Statement Testing. Statement Testing % statement coverage ( c1 ) Branch Testing. Branch Testing % branch coverage ( c2 )

Path Selection Enough paths should be selected to achieve ( c1 + c2 ). Enough paths should be selected to achieve ( c1 + c2 ). First take the most obvious path to the exit. First take the most obvious path to the exit. Select successive paths as small variations of previous paths. Select successive paths as small variations of previous paths. Take many simple paths than a few complicated paths. Take many simple paths than a few complicated paths.

Example NoYes Yes No abc ge h f i d EndStart PathsDecisionsProcess-Link abcdabfhedabfigbcd Yes Yes No Yes No Yes No, Yes No No, Yes No abcdefghi74

Continued… Check whether every decision has a Yes and No in its column. Check whether every decision has a Yes and No in its column. Check whether every case of all case statements has been marked. Check whether every case of all case statements has been marked. Check whether every three way branch is covered. Check whether every three way branch is covered. Check whether every link covered at least once. Check whether every link covered at least once.

Conclusion Path testing is used in the unit test phase. Path testing is used in the unit test phase. It gives some measure of test thoroughness which leads to defect free code. It gives some measure of test thoroughness which leads to defect free code.

References Software Testing Techniques by Boris Beizer, Second Edition, 3 rd Reprint : 2004, Page No : 59 to 80. Software Testing Techniques by Boris Beizer, Second Edition, 3 rd Reprint : 2004, Page No : 59 to ulm.de/sai/melzer/thesis/node1.html. ulm.de/sai/melzer/thesis/node1.html htm htm.