Basis Path Testing - Example

Slides:



Advertisements
Similar presentations
Software Testing Techniques
Advertisements

การทดสอบโปรแกรม กระบวนการในการทดสอบ
Optical networks: Basics of WDM
Chapter 6 Path Testing Software Testing
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.
Program Slice Program slice was a concept first discussed by Mark Weiser in the early 1980’s –He especially noticed that when people debug, they trace.
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.
1 Static Analysis Methods CSSE 376 Software Quality Assurance Rose-Hulman Institute of Technology March 20, 2007.
Chapter 17 Software Testing Techniques
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.
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
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.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
Chapter 13 & 14 Software Testing Strategies and Techniques
Cyclomatic Complexity Dan Fleck Fall 2009 Dan Fleck Fall 2009.
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.
TCS2411 Software Engineering1 Software Testing Techniques “How to find bugs in the software?”
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.
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.
JavaScript Lecture 6 Rachel A Ober
Software Testing. Purpose: to Insure that software meets its design specifications, especially at the boundary conditions. “Boundary Conditions:” conditions.
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
Software Testing. 2 CMSC 345, Version 4/12 Topics The testing process  unit testing  integration and system testing  acceptance testing Test case planning.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
White-box Testing.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 14a: Software Testing Techniques Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Software Testing and Reliability Southern Methodist University CSE 7314.
1 Program Testing (Lecture 14) Prof. R. Mall Dept. of CSE, IIT, Kharagpur.
CSC 480 Software Engineering Testing - I. Plan project Integrate & test system Analyze requirements Design Maintain Test units Implement Software Engineering.
Pipelining and Retiming
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
LAB SESSION ONE DIMENSIONAL ARRAY.
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.
James Nowotarski 2 October 2008 SE 325/425 Principles and Practices of Software Engineering Autumn 2008.
Dynamic White-Box Testing What is code coverage? What are the different types of code coverage? How to derive test cases from control flows?
Section 1.7 Comparing Algorithms: Big-O Analysis.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Software Testing Objectives and principles Techniques Process Object-oriented testing Test workbenches and frameworks.
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Chapter 17 Software Testing Techniques
Cyclomatic Complexity
Software Testing.
Software Testing.
Chapter-(Testing principles)
Software Engineering (CSI 321)
Topic:- ALGORITHM Incharge Faculty – Lokesh Sir.
Chapter 13 & 14 Software Testing Strategies and Techniques
White Box Testing.
James Nowotarski 9 October 2008
Software Testing (Lecture 11-a)
Software Testing “If you can’t test it, you can’t design it”
1. Cyclomatic complexity
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Presentation transcript:

Basis Path Testing - 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; 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]; ENDIF increment i by 1; Enddo IF value[i] >0 THEN average = sum / total.valid; ELSE average = -999; END average 1 2 3 4 6 5 7 8 9 10 11 12 13

Basis Testing – Example 1 2 10 3 12 11 4 13 5 6 7 8 9

Basis Testing – Example Compute cyclomatic complexity V(G)= 17 edges – 13 nodes + 2 = 6 Determine sets of independent paths 1 = 1-2-10-11-13 2 = 1-2-10-12-13 3 = 1-2-3-10-11-13 4 = 1-2-3-10-12-13 5 = 1-2-3-4-5-8-9-2-… 6 = 1-2-3-4-5-6-8-9-2-…. Or is it???

Correction Oops, the previous page is WRONG. Determine set of independent paths 1 = 1-2-10-11-13 2 = 1-2-3-10-12-13 3 = 1-2-3-4-5-8-9-2-… 4 = 1-2-3-4-5-6-8-9-2-… 5 = 1-2-3-4-5-6-7-8-9-2-… Why aren’t there six?

Basis Testing - Example Prepare Test Cases for each Test case path 1 Value(k) is value k < i i >= 2 i <=100 Value i = -999 same range Expected result: correct average based on k values and proper totals Test case path 2 Value(1) = -999 Expected results : average = -999; other totals are the initial values Test case path 3 Attempt to process 101 or more values First 100 should be valid Expected results as test case 1

Basis Testing Example Test case path 4 Test case path 5 Value(i) = valid input where i < 100 Value(k) < minimum where k < i Expected results: correct average based on k values and proper totals Test case path 5 Value (i) = valid input where i < 100 Value(k) > maximum where k=i Expected results: correct average based on n values and proper totals Test case path 6