Verification
Are we building the right product? Ensure software meet specification (errorfree)
2
Testing Terminology
Failure
Incorrect or unexpected output Symptom of at fault
Fault
Invalid execution state Symptom of an error May or may not produce failure
Error
Defect or anomaly in source code Commonly referred as bug May or may not produce fault
3
Testing Objective
To design tests that systematically uncover different classes of errors and to do so with a minimum amount of time
and effort
Importance of Testing
Critical Element of Software Quality Assurance Well-planned and thorough testing are important in reducing the high cost of software failure Can take up to 40% of development effort In systems that require high reliability, testing can be 3 to 5 times of all the other 6 steps combined
Testing Principles
All test should be traceable to customer requirements. Tests should be planned before testing begins. Testing should begin with individual components and move towards to integrated cluster of components. The most effective testing should be conducted by an independent third party.
7
Successful Testing
Uncover errors in the software Demonstrates that the software functions appear to be working according to specification Data collected as testing is conducted provide a good indication of software reliability and software quality
10
Testing Guidelines
Testing a systems capabilities is more important than testing its components Testing old capabilities is more important than testing new capabilities Testing typical situations is more important than testing boundary value cases
11
Test Cases
Test case : unit of testing activity Test cases have 3 parts :Goal
Aspect of the system being tested
Expected behavior
The output or action the system should take according to its requirements
12
time
14
Node
4,5
R1
4 8 5
R3
Region 9
10
R4
11
15
Cyclomatic Complexity
Provide quantitative measure for program logical complexity. Defined number of independent path
Any path that introduce one ser of processing statements or new condition
2. V(G) = E N + 2
3. V(G) = P + 1
P : Number of predicate nodes
V(G) = 3 predicate nodes + 1 = 4
17
1 2 3 10 12 13 8 9 18 11 4 5
6
7
3.
4.
Constraints
Does not find missing or additional functionality Does not really check the interface Difficult for large and complex module
20
21
22
Data flow testing selects test paths of a program according to the locations of definitions and uses of variables in the program
23
24
Loop Testing
26
Attempts to find the following errors: Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors Initialisation and termination errors
29
30
Equivalence Partitioning
Divide input domain into classes of data Based on an evaluation of equivalence classes for an input condition Guidelines to define equivalence classes
Range input : One valid and two invalid equivalence Specific value : One valid and two invalid equivalence A member of a set : One valid and one invalid equivalence Boolean : One valid and one invalid equivalence
31
Constraints
No systematic search for low level errors Specification errors not found
34
References
Software Engineering: A Practitioners Approach 5th Ed. by Roger S. Pressman, Mc-Graw-Hill, 2001 Software Engineering by Ian Sommerville, Addison-Wesley, 2001
35