What is "All Singles"?
“All Singles” is a method that tests several variables/arguments together. This method tests all permutation (all options). In order to know all the options we will use the Cartesian product algorithm, which is the easy way (in my opinion) to calculate all the possible options of several variables together.
The idea behind this method is that every value of each variable must appear in at least one test.
How to calculate the “All Singles”?
Let A1, A2, A3 be 3 variables/fields/parameters.
- A1 has 1, 2, and 3 as values
- A2 has s, t for values
- A3 has y, z for values
The Cartesian equation will be: A1 X A2 X A3 Which means: {1, 2, 3} X {s, t} X {y, z}
In other words: A1 X A2 X A3 = {1, 2, 3} X {s, t} X {y, z}.
The number of test cases will be: 3X2X2 = 12 because we have 3 values for variable A1, 2 values for variable A2 and 2 values for variable A3.
Let’s start to write all the options (The red marked values are the choosen values):
|
Test Case #
|
Values Participates
|
Result
|
|
1
|
{1, 2, 3}X{s, t}X{y, z}
|
(1, s, y)
|
|
2
|
{1, 2, 3}X{s, t}X{y, z}
|
(1, s, z)
|
|
3
|
{1, 2, 3}X{s, t}X{y, z}
|
(1, t, y)
|
|
4
|
{1, 2, 3}X{s, t}X{y, z}
|
(1, t, z)
|
|
5
|
{1, 2, 3}X{s, t}X{y, z}
|
(2, s, y)
|
|
6
|
{1, 2, 3}X{s, t}X{y, z}
|
(2, s, z)
|
|
7
|
{1, 2, 3}X{s, t}X{y, z}
|
(2, t, y)
|
|
8
|
{1, 2, 3}X{s, t}X{y, z}
|
(2, t, z)
|
|
9
|
{1, 2, 3}X{s, t}X{y, z}
|
(3, s, y)
|
|
10
|
{1, 2, 3}X{s, t}X{y, z}
|
(3, s, z)
|
|
11
|
{1, 2, 3}X{s, t}X{y, z}
|
(3, t, y)
|
|
12
|
{1, 2, 3}X{s, t}X{y, z}
|
(3, t, z)
|
When to use "All Singles"?
- When the system is safety-critical or mission critical software (army and medicine applications).
- When we have few tests and we can do it in order to produce a higher quality product.
However, in cases you have many test cases; it recommended that you will use methods to decrease the number of test cases.
Practice 1
You have a system that should work on windows 2000, windows xp, internet explorer 6.5, internet explorer 7, .Net 2.0, and .Net 3.0. How many test cases can you perform using ‘all singles’?
Try to solve it before continue reading.
Practice 1 - answer
Let us mark:
- A = {win 2000, win xp}
- B = {IE 6.5, IE 7}
- C = {.Net 2.0, .Net 3.0}
Total test cases = 2X2X2 = 8
So, all options table will be:
|
Test Case #
|
A
|
B
|
C
|
|
1
|
Win 2000
|
IE 6.5
|
.Net 2.0
|
|
2
|
Win 2000
|
IE 6.5
|
.Net 3.0
|
|
3
|
Win 2000
|
IE 7.0
|
.net 2.0
|
|
4
|
Win 2000
|
IE 7.0
|
.Net 3.0
|
|
5
|
Win XP
|
IE 6.5
|
.Net 2.0
|
|
6
|
Win XP
|
IE 6.5
|
.Net 3.0
|
|
7
|
Win XP
|
IE 7.0
|
.Net 2.0
|
|
8
|
Win XP
|
IE 7.0
|
.Net 3.0
|
Practice 2
You have a screen with 3 combo boxes: Name (Keren, Dan, Andy, Max), Gender (Male, Female) and Job Title (IT, Programmer, QA, C.I.O). How many test cases can you perform using ‘all singles’?
Try to solve it before continue reading.
Practice 2 - answer
Let us mark:
- A = {Keren, Dan, Andy, Max}
- B = {Male, Female}
- C = {IT, Programmer, QA, C.I.O}
Total test cases = 4X2X4 = 32
So, all options table will be:
|
Test Case #
|
A
|
B
|
C
|
|
1
|
Keren
|
Male
|
IT
|
|
2
|
Keren
|
Male
|
Programmer
|
|
3
|
Keren
|
Male
|
QA
|
|
4
|
Keren
|
Male
|
C.I.O
|
|
5
|
Keren
|
Female
|
IT
|
|
6
|
Keren
|
Female
|
Programmer
|
|
7
|
Keren
|
Female
|
QA
|
|
8
|
Keren
|
Female
|
C.I.O
|
|
9
|
Dan
|
Male
|
IT
|
|
10
|
Dan
|
Male
|
Programmer
|
|
11
|
Dan
|
Male
|
QA
|
|
12
|
Dan
|
Male
|
C.I.O
|
|
13
|
Dan
|
Female
|
IT
|
|
14
|
Dan
|
Female
|
Programmer
|
|
15
|
Dan
|
Female
|
QA
|
|
16
|
Dan
|
Female
|
C.I.O
|
|
17
|
Andy
|
Male
|
IT
|
|
18
|
Andy
|
Male
|
Programmer
|
|
19
|
Andy
|
Male
|
QA
|
|
20
|
Andy
|
Male
|
C.I.O
|
|
21
|
Andy
|
Female
|
IT
|
|
22
|
Andy
|
Female
|
Programmer
|
|
23
|
Andy
|
Female
|
QA
|
|
24
|
Andy
|
Female
|
C.I.O
|
|
25
|
Max
|
Male
|
IT
|
|
26
|
Max
|
Male
|
Programmer
|
|
27
|
Max
|
Male
|
QA
|
|
28
|
Max
|
Male
|
C.I.O
|
|
29
|
Max
|
Female
|
IT
|
|
30
|
Max
|
Female
|
Programmer
|
|
31
|
Max
|
Female
|
QA
|
|
32
|
Max
|
Female
|
C.I.O
|
The "All Singles" problem
If we have 3 variables:
- A1 with 10 values
- A2 with 5 values
- A3 with 4 values
The number of test cases will be: 10X5X4 = 200. We need to reduce the amount of test cases in order to be able to test a program in a normal amount of time.
We already learned "Boundary Values Testing" and "Equivalence Class Partitioning" methods that can help us reduce test cases. In few more minutes you will learn a method that can help us to solve the "All Singles" problem that called "All Pairs".
Summary
We as testers always need to know how much tests we need to perform or write on a requirement. We need to calculate the number of tests cases that can be done before we start to write the first sentence of the first test case. Only after knowing how much test cases can be done, we need to think if we need to reduce those test cases and how to reduce them.
We saw some black box methods than can help us reduce the amount of test cases and we will see some more methods that can help us. Sometimes, we can reduce the amount of test cases using our knowledge in the tested system and sometimes we can reduce test cases using our head and common sense.
We need to remember that we usually don't have enough time, money and manpower to test everything, so we need to reduce our test efforts in a smart way such that still find most of the critical and high priority bugs with minimum testing efforts. |
|
|
|