1
Software Testing Techniques Chapter 17 Software Testing Strategies Chapter 18
Click here to finish OO
Software Testing Techniques Chapter 17 Software Testing Strategies - - PowerPoint PPT Presentation
Click here to finish OO Software Testing Techniques Chapter 17 Software Testing Strategies Chapter 18 1 Software Testing Techniques Provide system guidance for designing tests that: Exercise the internal logic of a program
1
Click here to finish OO
2
– Exercise the internal logic of a program
– Exercise the input and output “Requirements” of a program
3
4
Destructive Phase
Constructive Phases
Analysis Design
Implementation
Test
Requirement Spic.
Design Document Code Test Cases
5
6
– Unit test – Integration test – High Order Test – Customer Acceptance testing
7
– To find errors
– Trys to discover undetected errors – Is successful when errors are found
– There is always a condition or usage that can lead to an incorrect behavior. – You have completed testing when continued testing, is no longer economical.
8
Developer Tester Constructive Process Destructive Process Paid to get code in production Paid to find errors Often focused on their development piece Often focused on the
system/system Personal involvement in development can bias viewpoint Viewpoint is customer
health
9
10
–Black-box - using the specifications of what the software should do
–White-Box - testing internal paths and working of the software
the program’s logic.
11
12
– Requires each statement of the program to be executed at least once.
– Requires each branch to be traversed at least once.
– Requires each condition in a branch be evaluated.
13
– Execute all control flow paths through the code. Based
complexity of a program.
– Selects test data based on the locations of definition and the use of variables.
14
15
16
a=2, b=0 & x=3
–acbed
that takes:
–abed –abd
a > 1 && b==0 x /= a;
a b c d e
Yes
a==2 || x > 1
No
x++
Yes No
17
18
19
that takes:
–abe, or –acd
a > 1 && b==0 x /= a;
a b c d e
Yes
a==2 || x > 1
No
x++
Yes No
20
– all possible combinations of condition outcomes in each decision, and – all points of entry, are invoked at least once.
– ifs, whiles, fors – reduce to simple predicates
21
a>1 a<=1 b=0 b!=0
a>1, b=0; a>1, b!=0; a<=1, b=0; a<=1, b!=0; a==2, x > 1; a!=2, x>1; a==2, x<=1; a!=2, x<=1. a=2 a!=2 x>1 x<=1
22
–all
a > 1 x /= a; h j i l Yes a==2 No x++ Yes No b==0 Yes x > 1 Yes No No k m n
23
–An independent flow path is one that introduces at least 1 new set of statements or conditions –Must move along at least 1 new edge on flow graph –Flow graph shows the logical control flow using following notation:
Sequence If while until
24
i=1; total.input = total.valid = 0; sum = 0; value[i] <> - 999 total.input < 100 total.input ++; value[i] >= min && value[i] <= max sum=sum+valu e[i]; i++; Enddo total.valid > aver = sum/ total.valid; aver=-999 no N
Yes No - Done 1. 4. 3. 2. 5. 6. 7. 8. 9. 10. 11. 12. 13. 1 2 3 4 6 5 7 8 9 10 11 12 13
25
1 2 3 4 6 5 7 8 9 10 11 12 13
R1 R3 R2 R4 R5 R6
26
27
regard to the internal structure.
– Functional, – Performance – Recovery – Security & stress
system
28
29
– A test strategy that uses every possible input condition as a test case. – Ideal – Not possible!
– Test cases are created from a pseudo random generator. – Broad spectrum. Not focused. – Hard to determine the result of the test.
30
31
– 1 test case uncovers classes of errors
– It reduces, by more than one, the number of test cases that must be developed since one test case might uncover a class of errors – It covers a large set of other possible test cases.
32
33
– 1 valid (1<= n <= 1000) – 2 invalid (n < 1 and > 1000)
– 1 valid (6 character string) – 2 invalid (5 character string, 7 char string)
34
35
– 1 valid (first character alpha). – 1 invalid (first character not alpha).
36
Area Code Blank or 3 Digit Number Prefix 3 Digit not beginning with 0 or 1 Suffix 4 Digit # Password 6 digit alphanumeric string (not required) Command Things like check, deposit, pay, …
37
Area Code Input Condition 1. Area (Boolean- there or not) Input Condition 2. Range Values between 200-999
Prefix Input Condition: Range Specified > 200 Input Condition < 999
Password
Command Set of valid commands
38
– E.g., Most program errors occur in loop control.
– Rather than any element in class, BVA selects tests at the edge of the class. – In addition to input condition, test cases can be derived for output conditions.
39
– write test cases for the ends of the range, and – invalid-input test cases for situations just beyond the ends.
– write test cases for the situation -1.01 to 1.01. – Or in general, if bounded by a and b write test cases just above and below
40
41
– For example, if output is an output report, then create an output report with maximum and minimum allowable table entries.
– If use an array that has 1-100 elements max then set up test cases for 0, 1, 100, 101 elements.
42
– Separate sections for Equivalence Class cases and Boundary-Value analysis. – Equivalence Class cases first
43
I D Condition TC 1 TC 2 TC 3
1
1< item count < 999
X 2
item count < 1
X 3
item count > 999
X 4 .5 < item count < 1 X
44
– Identifier – Input data – Expected output data
45
Id Condition Input Data Expected
46
47
Test Name/Number Test Objective Test Description Test Conditions Expected Results Actual Results
48
– A unique identifier
– Identify and briefly describe the items and features to be exercised by this case
– Specify each input required to execute the test case.
– Specify all of the outputs and features required of the test items.
49
– Hardware – Software – Other
– Describe any special constraints on the test procedures which execute this test case.
– List the id’s of test cases which must be executed prior to this test case
50