©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Chapter 20 Software Testing.
Advertisements

Defect testing Objectives
การทดสอบโปรแกรม กระบวนการในการทดสอบ
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Software Engineering, COMP201 Slide 1 Software Testing Lecture 28 & 29.
Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Final Project Account for 40 pts out of 100 pts of the final score 10 pts from.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing 2.
IMSE Week 18 White Box or Structural Testing Reading:Sommerville (4th edition) ch 22 orPressman (4th edition) ch 16.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects.
Software Engineering Software Testing.
CS 425/625 Software Engineering Software Testing
Chapter 18 Testing Conventional Applications
- Testing programs to establish the presence of system defects -
Unit Testing CS 414 – Software Engineering I Don Bagert Rose-Hulman Institute of Technology January 16, 2003.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
A Complexity Measure THOMAS J. McCABE Presented by Sarochapol Rattanasopinswat.
Cyclomatic Complexity Dan Fleck Fall 2009 Dan Fleck Fall 2009.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 23 Slide 1 Software testing Slightly adapted by Anders Børjesson.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing Hoang Huu Hanh, Hue University hanh-at-hueuni.edu.vn.
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.
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Software testing techniques 3. Software testing
UNIT TESTING. Plan project Integrate & test system Analyze requirements Design Maintain Test units Implement Software Engineering Roadmap Identify corporate.
Prof. Mohamed Batouche Software Testing.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Chapter 20 Software Testing.
CSC 480 Software Engineering Lecture 14 Oct 16, 2002.
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Agenda Introduction Overview of White-box testing Basis path testing
1 Software Defect Testing Testing programs to establish the presence of system defects.
Software Testing. 2 CMSC 345, Version 4/12 Topics The testing process  unit testing  integration and system testing  acceptance testing Test case planning.
This chapter is extracted from Sommerville’s slides. Text book chapter
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
INTRUDUCTION TO SOFTWARE TESTING TECHNIQUES BY PRADEEP I.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
BASIS PATH 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 Testing - I. Plan project Integrate & test system Analyze requirements Design Maintain Test units Implement Software Engineering.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
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.
Agent program is the one part(class)of Othello program. How many test cases do you have to test? Reversi [Othello]
Chapter 12: Software Testing Omar Meqdadi SE 273 Lecture 12 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Test case design l Involves designing the test cases (inputs and outputs) used.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
ANOOP GANGWAR 5 TH SEM SOFTWARE TESTING MASTER OF COMPUTER APPLICATION-V Sem.
Defect testing Testing programs to establish the presence of system defects.
BASIS PATH TESTING.
Software Engineering (CSI 321)
IS301 – Software Engineering V:
Data Coverage and Code Coverage
Structural testing, Path Testing
White Box Testing.
Software testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software testing.
Software Testing “If you can’t test it, you can’t design it”
Defect testing Testing programs to establish the presence of system defects.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Unit III – Chapter 3 Path Testing.
Presentation transcript:

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1 Defect testing l Testing programs to establish the presence of system defects

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 2 l Test data Inputs which have been devised to test the system l Test cases Inputs to test the system and the predicted outputs from these inputs if the system operates according to its specification Test data and test cases

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 3 Equivalence partitioning l Input data and output results often fall into different classes where all members of a class are related l Each of these classes is an equivalence partition where the program behaves in an equivalent way for each class member l Test cases should be chosen from each partition

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 4 l Partition system inputs and outputs into ‘equivalence sets’ If input is a 5-digit integer between 10,000 and 99,999, equivalence partitions are 10, 000 l Choose test cases at the boundary of these sets 00000, 09999, 10000, 99999, Equivalence partitioning

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 5 l Sometime called white-box testing l Derivation of test cases according to program structure. Knowledge of the program is used to identify additional test cases l Objective is to exercise all program statements (not all path combinations) Structural testing

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 6 White-box testing

Binary search (Java)

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 8 l Pre-conditions satisfied, key element in array l Pre-conditions satisfied, key element not in array l Pre-conditions unsatisfied, key element in array l Pre-conditions unsatisfied, key element not in array l Input array has a single value l Input array has an even number of values l Input array has an odd number of values Binary search - equiv. partitions

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 9 Binary search equiv. partitions

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 10 Binary search - test cases

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 11 Path testing l The objective of path testing is to ensure that the set of test cases is such that each path through the program is executed at least once l The starting point for path testing is a program flow graph that shows nodes representing program decisions and arcs representing the flow of control l Statements with conditions are therefore nodes in the flow graph

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 12 l Describes the program control flow. Each branch is shown as a separate path and loops are shown by arrows looping back to the loop condition node l Used as a basis for computing the cyclomatic complexity – a function of the number of distinct paths of execution within a module l Use graph theory to suggest a basis set of test Program flow graphs

SequenceIf-Then-ElseWhile-DoDo-Until Case Basic Control Constructs

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 14 l The number of tests to test all control statements equals the cyclomatic complexity l Cyclomatic complexity equals number of conditions in a program l Useful if used with care. Does not imply adequacy of testing. l Although all paths are executed, all combinations of paths are not executed Cyclomatic complexity

Binary search flow graph

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 16 l 1, 2, 3, 8, 9 l 1, 2, 3, 4, 6, 7, 2 l 1, 2, 3, 4, 5, 7, 2 l 1, 2, 3, 4, 6, 7, 2, 8, 9 l Test cases should be derived so that all of these paths are executed l A dynamic program analyser may be used to check that paths have been executed Independent paths

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 17 Graph Theory l The cyclomatic complexity, V(G) of a graph, G, with N vertices and E edges is V(G) = N – E + 2 l A predicate node is a node at which the path splits. If P is the number of predicate nodes, then V(G) = P + 1

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 18 V(G) for Binary Search V(G) – the cyclomatic complexity for Binary Search = Nr Edges – Nr Nodes + 2 = 11 – = V(G) = Nr predicate nodes + 1 = 3 + 1(nodes 2, 3 & 4) = 4

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 19 More Graph Theory Euler’s Formula: If G is a connected plane graph (no edges crossing) with N vertices, E edges and R regions, then: N – E + R = 2, or equivalently R = E – N + 2 Since V(G) = E – N + 2, and R = E – N + 2, it follows that V(G) = R I.e. The cyclomatic complexity = the number of regions in the graph

Binary search flow graph 123 4

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 21 Application to Testing l Associate a module with a graph with unique entry and exit nodes l Each node corresponds to a block of sequential code l Edges represent the program’s branches l Assumes each node can be reached from the entry node and each node can reach the exit node

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 22 Application to Testing (cont’d) l The maximum number of independent paths in G is V(G). l V(G) represents the maximum number of test; not all of these tests may be possible

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 23 General Notes l Cyclomatic Complexity has no direct relationship to the number of lines of code in a module So, trying to limit complexity by limiting the number of lines of code is meaningless l Except when case statements are used, the cyclomatic complexity of a module should not exceed 10 l Studies show 50% of the run time is spent in 4% of the code For complexity < 5, conventional testing result in full coverage