Академический Документы
Профессиональный Документы
Культура Документы
Lesson 16
Introduction
Definition of Testing
Software Testing Methods
Software Testing
Testing is the process of exercising a
program with the goal of finding
errors prior to delivery to the end user.
Test if the actual result is the same as expected
result
Source: Pressman
Source: Pressman
loop < 20 X
14
Source: Pressman
loop < 20 X
Source: Pressman
developer
Understands the system
but, will test "gently"
and, is driven by "delivery"
independent tester
Must learn about the system,
but, will attempt to break it
and, is driven by quality
Source: Pressman
Testability-contd
*Simplicity / Understandability
Test
Case 1
Test
Case 2
Test Procedure 2
Test Procedure Y
Test
Case n
white-box
methods
Methods
Strategies
Source: Pressman
White-Box Testing
Source: Pressman
Source: Pressman
Cyclomatic Complexity
A number of industry studies have indicated
that the higher V(G), the higher the probability
or errors.
modules
V(G)
modules in this range are
more error prone
Source: Pressman
Since V(G) = 4,
there are four paths
2
3
Path 1:
Path 2:
Path 3:
Path 4:
1,2,3,6,7,8
1,2,3,5,7,8
1,2,4,7,8
1,2,4,7,2,4,...7,8
Source: Pressman
Source: Pressman
Basis Path
Testing
Example
i = 1;
total.input = total.valid = 0;
sum = 0;
2
3
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 to increment i
1. Determine the
cyclomatic
complexity
2. List the
independent
paths
ENDIF
increment i by 1;
ENDDO
IF total.valid > 0
11
10
13
12
ENDIF
END average
Examples:
Condition Testing
Loop Testing
Condition Testing
(Type of Control Structure Testing)
Similar to statement testing, but main criterion is that ALL branches
(True & False) in each condition executed at least once.
Also verifies if each component of the condition is correct.
Simple Condition: Boolean variable or relational expression with the
following format
E1 <relational operator> E2
Compound condition.
(E1 = E2) AND (E3 <>E4)
Compound
Condition
Test Case 1
Test Case 2
Test Case 3
Test Case 4
Loop Testing
(Type of Control Structure Testing)
simple
concatenated
nested
unstructured
Loop Testing
Simple
loop
Nested
Loops
Concatenated
Loops
Unstructured
Loops
Source: Pressman
Source: Pressman
Source: Pressman
EndWhile {outer}
Source: Pressman
Source: Pressman
Black-Box Testing
requirements
output
input
events
Source: Pressman
Equivalence Partitioning-Inputs
Divides input of program into sets of data (equivalence
classes) from which test cases can be derived.
Use equivalence classes to define test case that uncovers
classes of errors, reducing total number of test cases
needed.
Equivalence Partitioning-Example
user
queries
output
input
mouse formats
prompts
picks
data
output
domain
input domain
Source: Pressman
Comparison Testing
(i.e., Back-to-back)
When reliability is absolutely critical (e.g., aircraft avionics,
automobile braking system)
Redundant hardware and software often used to minimize
possibility of error.
All versions executed in parallel with real-time comparison of
results to insure consistency.
Disadvantage: Will not uncover errors if
specification from which all versions have been
developed is in error
each independent version produces identical but incorrect
results
No Errors???
Exercise
Do the end of lesson exercises provided by your instructor