Index of /~billard/se/cs4320/ex10
Name Last modified Size Description
Parent Directory 20-Apr-2008 08:49 -
10x10.txt 19-May-2009 09:03 1k
airlines.txt 19-May-2009 09:03 1k
liability 19-May-2009 09:03 7k
liability.bat 19-May-2009 09:03 1k
print.bat 19-May-2009 09:03 1k
setpaths 19-May-2009 09:03 1k
CS 4320 Software Testing and QA: Ex10 ALL PAIRS TEST
====================================================
Platform: Paper
Given: parameter specification to an executable program
Goal: automated test using all pairs instead of all combinations
a. Introduction
The following URL's discuss All Pairs Test:
http://www.developsense.com/testing/PairwiseTesting.html
http://fit.c2.com/wiki.cgi?AllPairsExample
http://www.argreenhouse.com/papers/gcp/AETGissre96.shtml
http://tejasconsulting.com/open-testware/feature/allpairs.html
b. Example
Consider this airline example:
% more airlines.txt
Destination Class Seat
Canada Coach Aisle
Mexico Business Window
USA First
3 x 3 x 2 = 18 combinations
Test Destination Class Seat
1 Canada Coach Aisle
2 Mexico Coach Aisle
3 USA Coach Aisle
4 Canada Business Aisle
5 Mexico Business Aisle
6 USA Business Aisle
7 Canada First Aisle
8 Mexico First Aisle
9 USA First Aisle
10 Canada Coach Window
11 Mexico Coach Window
12 USA Coach Window
13 Canada Business Window
14 Mexico Business Window
15 USA Business Window
16 Canada First Window
17 Mexico First Window
18 USA First Window
However, some evidence suggests that most errors arise from a single
input or a pair of inputs, not all possible combinations.
% source setpaths
% allpairs.pl airlines.txt
9 All Pairs tests
Test Destination Class Seat Preference
1 Canada Coach Aisle
3 USA Coach Aisle
5 Mexico Business Aisle
8 Mexico First Aisle
9 USA First Aisle
11 Mexico Coach Window
13 Canada Business Window
15 USA Business Window
16 Canada First Window
c. Another Example
Consider an application with:
10 columns x 10 values/column => 10^10 = 10 billion combinations
[IN THIS SESSION HAVE YOU DONE: source setpaths]
% allpairs.pl 10x10.txt
How many ALL PAIRS test cases?
So the idea is that ALL PAIRS can greatly reduce the number of test cases,
and that this will still have a good likelihood of catching errors.
d. Exercise
Consider a "liability" executable program which calculates the car insurance
premium based on three parameters in the function prototype:
int liability(char age_code, char gender, char married);
which can take on the following values (table of data specification):
Age_code Gender Married
A [0..24] M Y
B [25..44] F N
C [45..64]
D [>64]
with the following 16 ALL COMBINATIONS and expected Premiums:
Age_code Gender Married Premium
A M Y 300
A M N 2000
A F Y 300
A F N 300
B M Y 300
B M N 500
B F Y 300
B F N 300
C M Y 200
C M N 400
C F Y 200
C F N 200
D M Y 300
D M N 500
D F Y 300
D F N 300
On-paper, write down the ALL PAIRS test cases.
Verify your results by making liability.txt with a table of data specification:
[IN THIS SESSION HAVE YOU DONE: source setpaths]
% allpairs.pl liability.txt >cases.out
Note that all columns need to be TAB-separated and even empty fields require TABS.
But do NOT put BLANKS in the empty fields, just make it a TAB.
Does cases.out match your paper results? It doesn't have to be the exact same
cases, but does the total number agree?
Run an automated test script:
% liability.bat
Note that it only has one test case (A, M, Y).
Expand liability.bat to include your ALL PAIRS tests cases:
% liability.bat >liability.out
Are there any errors in the output? If so, type them into liability.out
ONLINE students: just submit liability.out
e. project notebook (see print.bat):
README
liability.txt
cases.out
liability.bat
liability.out