The document discusses techniques for reducing the number of test cases needed when the number of input variables and their possible values results in too many combinations to test exhaustively. It describes 1-wise and 2-wise testing. 1-wise testing covers each unique value individually, reducing the test cases for three variables with 4, 3, and 2 values from 24 to 9 by reusing test cases. 2-wise testing covers all pairs of variable values, further reducing the number of test cases needed but providing better coverage than 1-wise alone. The optimal approach depends on the specific variables and goals of the testing.
Contains
a.Statistics-1
b. SAS-1
c. Statistics-2
d. Market Research
e. MS Excel
f. SAS-2
g. Data Audit & Data Sanitization
h. SQL
i. Model Building
j. HR
Please Subscribe to this Channel for more solutions and lectures
http://www.youtube.com/onlineteaching
Elementary Statistics Practice Test 1
Module 1: Chapters 1-3
Chapter 1: Introduction to Statistics.
Chapter 2: Exploring Data with Tables and Graphs.
Chapter 3: Describing, Exploring, and Comparing Data.
Dear students get fully solved assignments
Send your semester & Specialization name to our mail id :
help.mbaassignments@gmail.com
or
call us at : 08263069601
Contains
a.Statistics-1
b. SAS-1
c. Statistics-2
d. Market Research
e. MS Excel
f. SAS-2
g. Data Audit & Data Sanitization
h. SQL
i. Model Building
j. HR
Please Subscribe to this Channel for more solutions and lectures
http://www.youtube.com/onlineteaching
Elementary Statistics Practice Test 1
Module 1: Chapters 1-3
Chapter 1: Introduction to Statistics.
Chapter 2: Exploring Data with Tables and Graphs.
Chapter 3: Describing, Exploring, and Comparing Data.
Dear students get fully solved assignments
Send your semester & Specialization name to our mail id :
help.mbaassignments@gmail.com
or
call us at : 08263069601
Black box testing is a technique of software testing which examines the functionality of software without peering into its internal structure or coding.
Module code 124ms Tajvinder Virdee Sets and Log.docxmoirarandell
Module code: 124ms
Tajvinder Virdee
Sets and Logic Coursework 1
1. Find the truth value of P (Q R) if P is false, Q is true, and R is false. What is the truth
value of this expression if the brackets are removed?
Substituting in the truth values, we obtain
f (t f)
As there is a set of brackets, the brackets have to be done first as they have a higher order of
precedence. So (Q R), becomes (t f) which we can say is false, as if Q is true and R is
false the truth value of this implication is false. This then becomes
f f
which is equivalent to
f
If the brackets are removed, then the order of the procedure changes.
The expression now becomes
P Q R, where P is false, Q is true, and R is false.
Inserting the truth values of P, Q and R, we get
f t f
Since has higher priority than , we have to work out the f t first. This gives us the
value false as not both parts are true.
f f
This gives t
As false implies false, the truth value is true, meaning that the expression has truth value
true.
Both answers are different as once the brackets were removed the order of the procedure
changes, resulting in the steps taking to complete the expression to be different.
2. Consider the proposition
((C ( C S)) (S P)) S P.
(a) Interpreting these symbols as the atomic sentences
C : I am a careful programmer.
S : My program will meet its specification.
P : My program will pass the validation test.
Interpret the above proposition as an argument in natural English.
I started by drawing up a table, in which I explained the possible connectives and translated
them into natural English.
I then started to convert the proposition in English.
This is as can only be true if both parts are true,
so as both parts are false, the expression has the
truth value f (false).
Connectives (symbols) Natural English
“AND”
“OR”
“IMPLIES”, so if this ... then....
“IF AND ONLY IF”
“NOT”, so the negative of a sentence.
Module code: 124ms
Tajvinder Virdee
I am a careful programmer and if I am not a careful programmer, then my program will not
meet its specification, and if my program will meet its specification then my program will
pass the validation test. This implies that my program will meet its specification and then my
program will pass the validation test.
(b) By means of a truth table, find out whether the argument is valid.
I started by calculating how many rows my truth table would need. As there are only two
truth values, true and false, I would have to have the value 2 to the power n, where n would
be the amount of sentence letters, in the proposition.
In this case as there are 3 types of sentence letters, C, S and P, n would be 3.
So ...
In today’s competitive software development scenario, the customer demands a testing coverage which not only ensures the stated requirements but also the implied ones. This situation calls for an exhaustive testing which may not be always possible due to various reasons. Testing, due to its last position in SDLC, often gets crunched due to the cumulative schedule slippages. Hence Tester is faced with a challenge to make testing as efficient as possible within a short time span due to cost constraints. With selective testing an only option, test leads usually go for the age-old approach of Random Testing. Random testing does not ensure coverage in a scientific manner.
OverviewThis hands-on lab allows you to follow and experiment w.docxgerardkortney
Overview:
This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, Analysis, , Design(program design, pseudocode), Test Plan, and implementation with C code. The example provided uses sequential, repetition statements and nested repetition statements.
Program Description:
This program will calculate the average of 10 positive integers. The program will ask the user to 10 integers. If any of the values entered is negative, a message will be displayed asking the user to enter a value greater than 0. The program will use a loop to input the data.
Analysis:
I will use sequential, selection and repetition programming statements.
The program will loop for 10 positive numbers, prompting the user to enter a number.
I will define three integer variables: count, value and sum. count will store how many times values greater than 0 are entered. value will store the input. Sum will store the sum of all 10 integers.
I will define one double number: avg. avg will store the average of the ten positive integers input.
The sum will be calculated by this formula: sum = sum + value For example, if the first value entered was 4 and second was 10: sum = sum + value = 0 + 4
sum = 4 + 10 = 14
Values and sum can be input and calculated within a repetition loop: while count <10
Input value
sum = sum + value End while
Avg can be calculated by: avg = value/count
A selection statement can be used inside the loop to make sure the input value is positive.
If value >= 0 then count = count + 1 sum = sum + value
Else
input value End If
(
7
)
Program Design:
Main
// This program will calculate the average of 10 integer numbers
// Declare variables
// Initialize variables
// Loop through 10 numbers
// Prompt for positive integer
// Get input
// test input value for gt 0 if (value > 0)
//Increment counter
//Accumulate sum Else
// display msg to enter a positive integer
// Prompt for positive integer
// Get input Endif
// End loop
//Calculate average
//Print the results (average)
End
Test Plan:
To verify this program is working properly the input values could be used for testing:
Test Case
Input
Expected Output
1
1 1 1 0 1
2 0 1 3 2
Average = 1.2
2
100 100 100 100 -100
Input a positive value
100 200 -200 200 200
Input a positive value
200 200
average is 120.0
NOTE: test #2 has 12 input numbers because there are two negative numbers.
Pseudocode: Main
// This program will calculate the average of 10 positive integers.
// Declare variables
Declare count, value, sum as Integer Declare avg as double
//Initialize values
Set count=0 Set sum = 0 Set avg = 0.0;
// Loop through 10 integers While count < 10
Input value
If (value >=0)
sum = sum + value count=count+1
Else
Pr *** Value must be positive *** Input value
End if End While
// Calculate average avg = sum/count
// Print results
End //End of Main
C Code
The following is the C Code that will compile in execute in the online.
BUS 308 Week 3 Lecture 3 Setting up ANOVA and Chi Square .docxjasoninnes20
BUS 308 Week 3 Lecture 3
Setting up ANOVA and Chi Square
Expected Outcomes
After reading this lecture, the student should know how to:
1. Set-up the data for an ANOVA analysis.
2. Set-up and perform an ANOVA test.
3. Set-up a table of mean differences.
4. Set-up and perform a Chi Square test.
Overview
Setting up the ANOVA test is quite similar to how the t and F tests were set up. The Chi
Square set-up is a bit more complex, as it is not found in the Data Analysis list of tools.
ANOVA
The set-up of ANOVA within Excel is very similar to how we set up the F and T tests
last week; place the data set in appropriate groups and then use the ANOVA input box. One
difference this week is that the Fx (or Formulas) list does not include an option for ANOVA, so
we need to use the Data | Analysis tools.
Data Set-up
Single Factor. As with the t-test, ANOVA has a couple of versions to select between.
Each is used to answer slightly different questions, and these will be examined below. The most
significant difference lies in the data table used for each version.
We will be working primarily with the ANOAV Single Factor, which deals with
examining possible differences between the means of a single variable within different groups.
A question of whether or not the mean compa-ratios are equal across the grades is an example of
the kind of question answered with this approach.
Question 1. Week 3’s first question is about salary mean equality across the grades. Our
lecture example will deal with compa-ratio mean equality across the grades. The set-up for the
Single Factor ANOVA we just went through assumed this. The initial steps in the hypothesis
testing process are similar to what we have done before:
Step 1: Ho: All Compa-Ratio means are equal across the grades
Ha: At least one compa-ratio mean differs
Notice that these are the standard ANOVA – Single factor null and alternate hypothesis
statements that identify the specific variable (compa-ratio) and statistic (mean) that we
are testing, and merely say “no difference” and “at least one differs.”
Step 2: Alpha = 0.05
Step 3: F statistic and Single Factor ANOVA; used to test multiple means
Step 4: Decision Rule: Reject Ho if the p-value < 0.05
Step 5: Conduct the test – place the test function in cell K08.
As with the F and T tests, we need to group the data into distinct groups. For example, if
we are going to test the compa-ratio mean across grades, then the data must be set-up in a
table with grades across the top, as in the screen shot below. Note that as was done with
the T and F test input data, the raw or initial data was listed and then sorted. Values were
then copied into related groups; we used male and female groups for the F and t tests and
grade groups for this test.
Test Set-up. Go to the Data | Analysis and select ANOVA Single Factor gives us the
following input screen. This is completed for our compa-ratio ...
BUS 308 Week 3 Lecture 3 Setting up ANOVA and Chi Square .docxcurwenmichaela
BUS 308 Week 3 Lecture 3
Setting up ANOVA and Chi Square
Expected Outcomes
After reading this lecture, the student should know how to:
1. Set-up the data for an ANOVA analysis.
2. Set-up and perform an ANOVA test.
3. Set-up a table of mean differences.
4. Set-up and perform a Chi Square test.
Overview
Setting up the ANOVA test is quite similar to how the t and F tests were set up. The Chi
Square set-up is a bit more complex, as it is not found in the Data Analysis list of tools.
ANOVA
The set-up of ANOVA within Excel is very similar to how we set up the F and T tests
last week; place the data set in appropriate groups and then use the ANOVA input box. One
difference this week is that the Fx (or Formulas) list does not include an option for ANOVA, so
we need to use the Data | Analysis tools.
Data Set-up
Single Factor. As with the t-test, ANOVA has a couple of versions to select between.
Each is used to answer slightly different questions, and these will be examined below. The most
significant difference lies in the data table used for each version.
We will be working primarily with the ANOAV Single Factor, which deals with
examining possible differences between the means of a single variable within different groups.
A question of whether or not the mean compa-ratios are equal across the grades is an example of
the kind of question answered with this approach.
Question 1. Week 3’s first question is about salary mean equality across the grades. Our
lecture example will deal with compa-ratio mean equality across the grades. The set-up for the
Single Factor ANOVA we just went through assumed this. The initial steps in the hypothesis
testing process are similar to what we have done before:
Step 1: Ho: All Compa-Ratio means are equal across the grades
Ha: At least one compa-ratio mean differs
Notice that these are the standard ANOVA – Single factor null and alternate hypothesis
statements that identify the specific variable (compa-ratio) and statistic (mean) that we
are testing, and merely say “no difference” and “at least one differs.”
Step 2: Alpha = 0.05
Step 3: F statistic and Single Factor ANOVA; used to test multiple means
Step 4: Decision Rule: Reject Ho if the p-value < 0.05
Step 5: Conduct the test – place the test function in cell K08.
As with the F and T tests, we need to group the data into distinct groups. For example, if
we are going to test the compa-ratio mean across grades, then the data must be set-up in a
table with grades across the top, as in the screen shot below. Note that as was done with
the T and F test input data, the raw or initial data was listed and then sorted. Values were
then copied into related groups; we used male and female groups for the F and t tests and
grade groups for this test.
Test Set-up. Go to the Data | Analysis and select ANOVA Single Factor gives us the
following input screen. This is completed for our compa-ratio.
Similar to D-Pubb-TestingExperience_Issue_28_2014-12_Berta (20)
2. 24 Testing Experience – 28/2014
When a software application accepts several inputs, each of which
can assume different values, it is impossible – in general – to test all
combinations of values of input variables, simply because they are too
many.Let’stakeanexample –considerasoftwarefeaturethataccepts
as inputs three possible values A, B, and C. These values can be chosen
arbitrarily from the following table:
A B C
A1 B1 C1
A2 B2 C2
A3 B3
A4
# Values
4 3 2
Table 1. Variables and Values
The total number of possible combinations of variables (A, B, C) is
equal to 4 • 3 • 2 = 24; in practice, in order to ensure trying all possible
combinations of the values of the variables (A, B, C) at least once, 24
test cases must be carried out. Such combinations are the following:
1–4 5–8 9–12 13–16 17–20 21–24
A1;B1;C1 A1;B3;C1 A2;B2;C1 A3;B1;C1 A3;B3;C1 A4;B2;C1
A1;B1;C2 A1;B3;C2 A2;B2;C2 A3;B1;C2 A3;B3;C2 A4;B2;C2
A1;B2;C1 A2;B1;C1 A2;B3;C1 A3;B2;C1 A4;B1;C1 A4;B3;C1
A1;B2;C2 A2;B1;C2 A2;B3;C2 A3;B2;C2 A4;B1;C2 A4;B3;C2
Table 2. Combinations of Variables for A, B, and C Values
Now, in this particular case, such a number of tests can still be afford-
able. However, if we consider the general case of N variables X1, X2, …,
Xk,thefirstacceptingn1 possiblevalues,thesecondn2 possiblevalues,
thek-ththatassumesnk possiblevalues,thetotalnumberofcombina-
tions is equal to: n1 • n2 • … • nk. Such a value, even for low values of n1,
n2, …, nk is a high number. For example, if k = 5 and (n1 = 3; n2 = 4; n3 = 2;
n4 = 2;n5 = 3)wegetanumberofcombinationsequalto3 • 4 • 2 • 2 • 3 = 144.
That is quite a large number of tests to perform if you want to ensure
complete coverage of all combinations.
In real software applications, the number of values that can assume ni
variables is high and it is easy to reach the hundreds of thousands of
combinations, making it impossible to perform comprehensive tests
on all combinations.
How can we carry out an effective test when the number of variables
and values is so high as to make it impossible to exhaustively test all
combinations? What reduction techniques apply?
1-wise testing
When the number of combinations is high, it is possible at least verify
that – at least once – each individual value of the variables is given
as input to the program to be tested. In other words, if the variable A
can take the values A1, A2, A3, at least a first test must be executed in
which the variable A = A1, a second test in which A = A2, and a third test
in which the variable A = A3; the same goes for the other variables. This
type of test provides a so-called wise-1 cover, and we will see shortly
the meaning. In practice, we have the following table:
# TEST A B C
1 A1 * *
2 A2 * *
3 A3 * *
4 A4 * *
5 * B1 *
6 * B2 *
7 * B3 *
8 * * C1
9 * * C2
Table 3. Max Wise-1 Test Set
Apossiblefirstreductionistosetavalueforthefirstvariableandassign
a random (but permitted) value to the other variables (stated with *
in Table 3) and proceed in this way for all the variables and values. In
this way, we reduce the test cases from 24 to just 9. It is still possible
to further reduce the number of test cases, considering that instead
of * you can put a value of the variable which can then be excluded
from the subsequent test cases.
Put into practice, for test case #1 in place of B = * put B = B1, instead of
C = * put C = C1 and remove test case #5 and test case #8, which are now
both covered by test case #1.
Test case #2: in place of B = * put B = B2, and in place of C = * put C = C2,
and erase test cases #6 and #9, both of which are now covered by
test case #2.
Test case #3: instead of B = * put B = B3, and in place of C = * insert any
value C1 or C2, considering that the values of the variable C equal to C1
and C2 have already been covered by test cases #1 and #2; we can let
C = *andpostponethechoiceofwhethertoenterC1orC2.Now,remove
test case #7, since B = B3 is now covered by test case #3.
Having understood the mechanism, there remains only test case #4,
which covers A = A4; we can let B = * and C = *, postponing the choice of
what to actually select when we will really perform the test.
By Danilo Berta
Combinatorial Testing Tools
3. Testing Experience – 28/2014 25
The symbol * represents “don’t care”; we can put any value in it and
the coverage of the test set does not change, and the values of all
variables will be used at least once. Those with “*” value should be
covered more than once.
The final minimized test set for wise-1 coverage is the following:
# TEST A B C
1 A1 B1 C1
2 A2 B2 C2
3 A3 B3 *
4 A4 * *
Table 4. Minimized Wise-1 Test Set
Table 4isdrawnfromTable 3,movingupthecolumnsofthevariablesB
andCtofillthevalueswith*withspecificvalues;the*values“stagnate”
in the lines that cannot be covered from specific values (row 3 variable
C and row 4 variable B), because the number of values of the variables
are different (for example, variable B has just 3 values, while variable A
has 4 values; the missing B value – with respect to A – is replaced by *).
Therefore saying that a test set, such as that reported in Table 4, pro-
videswise-1coverageisequivalenttosayingthateachindividualvalue
of each variable is covered at least once.
The general wise-1 rule we can deduce is the following:
“N variables X1, X2, …, Xk, the first assuming n1 possible values, the
secondn2 possiblevalues,thek-thnk possiblevalues,themaximum
numberofteststhatprovidecoveragewise-1isequalton1 + n2 + … + nk,
whiletheminimumnumberoftestsisequaltothemaximumvalue
among { n1, n2, …, nk }.”
Inrealcases,whatisofinterestisalwaysthetestsetwiththeminimum
number of test cases that ensures the chosen coverage (and this is for
obvious reasons).
2-wise testing or pairwise testing
If the wise-1 test guarantees coverage of every single value for each
variable, it is easy to see that a wise-2 test set ensures that all pairs
of values of the variables are covered at least once. In the case of the
variables listed in Table 1, all pairs of variables are as follows: {(A, B), (A,
C), (B, C)}. In fact, the combinatorial calculation shows that the number
of combinations of N values taken K to K (with N ≥ K) is equal to:
N
K
N!
K!•(N−K)!
=
In our example we have three variables (N = 3) taken two to two
(K = 2), and applying the combinatorial formula above we get
3
2
3
3!
2!•(3−2)!
= = ; the three pairs are {(A, B), (A, C), (B, C)}.
Wanting to compute all possible pairs of variable values, we need to
consider the following table:
PAIRS
# VARIABLES VALUES
TOTAL
A B C
(A,B) 4 3 4 • 3 = 12
(A,C) 4 2 4 • 2 = 8
(B,C) 3 2 3 • 2 = 6
GRAND TOTAL 12 + 8 + 6 = 26
Table 5. Counting the Pairs of Values of the Variables A, B, and C
Hence, the total of all the pairs of values of the variables A, B, and C
whose values are reported in Table 1 is equal to 26 and they are all
printed in the following table:
# # of pairs of values
A, B A, C B, C
1 A1,B1 A1,C1 B1, C1
2 A1,B2 A1,C2 B1, C2
3 A1,B3 A2,C1 B2, C1
4 A2,B1 A2,C2 B2, C2
5 A2,B2 A3,C1 B3, C1
6 A2,B3 A3,C2 B3, C2
7 A3,B1 A4,C1
8 A3,B2 A4,C2
9 A3,B3
10 A4,B1
11 A4,B2
12 A4,B3
# PAIRS 12 8 6
TOTAL 12 + 8 + 6 = 26
Table 6. Pairs of Values of the Variables A, B, and C
Why should you consider a test set to cover wise-2? Is it not enough to
consider a test set with 1-wise coverage? Here we enter into a thorny
issue, in which opinions are different, concordant, and discordant.
Below is the “incipit” from the site www.pairwise.org [1]:
“Pairwise (a.k.a. all-pairs) testing is an effective test case genera-
tion technique that is based on the observation that most faults are
caused by interactions of at most two factors. Pairwise-generated
testsuitescoverallcombinationsoftwo,thereforearemuchsmaller
than exhaustive ones yet still very effective in finding defects.”
We mention also the opinion of James Bach and Patrick J. Schro-
eder about the pairwise method: “Pairwise Testing: A Best Practice
That Is Not” from James Bach, Patrick J. Schroeder available from
http://www.testingeducation.org/wtst5/PairwisePNSQC2004.pdf [2]:
“What do we know about the defect removal efficiency of pairwise
testing? Not a great deal. Jones states that in the US, on average,
the defect removal efficiency of our software processes is 85 % [26].
This means that the combinations of all fault detection techniques,
including reviews, inspections, walkthroughs, and various forms of
testing remove 85 % of the faults in software before it is released.
4. 26 Testing Experience – 28/2014
In a study performed by Wallace and Kuhn [27], 15 years of failure
data from recalled medical devices is analyzed. They conclude that
98 % of the failures could have been detected in testing if all pairs of
parameters had been tested (they did not execute pairwise testing,
they analyzed failure data and speculated about the type of test-
ing that would have detected the defects). In this case, it appears
as if adding pairwise testing to the current medical device testing
processes could improve its defect removal efficiency to a “best-in-
class” status, as determined by Jones [26].
On the other hand, Smith, et al. [28] present their experience with
pairwise testing of the Remote Agent Experiment (RAX) software
used to control NASA spacecraft. Their analysis indicates that pair-
wisetestingdetected88 %ofthefaultsclassifiedascorrectnessand
convergence faults, but only 50 % of the interface and engine faults.
In this study, pairwise testing apparently needs to be augmented
withothertypesoftestingtoimprovethedefectremovalefficiency,
especially in the project context of a NASA spacecraft. Detecting
only 50 % of the interface and engine faults is well below the 85 %
US average and presumably intolerable under NASA standards.
The lesson here seems to be that one cannot blindly apply pairwise
testing and expect high defect removal efficiency. Defect removal
efficiency depends not only on the testing technique, but also on
the characteristics of the software under test. As Mandl [4] has
shown us, analyzing the software under test is an important step
in determining whether pairwise testing is appropriate; it is also an
important step in determining what additional testing technique
should be used in a specific testing situation.”
[4] R. Mandl, “Orthogonal Latin Squares: An Application of Experi-
ment Design to Compiler Testing”, Communication of the ACM,
vol. 28, no. 10, pp. 1054–1058, 1985.
[26] Jones, Software Assessments, Benchmarks, and Best Practices.
Boston, MA: Addison Wesley Longman, 2000.
[27] D. R. Wallace and D. R. Kuhn, “Failure Modes in Medical Device
Software: An Analysis of 15 Years of Recall Data”, Int’l Jour. of
Reliability, Quality and Safety Engineering, vol. 8, no. 4, pp.
351–371, 2001.
[28] B. Smith, M. S. Feather, and N. Muscettola, “Challenges and
Methods in Testing the Remote Agent Planner”, in Proc. 5th Int’l
Conf. on Artificial Intelligence Planning and Scheduling (AIPS
2000), 2000, pp. 254–263
To clarify, we can say that the pairwise or 2-wise test method ensures
that all combinations of pairs of values of the variables are tested,
“theoretically ensuring” the maximization of the anomalies found,
with percentages ranging from 50 % to 98 % according to the studies.
In fact, no test can ever guarantee a defined percentage removal of
defects (which can only be calculated ex post for the specific project).
Let’s say – trying to be realistic – that pairwise achieves a valid agree-
www.testingexperience-shop.com
GET YOUR
PRINTED COPY
Order all issues in our shop!
5. Testing Experience – 28/2014 27
mentbetweenthenumberofteststobeperformedandtheanomalies
detected, when the number of variables and their values is so high
that it is not possible to test all the combinations (the so called all-wise
testing or N-wise testing, where N is the number of variables we are
playing with).
In the case of a test set covering wise-2 level, it is very simple to know
the maximum number of tests that provides coverage of all pairs of
values of the variables. This value is equal to the number of pairs of
valuesofthevariablesthemselves.InourexampleofthreevariablesA,
B and C in Table 1, this number is 26 (calculated as described in Table 6).
The real problem – still unsolved – is to discover the minimum number
of tests that guarantees wise-2 coverage, although there are a variety
of methods and algorithms that approximate this value for a problem
with an arbitrary number of variables and values. Examples of tools
that use these algorithms are:
1. Microsoft Pairwise Independent Combinatorial Testing tool
(PICT), downloadable from http://download.microsoft.com/
download/f/5/5/f55484df-8494-48fa-8dbd-8c6f76cc014b/pict33.msi
2. NIST Tools: http://csrc.nist.gov/groups/SNS/acts/documents/
comparison-report.html
3. James Bach AllPairs downloadable from
http://www.satisfice.com/tools.shtml
4. Other tools here: http://www.pairwise.org/tools.asp
n-wise Testing with n > 2
It is now easy to extend the concept of pairwise or 2-wise testing to the
generic case of n-wise, with n > 2. The generic test set provides n-wise
coverage if it is able to cover all the n-tuples (3-tuples if n = 3, 4-tuples
if n = 4 and so on). As in the pairwise, is always possible to know the
size of the maximum test set, equal to the number n-tuples of values
of the variables, but there is no way to know – in the general case – the
size of the minimum test set that guarantees coverage n-wise.
Using NIST Tools (ACTS) or Microsoft PICT (or other similar tools), it is
possible to extract a test set that approximates as closely as possible
the minimum test set. It is clear that, given a set of N variables, the
maximum level of wise which you can have is equal to the number
of variables. So, if we have four variables, a 4-wise test set coincides
with all possible combinations, while a 5-wise test set or higher makes
no sense.
The combinatorial testing techniques that we discussed in the first
part of the article are intended to solve a basic problem, which we
have already discussed and we rephrase as follows:
Direct Combinatorial Test Problem: “In a software system accepting
N input variables, each of which can take on different values, find the
test set with the smallest number of test cases that guarantees (at least)
coverage of all combinations (2-tuples) of all the values of the variables
involved.”
The Pairwise technique and a large number of support tools have
been developed to solve this problem. Once such a test set (the small-
est possible) has been generated, you should run the test cases and
detect (if present) all the defects that arise in the software under test.
There is also a second problem, maybe less “popular” compared to the
previous, as follows:
ReverseCombinatorialTestProblem: “GivenaTestSetforwhichyoudo
not know the method of generation (if any), calculate what percentage
of nwise coverage the test set ensures, with nwise between 1 and the
number variables in the test set”.
Anexample:testsgeneratedbyautomatictoolsforwhichyouhavelow
or almost zero process control, or when the “test cases” are generated
bytheautomaticflowsthatfeedinterfacesbetweendifferentsystems
(think of a system that transmits accounting data from a system A
to B); test data are – in general – excerpts from historical series over
which you have no control.
For test scenarios in some way related to a combinatorial inverse
problem, it is not easy to find support tools as such tools are not read-
ily available. The only tool I found is NIST CCM, in alpha-phase at the
time I am writing this article. If you like, you can request a copy of
the software: go to http://csrc.nist.gov/groups/SNS/acts/documents/
comparison-report.html as previously reported [3].
In the following we describe a set of tools called “Combinatorial Test-
ing Tools” (executable under Windows, but, if needed, not difficult to
port under Unix/Linux) that enables the (quasi)minimal test set to
be extracted and the coverage of a generic test set to be calculated,
using systematic algorithms calculation coverage and starting from
all n-tuples of the variables’ values. Such algorithms should be cat-
egorized as “brute force algorithms” and should be used (on a normal
supermarket-bought PC) if the number of variables and values is not
too high.
Overview of CTT
ToolsintheCombinatorialTestingToolsproducttrytoprovidesupport
tohelpsolvebothproblemsofcombinatorialtestingpreviouslystated.
Combinatorial Testing Tools do not intend to compete with the ex-
isting tools aimed at solving the direct problem of combinatorial
testing, such as Microsoft PICT, AllPair J. Bach, NIST, or several other
commercial and non-commercial tools already present on the mar-
ket. These tools implement algorithms definitely more effectively
than CTT and therefore should be favorite – I repeat – to solve the
direct problem.
Regardingthereverseproblemofcombinatorialtests,tomyknowledge
there are no tools on the market (except NIST CCM in alpha release)
and the CTT then attempt to provide a very first solution to the reverse
problem, to be surely improved over time, when we will better under-
standthelogicandtherulesthatarebehindcombinatorialtestingand
the minimal determination of test sets related to it.
We would like to remember that:
a. Solving the direct problem means determining the smallest
possible test set with a level of WISE coverage agreed (usually
WISE = 2) from the set of variables and values.
b. Solving the reverse problem means determining the level of
coverage of a given test set with respect to a reference WISE level
(also here usually WISE = 2)
The tools should be categorized as follows:
6. 28 Testing Experience – 28/2014
a. First level tools: batch DOS scripts providing an immediate re-
sponse to standard scenarios that typically occur in test projects
requiring combinatorial techniques.
b. Second level tools: executable (C++/Perl development language)
and more versatile, giving response to problems that may be less
common, but sometimes occur in test projects requiring combi-
natorial techniques.
First level scripts were thought of as the “wrapper” around the second
level executables, in order to “simplify end user life” with a set of
simple commands that enable you to quickly get a number of items of
“standard information”. The following table maps the two categories
of tools and the tool with the kind of information it supplies.
In this article we cannot go in details on the behavior of the tools; what
follows is a short description of all of the first level tools. More infor-
mation can be found in the tool’s user manual which is downloadable
(with the scripts) from: http://www.opensource-combinatorial-soft-
test-tools.net/index.php/download
Anyway, here is a useful summary table that links together first level
and second level tools.
First Level
Tools
Second Level
1 2 3 4 5 6 7 8 9 10 11 12 13
runW ô ô ô ô ô ô
runCC ô ô ô
runsCC ô ô ô
runT ô ô ô
runsT ô ô ô
runTS ô ô ô
runsTS ô ô ô
runTSF ô ô ô ô
runsTSF ô ô ô ô
runC ô
runR ô ô ô
Table 7. Mapping of First Level vs. Second Level Tools (Wrapping Map)
Below is the list of second level executables:
1. calcolaCopertura.exe
2. calcolaCoperturaSlow.exe
3. Combinazioni_n_k.exe
4. contrLimWise.exe
5. count_line.exe
6. creaFileProdCart.exe
7. creaStringa.exe
8. generaTestSet.exe
9. generaTestSetSlow.exe
10. ProdCart.exe
11. reduceNple.exe
12. runConstrains.pl
13. uniqueRowFile.exe
First Level Tools – Batch DOS Script
Tool runW
This is the first tool that is mandatory to run before all the other tools.
It generates all the n-tuples corresponding to the value of the Wise
past input (runW = run Wise)
Tool runCC and runsCC
Computes the input test set coverage in respect of the WISE passed as
input (runCC = run Circulate Coverage)
Tools runT and runsT
Get the minimal test set with guaranteed coverage equal to the Wise
passed in input (runT = run Test), extracting the test cases from the
file of the WISE_MAX-tuples (all combinations).
Tools runTS and runsTS
Get the minimal test set with guaranteed coverage equal to the Wise
passed in input or equal to the coverage of the test set passed in input
if less than WISE, extracting the test cases from the file of the test set
passed in input (runTS = run Test Set)
Tools runTSF and runsTSF
Get the minimal test set with guaranteed coverage equal to the Wise
passed in input or equal to the coverage of the test set passed in input
if less than WISE, extracting the test cases from the file of the test set
passed in input, excluding n-tuples already covered by the partial test
set input file (runTSF = run Test Set Forbidden).
Tool runR
Extracts a non-minimal test set but still smaller than the maximum
test set with guaranteed coverage equal to the Wise passed as input
(runR = run Reduce).
Tool runC
Applies constraints to n-tuple file (or test set file) passed as input.
Second Level Tools – Executable
In the following we describes the second level tools, a little more hard
to use but more versatile; may be useful to experienced users for
managing more complex scenarios.
Executable calcolacopertura.exe and
calcolaCoperturaSlow.exe
Performs the coverage calculation of the input test set in respect of
the input WISE.
Executable Combinazioni_n_k
ExtractsallKbyKcombinationsofastringoflengthNpassedasinput.
7. Testing Experience – 28/2014 29
Executable generaTestSet.exe and
generaTestSetSlow.exe
Gets the minimal test set with guaranteed coverage equal to the Wise
passed in input or equal to the coverage of the test set passed in input
if less than WISE, extracting the test cases from the file of the test set
passed in input, excluding n-tuples already covered by the partial
test set input file.
Executable ProdCart.exe
Generates all possible combinations of the values of variables as de-
fined in the input file.
Executable reduceNple.exe
“Squeezes” as many n-tuples as possible contained in the input file,
replacing the values “*” with specific values of the variables and thus
creating a test set from the file of n-tuples. While not the test set
minimum,itisreducedcomparedtothetestsetmaximum(coincident
withalln-tuples).Thenumberofrecordsdependsonthesortingofthe
n-tuples input file, in an unknown way. There is definitely a sorting of
the files row to which the test set output contains a minimum number
of test cases with guaranteed WISE-coverage, but finding this sort is
not feasible from a computational point of view, as it is too onerous.
There are six other executables that do not provide direct support to
the generation and/or operation of the test ssets, but are predomi-
nantly used by DOS batch tools to perform secondary operations that
it is impossible or – at least – very complex to do directly from DOS.
These utilities may also be of some use, even if they are not to be con-
sidered “tout cours” test tools. We have not described those utilities
in this article.
Conclusion
In the article we gave an overview of a test methodology that uses
combinatorial calculus to find test cases for a software component,
knowing the inputs of the same. Generally speaking a combinatorial
technique like this generates too many test cases, so we need to define
a so-called “N-wise coverage” (with N from 1 to the number of input
variables), select a value of N (usually N=2, pairwise testing) and ex-
tract a subsystem of test cases with the guarantee of N-wise coverage.
This is the “Direct Combinatorial Test Problem” and there are a lot
of wonderful tools on the market that solve the problem very quickly.
We then dealt with the Reverse Combinatorial Test Problem: if you
have a test set build upon the N inputs of a software component
about which you know nothing, what percentage of N-wise coverage
does the test set ensure? On the market I just found one tool that
addresses this problem: NIST CCM, which is still in alpha phase at the
time I am writing this article. In the article I give an overview of the
CTT (Combinatorial Testing Tools) I developed in C++ that, using a
“brute-force” approach, try to give a very first response to the “Reverse
Combinatorial Test Problem”.
But there is (at least) a problem whose solution is not still known. For a
software with N inputs, what is the minimum test set (if it exists) that
guarantees the N-level coverage? The solution exists just for a trivial
case: for 1-wise coverage is always equal to the number of values of the
variable with a maximum number of values, while N-wise coverage
coincides with all the variable combinations of the value. And what
if we also include the outputs? This could be the material for another
article in the future … ◼
Notes of Appreciation
[1] Many thanks to Jacek Czerwonka, owner of the web site
www.pairwise.org, who allowed me to reprint the “incipit” of the
same.Bytheway,hewrotetomeaboutsomeevolutiononthesubject
ofpairwisevs.randomtestingthatyoucanfindinthearticle“AnEm-
piricalComparisonofCombinatorialandRandomTesting”availableat
thelink:http://www.nist.gov/customcf/get_pdf.cfm?pub_id=915439
written by: Laleh Sh. Ghandehari, Jacek Czerwonka, Yu Lei, Soheil
Shafiee, Raghu Kacker, and Richard Kuhn.
[2] Many thanks to James Bach, owner of the website
www.satisfice.com who allowed me to reprint part of the article
“Pairwise Testing: A Best Practice That Is Not” from James Bach, Pat-
rick J. Schroeder, available from http://www.testingeducation.org/
wtst5/PairwisePNSQC2004.pdf.
[3] Many thanks to Dr. Richard Kuhn from NIST who kindly sent me a
copy of the NIST CCM tools. We would like to remind you that you
should request a copy: go to http://csrc.nist.gov/groups/SNS/acts/
documents/comparison-report.html as previously reported.
Danilo Berta graduated in Physics at Turin Uni-
versity (Italy) in 1993 and first started work as a
Laboratory Technician, but he soon switched to
the software field as an employee of a consul-
tancy company working for a large number of
customers.Throughout hiscareer,hehasworked
in banks as a Cobol developer and analyst, for
the Italian treasury, the Italian railways (structural and functional
software testing),as well as for an Italian automotive company,the
European Space Agency (creation and testing of scientific data files
for the SMART mission), telecommunication companies, the na-
tional Italian television company, Italian editorial companies, and
more.This involved work on different kinds of automation test proj-
ects (HP Tools), software analysis, and development projects. With
his passion for software development and analysis – which is not
just limited to testing – he has written some articles and a software
course for Italian specialist magazines.His work enables him to deal
mainly with software testing;he holds both the ISEB/ISTQB Founda-
tion Certificate in Software Testing and the ISEB Practitioner Cer-
tificate; he is a regular member of the British Computer Society.
Currently, he lives in Switzerland and works for a Swiss company.
Website: www.bertadanilo.name
> about the author