What Is Pairwise Testing And How To Use It For Cost-Effective QA

Yana Badzhieva
Apr 22, 2019 · 4 min read
Image for post
Image for post
Image credit: Unsplash

Pairwise testing is a method of software testing that helps in reducing the number of tests while keeping the testing quality at a high level. We use this approach in development of 1C:Enterprise-based products, and today will show how this method could be used in the real world.

What is pairwise testing

Pairwise testing is a black box testing method. It is essential to understand that most common bugs that can be found in software are usually triggered by either a single input parameter or an interaction between pairs of parameters. Finding bugs involving interactions between three or more parameters is hard and costly.

Pairwise testing involves testing all possible discrete combinations of system’s each pair of input parameters instead of searching for all combinations of all parameters. By using carefully chosen test vectors and parallelizing tests, this method is capable of significant resource saving and speeding up the whole process.

As a result, the number of test-cases used is lowered while the overall functional coverage does not decrease significantly.

“Usual” approach to testing

For the beginning, we need to define testing parameters and the volume of checks. Data and a loan period won’t be parameterized at this stage, for now, tests for values from the range of permissible values will suffice. We will search for boundary values and those within the range.

For example, the loan start date should not be older than the loan end date, etc. Here we have the following parameters:

Contract type: Lent or Borrowed

Image for post
Image for post

Currency: USD, Euro, CZK:

Image for post
Image for post

Fields Commission, Annual Interest, Principal have Yes or No values:

Image for post
Image for post

In the Repayment terms tab, the Payments field can have 5 values, while 360 Days in Year flag can be either set or unset:

Image for post
Image for post

Let’s combine all parameters in one table:

Image for post
Image for post

Simple parameters’ brute force gives us 2*3*5*2*2*2*2 = 480 overall tests number. Only for one document!

Pairwise testing for QA optimization

It can be quickly done using Notepad. The number of rows in the document corresponds with the number of parameters. Their values go after the colon and divided by a comma.

Image for post
Image for post

Then create the Result.txt file and run the following command in command line:

Image for post
Image for post

As a result, the Result.txt file will be filled with shortened testing results.

Image for post
Image for post

As it can be clearly seen, we’ve managed to reduce the number of checks from 480 to 15. Such reduction yields significant time savings.

The pairwise testing method is highly effective for the cases with the limited number of parameters with multiple possible values.

More articles on software development and QA:

Yellow Universe

Stories and updates from 1Ci

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store