Test configuration generation in Combinatorial testing - Example | Set-2
Last Updated :
02 Oct, 2020
We have discussed the algorithm used for test configuration generation in the article Test Configuration Generation in Combinatorial Testing. Let's understand the algorithm in-depth with a solved example given below.
Example
Consider an application that works on any of the three browsers: Safari, Internet Explorer and Firefox. The application runs on three Operating systems including Windows, macOS, and Linux. The application is able to connect to the devices using three connection protocols including LAN, PPP, and ISDN. Also, the output is sent to a printer that is either local or networked or is sent to a screen by the application. For the given application, do the following:
- Identify the factors and levels in the given problem
- Generate test configuration for the application using MOLS which satisfy the following constraints:
- Safari supports only macOS
- Internet Explorer works only on Windows
- Firefox works on all the three OS, i.e. macOS, Windows, and Linux
Solution:
1. Identify factors and levels
For the given problem, the factors and levels are:
FACTORS | LEVELS |
---|
F1' : Browser | Safari, Internet Explorer, Firefox |
F2' : Operating System | Windows, macOS, Linux |
F3' : Protocol | LAN, PPP, ISDN |
F4' : Printer | Network, Local, To_Screen |
Therefore, there are a total of 4 factors and each factor has 3 levels.
2. Generate test configuration
(a) Relabel the factors
Factors have to be relabeled such that :
Since, |F1| = |F2| = |F3| = |F4| = 3
So, the relation |F1| >= |F2| >= |F3| >= .........|Fn-1| >= |Fn| is satisfied.
Therefore, factors are labeled as:
F1 = F1'
F2 = F2'
F3 = F3'
F4 = F4'
Also, as b = |F1| and k = |F2|,
Therefore, b = 3 and k = 3
NOTE: |Fi| is the number of levels in factor Fi. Also, b denotes the number of blocks and k denotes the number of rows in each block.
(b) Prepare a table and fill columns F1 and F2
Let's now prepare a table containing 4 columns since there are four factors. Also, we need ( b x k ) number of rows, i.e. ( 3 x 3 ) = 9 rows divided into 3 blocks. Now, we fill Column F1 with 1s in Block 1, 2s in Block 2, and so on. Also, we fill the Column F2 using the sequence 1,2,3......k in Rows 1 through k. The table prepared is as follows:
BLOCK | ROW | F1 | F2 | F3 | F4 |
---|
1 | 1 | 1 | 1 | | |
1 | 2 | 1 | 2 | | |
1 | 3 | 1 | 3 | | |
2 | 1 | 2 | 1 | | |
2 | 2 | 2 | 2 | | |
2 | 3 | 2 | 3 | | |
3 | 1 | 3 | 1 | | |
3 | 2 | 3 | 2 | | |
3 | 3 | 3 | 3 | | |
(c) Find MOLS of order k and fill the rest of the columns
Since k = 3,
So, MOLS of order 3 are required.
We know that if k is a prime or power of prime then number of MOLS = k - 1
As k = 3 is prime, therefore 2 MOLS exists that are:
1 2 3 1 2 3
M1 = 2 3 1 M2 = 3 1 2
3 1 2 2 3 1
We fill the remaining two columns using the columns of M1 for F3 and columns of M2 for F4:
BLOCK | ROW | F1 | F2 | F3 | F4 |
---|
1 | 1 | 1 | 1 | 1 | 1 |
1 | 2 | 1 | 2 | 2 | 3 |
1 | 3 | 1 | 3 | 3 | 2 |
2 | 1 | 2 | 1 | 2 | 2 |
2 | 2 | 2 | 2 | 3 | 1 |
2 | 3 | 2 | 3 | 1 | 3 |
3 | 1 | 3 | 1 | 3 | 3 |
3 | 2 | 3 | 2 | 1 | 2 |
3 | 3 | 3 | 3 | 2 | 1 |
(d) Check if constraints are satisfied
In the given problems, factors F1(Browser) and F2 (Operating system) are dependent on each other as:
- Safari supports only macOS
- Internet Explorer works only on Windows
- Firefox works on all the three OS, i.e. macOS, Windows, and Linux
So, an entry in the row is highlighted in yellow if it does not satisfy the constraints mentioned above:
BLOCK | ROW | F1 | F2 | F3 | F4 |
---|
1 | 1 | 1 | 1 | 1 | 1 |
1 | 2 | 1 | 2 | 2 | 3 |
1 | 3 | 1 | 3 | 3 | 2 |
2 | 1 | 2 | 1 | 2 | 2 |
2 | 2 | 2 | 2 | 3 | 1 |
2 | 3 | 2 | 3 | 1 | 3 |
3 | 1 | 3 | 1 | 3 | 3 |
3 | 2 | 3 | 2 | 1 | 2 |
3 | 3 | 3 | 3 | 2 | 1 |
In the above table, there are four rows that do not satisfy the given constraints. For example, Row 1 of Block 1, F1 = 1 and F2 = 1, i.e. F1 is Safari and F2 is Windows, however, it is clearly mentioned in the first constraint that Safari only supports macOS and no other operating system. Hence, this row does not satisfy the constraints and is hence highlighted.
(e) Remove configurations that do not satisfy given constraints
The configurations that are highlighted in yellow in the above table have to be removed and to do this, we will use a two-step procedure:
- Modify the highlighted rows so that the constraints are maintained
- Add new configurations that cover the pairs that were left uncovered while replacing the highlighted rows
So, in the first step, we modify the above-highlighted rows such that these rows satisfy the given constraints. The modified table is shown below:
BLOCK | ROW | F1 | F2 | F3 | F4 |
---|
1 | 1 | 1 | 2 | 1 | 1 |
1 | 2 | 1 | 2 | 2 | 3 |
1 | 3 | 1 | 2 | 3 | 2 |
2 | 1 | 2 | 1 | 2 | 2 |
2 | 2 | 2 | 1 | 3 | 1 |
2 | 3 | 2 | 1 | 1 | 3 |
3 | 1 | 3 | 1 | 3 | 3 |
3 | 2 | 3 | 2 | 1 | 2 |
3 | 3 | 3 | 3 | 2 | 1 |
For the second step, The new configurations are as follows:
F1 F2 F3 F4
- 1 1 1 ....(A)
- 3 3 2 ....(B)
- 2 3 1 ....(C)
- 3 1 3 ....(D)
Here, '-' denotes that F1 could take any value out of 1,2,3.
(A) and (C) is already satisfied in the above table since:
- F2 = 1 and F3 = 1 is occurring in Row 3 of Block 2. Also, F3 = 1 and F4 = 1 is occurring in Row 1 of Block 1. Hence, (A) is satisfied
- Similarly, F2 = 2 and F3 = 3 is occurring in Row 3 of Block 1 and F3 = 3 and F4 = 1 is occurring in Row 2 of Block 2. Hence, (C) is satisfied
However, (B) and (D) are not satisfied in the above table, so we add them to the unique configuration table. The updated table is shown below:
BLOCK | ROW | F1 | F2 | F3 | F4 |
---|
1 | 1 | 1 | 2 | 1 | 1 |
1 | 2 | 1 | 2 | 2 | 3 |
1 | 3 | 1 | 2 | 3 | 2 |
2 | 1 | 2 | 1 | 2 | 2 |
2 | 2 | 2 | 1 | 3 | 1 |
2 | 3 | 2 | 1 | 1 | 3 |
3 | 1 | 3 | 1 | 3 | 3 |
3 | 2 | 3 | 2 | 1 | 2 |
3 | 3 | 3 | 3 | 2 | 1 |
4 | 1 | - | 3 | 3 | 2 |
4 | 2 | - | 3 | 1 | 3 |
(f) Replace the numbers in the columns with the given factor values
We now replace the values of columns F1, F2, F3 and F4 with their actual value i.e. levels. The final design configuration is as shown below:
S.No. | F1 | F2 | F3 | F4 |
---|
1 | 1 [Safari] | 2 [macOS] | 1 [LAN] | 1 [Network] |
2 | 1 [Safari] | 2 [macOS] | 2 [PPP] | 3 [To_Screen] |
3 | 1 [Safari] | 2 [macOS] | 3 [ISDN] | 2 [Local] |
4 | 2 [Internet Explorer] | 1 [Windows] | 2 [PPP] | 2 [Local] |
5 | 2 [Internet Explorer] | 1 [Windows] | 3 [ISDN] | 1 [Network] |
6 | 2 [Internet Explorer] | 1 [Windows] | 1 [LAN] | 3 [To_Screen] |
7 | 3 [Firefox] | 1 [Windows] | 3 [ISDN] | 3 [To_Screen] |
8 | 3 [Firefox] | 2 [macOS] | 1 [LAN] | 2 [Local] |
9 | 3 [Firefox] | 3 [Linux] | 2 [PPP] | 1 [Network] |
10 | - | 3 [Linux] | 3 [ISDN] | 2 [Local] |
11 | - | 3 [Linux] | 1 [LAN] | 3 [To_Screen] |
Similar Reads
Test Configuration Generation in Combinatorial Testing
Test configuration generation is an important part of Combinatorial test design process. Combinatorial design process is shown in the figure below : As can be seen from the above figure, combinatorial test design process has 3 main steps : Modeling of the input space and configuration space. Generat
6 min read
Approaches for Test Data Generation in Software Testing
As a tester, your job is not just about testing the software, but also managing, collecting, and maintaining large sets of data. These data sets are crucial for testing all the major test cases to make sure the software meets all the requirements, whether itâs for functional or non-functional testin
5 min read
Code Coverage Testing in Software Testing
Every Software Developer follows the Software Development Life Cycle (SDLC)Â for the development of any software application. Testing is one of the important phases that is performed to check whether the developed software application is fulfilling the requirements or not. Table of Content What is Co
6 min read
Difference between Error Seeding and Mutation Testing in Software Testing
In software testing, identifying defects and ensuring that an application meets its expected behavior are critical for delivering quality software. There are several testing techniques, two of which are Mutation Testing and Error Seeding. Both are part of white-box testing techniques and aim to iden
4 min read
Test Plan Template - Software Testing
A Test Plan Template is an essential tool in software testing that outlines the strategy, scope, and objectives of the testing process. It provides a structured approach to ensure that all aspects of the application are thoroughly evaluated. By using a well-defined test plan template, you can stream
11 min read
Decision Table Based Testing in Software Testing
What is a Decision Table : Decision tables are used in various engineering fields to represent complex logical relationships. This testing is a very effective tool in testing the software and its requirements management. The output may be dependent on many input conditions and decision tables give a
3 min read
Mutation Testing - Software Testing
Mutation Testing is a type of Software Testing that is performed to design new software tests and also evaluate the quality of already existing software tests. Mutation testing is related to modification a program in small ways. It focuses to help the tester develop effective tests or locate weaknes
3 min read
Path Testing in Software Engineering
Path Testing is a method that is used to design the test cases. In the path testing method, the control flow graph of a program is designed to find a set of linearly independent paths of execution. In this method, Cyclomatic Complexity is used to determine the number of linearly independent paths an
2 min read
Random Testing in Software Testing
Random testing is software testing in which the system is tested with the help of generating random and independent inputs and test cases. Random testing is also named monkey testing. It is a black box assessment outline technique in which the tests are being chosen randomly and the results are bein
4 min read
Importance of Testing In Competitive Programming
Many times while solving problems, we face issues like time limit exceeds, wrong solution, runtime error, and memory limit exceeds because after designing algorithm we don't test algorithm efficiency, correctness, time complexity and running the algorithm on a large set of inputs for testing purpose
3 min read