BASIS PATH TESTING ● By Tom McCabe ● McCabe, T., "A Software Complexity Measure," IEEE Trans. Software Engineering, vol. SE-2, December 1976, pp. 308-320.

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
Path Analysis Why path analysis for test case design?
Chapter 6 Path Testing Software Testing
1 Ivan Marsic Rutgers University LECTURE 15: Software Complexity Metrics.
CYCLOMATIC COMPLEXITY 1. Invented by Thomas McCabe (1974) to measure the complexity of a program ’ s conditional logic Cyclomatic complexity of graph.
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
-- Finishing Design Unit -- Intro to Glass Box Testing ECEN5543 / CSCI 5548 SW Eng of Standalone Programs University of Colorado, Boulder.
David Woo (dxw07u).  What is “White Box Testing”  Data Processing and Calculation Correctness Tests  Correctness Tests:  Path Coverage  Line Coverage.
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Creator: ACSession No: 13 Slide No: 1Reviewer: SS CSE300Advanced Software EngineeringFebruary 2006 Testing - Techniques CSE300 Advanced Software Engineering.
Lecture 9 Software Testing Techniques. OOD Case Study.
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.
Basis Path Testing - Example
Testing an individual module
Chapter 18 Testing Conventional Applications
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
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.
SOFTWARE TESTING WHITE BOX TESTING 1. GLASS BOX/WHITE BOX TESTING 2.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Cyclomatic Complexity Dan Fleck Fall 2009 Dan Fleck Fall 2009.
Software Systems Verification and Validation Laboratory Assignment 3
Software Testing Techniques
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.
9/18/2015CPSC , CPSC , Lecture 121 Software Engineering, CPSC , CPSC , Lecture 12.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
Software Testing The process of operating a system or component under specified conditions, observing and recording the results, and making an evaluation.
James Nowotarski 10 October 2006 SE 325/425 Principles and Practices of Software Engineering Autumn 2006.
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.
CSC 480 Software Engineering Testing - I. Plan project Integrate & test system Analyze requirements Design Maintain Test units Implement Software Engineering.
White Box Testing Arun Lakhotia University of Southwestern Louisiana P.O. Box Lafayette, LA 70504, USA
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.
White Box Testing by : Andika Bayu H.
Cyclomatic complexity (or conditional complexity) is a software metric (measurement). Its gives the number of indepented paths through strongly connected.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill 2009). Slides copyright 2009 by Roger Pressman.1.
Cyclomatic Complexity Philippe CHARMAN Last update:
Software Testing Techniques Presented By Dr. Shazzad Hosain.
James Nowotarski 2 October 2008 SE 325/425 Principles and Practices of Software Engineering Autumn 2008.
White-Box Testing Techniques I Prepared by Stephen M. Thebaut, Ph.D. University of Florida Software Testing and Verification Lecture 7.
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.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Software TestIng White box testing.
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)
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)
Chapter 14 Software Testing Techniques
White-Box Testing Techniques I
Software Testing “If you can’t test it, you can’t design it”
UNIT-4 BLACKBOX AND WHITEBOX TESTING
By: Lecturer Raoof Talal
Unit III – Chapter 3 Path Testing.
Presentation transcript:

BASIS PATH TESTING ● By Tom McCabe ● McCabe, T., "A Software Complexity Measure," IEEE Trans. Software Engineering, vol. SE-2, December 1976, pp ● Enables the test case designer to derive a logical complexity measure of a procedural design. ● Uses this measure as a guide for defining a basis set of execution paths. ● Test cases derived to exercise the basis set are guaranteed to execute every statement at least once.

FLOW GRAPH NOTATION IF SEQUENCE

FLOW GRAPH NOTATION cont. WHILE UNTIL

FLOW GRAPH NOTATION cont. CASE

CYCLOMATIC COMPLEXITY E - N = 4 P = 4 # Regions = 4

INDEPENDENT PATH An independent path is any path through the program that introduces at least one new set of processing statements or a new condition. In the flow graph, an independent path must move along at least one edge that has not been traversed before the path path is defined.

INDEPENDENT PATHS

BASIS SET PATH 1 PATH 2 PATH 3 PATH 4

CYCLOMATIC COMPLEXITY CONSTANT ● Provides us with an upper bound for the number of independent paths that form the basis set and, by implication, an upper bound on the number of tests that must be designed and executed to guarantee coverage of all program statements.

DERIVING TEST CASES ● Using the design or code as a foundation, draw a corresponding flow graph. ● Determine the cyclomatic complexity of the resultant flow graph. ● Determine a basis set of linearly independent paths. ● Prepare test cases that will force execution of each path in the basis set.

Compound Logic IF a OR b THEN procedure x THEN procedure y ENDIF a b x x y

EXAMPLE PROCEDURE average; This procedure computes the average of 100 or fewer numbers that lie between bounding values; it also computes the sum and the total number valid. INTERFACE RETURNS average, total.input, total.valid; INTERFACE ACCEPTS value, minimum, maximum

EXAMPLE cont. TYPE value[1:100] IS SCALAR ARRAY; TYPE average, total.input, total.valid; minimum, maximum, sum IS SCALAR; TYPE i IS INTEGER; i = 1; total.input = total.valid = 0; sum = 0; DO WHILE value[i] <> -999 AND total.input < 100 increment total.input by 1; IF value[i] >= minimum AND value[i]<= maximum THEN increment total.valid by 1; sum = sum + value[i] ELSE skip ENDIF increment i by 1; ENDDO IF total.valid > 0 THEN average = sum/total.valid; ELSE average = -999; ENDIF END average

EXAMPLE cont. TYPE value[1:100] IS SCALAR ARRAY; TYPE average, total.input, total.valid; minimum, maximum, sum IS SCALAR; TYPE i IS INTEGER; i = 1; total.input = total.valid = 0; sum = 0; DO WHILE value[i] <> -999 AND total.input < 100 increment total.input by 1; IF value[i] >= minimum AND value[i]<= maximum THEN increment total.valid by 1; sum = sum + value[i] ELSE skip ENDIF increment i by 1; ENDDO IF total.valid > 0 THEN average = sum/total.valid; ELSE average = -999; ENDIF END average

average FLOW GRAPH

INDEPENDENT PATHS ● path 1: ● path 2: ● path 3: ● path 4: ● path 5: ● path 6: ●... indicates that any path through the remainder of the control structure is acceptable. ● nodes 2, 3, 5, 6, and 10 are predicated nodes.

PATH 1 Test Case ● Path 1 test case ● value(k) = valid input, where k < i for 2 <= i <= 100, ● value(i) = -999 where 2 <= i <= 100. ● Expected results correct average based on k values and proper totals. ● Note: path 1 cannot be tested stand-alone but must be tested as part of path 4, 5, and 6 tests.

PATH 2 Test Case ● value(1) = -999 ● Expected results: Average = -999; other totals at initial values.

PATH 3 Test Case ● Attempt to process 101 or more values. ● First 100 values should be valid. ● Expected results: Same as test case 1.

PATH 4 Test Case ● value(i) = valid input where i < 100 ● value(k) < minimum where k < i ● Expected results: Correct average based on k values and proper totals.

PATH 5 Test Case ● value(i) = valid input where i < 100 ● value(k) > maximum where k <= i ● Expected results: Correct average based on n values and proper totals.

PATH 6 Test Case ● value(i) = valid input where i < 100 ● Expected results: Correct average based on n values and proper totals.