What is Domain Testing in Software Testing? (with Example)

What is Domain Testing?

Domain Testing is a Software Testing process in which the application is tested by giving a minimum number of inputs and evaluating its appropriate outputs. The primary goal of Domain testing is to check whether the software application accepts inputs within the acceptable range and delivers required output.

It is a Functional Testing technique in which the output of a system is tested with a minimal number of inputs to ensure that the system does not accept invalid and out of range input values. It is one of the most important White Box Testing methods. It also verifies that the system should not accept inputs, conditions and indices outside the specified or valid range.

Domain testing differs for each specific domain so you need to have domain specific knowledge in order to test a software system.

In this tutorial, you will learn-

Simpler Practice of Domain Testing

In domain testing, we divide a domain into sub-domains (equivalence classes) and then test using values from each subdomain. For example, if a website (domain) has been given for testing, we will be dividing the website into small portions (subdomain) for the ease of testing.

Domain might involve testing of any one input variable or combination of input variables.

Practitioners often study the simplest cases of domain testing less than two other names, “boundary testing” and “equivalence class analysis.”

Boundary testing – Boundary value analysis (BVA) is based on testing at the boundaries between partitions. We will be testing both the valid and invalid input values in the partition/classes.

Equivalence Class testing – The idea behind this technique is to divide (i.e. to partition) a set of test conditions into groups or sets that can be considered the same (i.e. the system should handle them equivalently), hence ‘equivalence partitioning.’

That simplified form applies for Domain testing –

  1. Only to tests of input variables
  2. Only when tested at the system level
  3. Only when tested one at a time
  4. Only when tested in a very superficial way

It can be simplified as below:

Variable Valid Class Equivalence Class Invalid Class Equivalence Class Boundaries & Special cases Notes
X 0-100 0
100
<0 -1
>100 101

Explanation:

  1. If a field accepts ranges from 0-100, the field should not accept -1 and 101 as they are invalid entries and beyond the boundaries.
  2. The field should accept values such as 0,100 and any number between them.

Building table like these (in practice)

  1. To build an equivalence class analysis over time put the information into a spreadsheet. Start by listing variables. Add information about them as you obtain it.
  2. The table should eventually contain all variables. This means, all input variables, all output variables, and any intermediate variables that you can observe.
  3. In practice, most tables that I have seen are incomplete. The best ones seen list all the variables and add detail for critical variables.

Domain Testing Strategy

While domain testing, you need to consider following things,

  1. What domain are we testing?
  2. How to group the values into classes?
  3. Which values of the classes to be tested?
  4. How to determine the result?

What domain are we testing?

Any domain which we test has some input functionality and an output functionality. There will be some input variables to be entered, and the appropriate output has to be verified.

Domain Testing Example

  1. Consider a single input test scenario:

C = a+b, where a and b are input variables and C is the output variable.

Here in the above example, there is no need of classification or combination of the variables is required.

  1. Consider the below multiple inputs and appropriate output scenario:

Consider a games exhibition for Children, 6 competitions are laid out, and tickets have to be given according to the age and gender input. The ticketing is one of the modules to be tested in for the whole functionality of Games exhibition.

According to the scenario, we got six scenarios based on the age and the competitions:

  1. Age >5 and <10, Boy should participate in Storytelling.
  2. Age >5 and <10 , girl should participate in Drawing Competition.
  3. Age >10 and <15, Boy should participate in Quiz.
  4. Age >10 and <15 , girl should participate in Essay writing.
  5. Age<5, both boys and girls should participate in Rhymes Competition.
  6. Age >15, both boys and girls should participate in Poetry competition.

Here the input will be Age and Gender and hence the ticket for the competition will be issued. This case partition of inputs or simply grouping of values come into the picture.

How to group the values into classes?

Partitioning some values means splitting it into non-overlapping subsets.

As we discussed earlier there are two types of partitioning:

  1. Equivalence partitioning – Equivalence partitioning is a software testing technique that divides the input data of a software unit into partitions of equivalent data from which test cases can be derived. In principle, test cases are designed to cover each partition at least once.
  2. Boundary value analysis – Boundary value analysis is a software testing technique in which tests are designed to include representatives of boundary values in a range. The idea comes from the boundary.

For the above example, we are partitioning the values into a subset or the subset. We are partitioning the age into the below classes :

  1. Class 1: Children with age group 5 to 10
  2. Class 2 : Children with age group less than 5
  3. Class 3: Children with age group age 10 to 15
  4. Class 4: Children with age group greater than 15.

Which values of the classes to be tested?

The values picked up for testing should be Boundary values:

  1. Boundaries are representatives of the equivalence classes we sample them from. They’re more likely to expose an error than other class members, so they’re better representatives.
  2. The best representative of an equivalence class is a value in between the range.

For the above example we have the following classes to be tested:

For example for the scenario #1:

  1. Class 1: Children with age group 5 to 10 (Age >5 and <=10)

Boundary values:

  1. Values should be Equal to or lesser than 10. Hence, age 10 should be included in this class.
  2. Values should be greater than 5. Hence, age 5 should not be included in this class.
  3. Values should be Equal to or lesser than 10. Hence, age 11 should not be included in this class.
  4. Values should be greater than 5. Hence, age 6 should be included in this class.

Equivalence partition Values:

Equivalence partition is referred when one has to test only one condition from each partition. In this, we assume that if one condition in a partition works, then all the condition should work. In the same way, if one condition in that partition does not work then we assume that none of the other conditions will work. For example,

(Age >5 and <=10)

As the values from 6 to 10 are valid ones, one of the values among 6,7,8,9 and 10 have to be picked up. Hence selected age “8” is a valid input age for the age group between (Age >5 and <=10). This sort of partition is referred as equivalence partition.

Scenario Boundary values to be taken Equivalence partitioning values
Boy – Age >5 and <=10 Input age = 6

Input age = 5

Input age = 11

Input age = 10

Input age = 8
Girl – Age >5 and <=10 Input age = 6

Input age = 5

Input age = 11

Input age = 10

Input age = 8
Boy – Age >10 and <=15 Input age = 11

Input age = 10

Input age = 15

Input age = 16

Input age = 13
Girl – Age >10 and <=15 Input age = 11

Input age = 10

Input age = 15

Input age = 16

Input age = 13
Age<=5 Input age = 4

Input age = 5

Input age = 3
Age >15 Input age = 15

Input age = 16

Input age = 25

How do we determine whether the program passed or failed the test?

Passing the functionality not only depends upon the results of the above scenarios. The input given and the expected output will give us the results and this requires domain knowledge.

Determining the results of the example:

Hence, if all the test cases of the above pass, the domain of issuing tickets in the competition get passed. If not, the domain gets failed.

Domain Testing Structure

Usually, testers follow the below steps in a domain testing. These may be customized/ skipped according to our testing needs.

  • Identify the potentially interesting variables.
  • Identify the variable(s) you can analyze now and order them (smallest to largest and vice versa).
  • Create and identify boundary values and equivalence class values as above.
  • Identify secondary dimensions and analyze each in a classical way. (In the above example, Gender is the secondary dimension).
  • Identify and test variables that hold results (output variables).
  • Evaluate how the program uses the value of this variable.
  • Identify additional potentially-related variables for combination testing.
  • Imagine risks that don’t necessarily map to an obvious dimension.
  • Identify and list unanalyzed variables. Gather information for later analysis.
  • Summarize your analysis with a risk/equivalence table.

Summary:

Domain testing, as it is described above, requires knowledge of providing right input to achieve the desired output. Thus, it is only possible to use it for small chunks of code.