Docsity

Defect Testing-Software Engineering-Lecture Slides, Slides of Software Engineering

Partial preview of the text

Download Defect Testing-Software Engineering-Lecture Slides and more Slides Software Engineering in PDF only on Docsity!

Defect Testing

 Defect testing involves testing programs to

establish the presence of system defects

Objectives

 To understand testing techniques that are geared to discover program faults

 To introduce guidelines for interface testing

 To understand specific approaches to object-oriented testing

 To understand the principles of CASE tool support for testing

The Testing Process

 Component testing

 Testing of individual program components  Usually the responsibility of the component developer (except sometimes for critical systems)  Tests are derived from the developer’s experience

 Integration testing

 Testing of groups of components integrated to create a system or sub-system  The responsibility of an independent testing team  Tests are based on a system specification

Testing Phases

Component testing

Integration testing

Software developer Independent testing team

Testing Priorities

 Only exhaustive testing can show a program is free from defects. However, exhaustive testing is impossible

 Tests should exercise a system's capabilities rather than its components

 Testing old capabilities is more important than testing new capabilities

 Testing typical situations is more important than boundary value cases

Test Data and Test Cases

Test data Inputs which have been devised to test the system

Test cases Inputs to test the system and the predicted outputs from these inputs if the system operates according to its specification

Black-box Testing

 An approach to testing where the program is considered as a ‘ black-box ’

 The program test cases are based on the system specification

 Test planning can begin early in the software process

Black-box Testing

I e

Input test data

Output test results Oe

System

Inputs causing anomalous behaviour

Outputs which reveal the presence of defects

Equivalence Partitioning

System

Outputs

Invalid inputs Valid inputs

Equivalence Partitioning

 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, 10,000-99, 999 and > 10, 000

 Choose test cases at the boundary of these sets  00000, 09999, 10000, 99999, 10001

 These are more likely to display erroneous behaviour than choosing random values

Search Routine Specification

procedure Search (Key : ELEM ; T: ELEM_ARRAY; Found : in out BOOLEAN; L: in out ELEM_INDEX) ;

Pre-condition -- the array has at least one element T’FIRST <= T’LAST Post-condition -- the element is found and is referenced by L ( Found and T (L) = Key) or -- the element is not in the array ( not Found and not ( exists i, T’FIRST >= i <= T’LAST, T (i) = Key ))

Search Routine – Input Partitions

 Inputs which conform to the pre-conditions

 Inputs where a pre-condition does not hold

 Inputs where the key element is a member of the array

 Inputs where the key element is not a member of the array

Search Routine – Input Partitions

Structural Testing

 Sometime called white-box testing

 Derivation of test cases according to program structure. Knowledge of the program is used to identify additional test cases

 Objective is to exercise all program statements (not all path combinations)