You are on page 1of 24

Domain Analysis

Testing
Introduction-I
• In this lecture we shall consider the testing of
multiple variables simultaneously. There are two
reasons to consider this:
• We rarely will have time to create test cases for
every variable in our systems. There are simply
too many.
• Often variables interact. The value of one
variable constrains the acceptable values of
another. In this case, certain defects cannot be
discovered by testing them individually.
Introduction-II
• Domain analysis is a technique that can be used
to identify efficient and effective test cases when
multiple variables can or should be tested
together. It builds on and generalizes
equivalence class and boundary value testing
to n simultaneous dimensions. Like those
techniques, we are searching for situations
where the boundary has been defined or
implemented incorrectly.
Introduction-III
• Domain analysis is a technique that can be
used to identify efficient and effective test
cases when multiple variables should be
tested together.
Domain Analysis Testing
• Variables rarely function on their own to produce
output.
• Most Complex programs generate output from
more than one input variables.
Important Terminology
Open Boundary and Closed
Boundary
• Open Boundary
• Uses strict inequality (e.g., x > 0).
• On point: x=0
• Makes boundary condition false.
• Off point must be inside the domain to make the
condition true: x=1.
• Closed Boundary
• Uses strict equality (e.g. y >= 1.0).
• On point: y=1.0
• Makes boundary condition true.
• Off point must be outside the domain to make the
condition false: y=0.999999.
Example-1 (x < 100)
Example-2 (x <= 100)
Steps
• 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. (On and Off values)
• 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.‘ (In Values)
Example
Domain Test Matrix
Detailed Example
• 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.
• As we discussed earlier there are two types of
partitioning:
• 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.
• 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 :
• Class 1: Children with age group 5 to 10
• Class 2 : Children with age group less than 5
• Class 3: Children with age group age 10 to 15
• Class 4: Children with age group greater than 15.
• The values picked up for testing should be Boundary values:
• 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.
• 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:
• Class 1: Children with age group 5 to 10 (Age >5 and <=10)
• Boundary values:
• Values should be Equal to or lesser than 10. Hence, age 10 should be
included in this class.
• Values should be greater than 5. Hence, age 5 should not be included in this
class.
• Values should be Equal to or lesser than 10. Hence, age 11 should not be
included in this class.
• 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 (OFF) Input age = 8 (IN)
Input age = 5 (ON)
Input age = 11 (OFF)
Input age = 10 (ON)

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


Input age = 5
Input age = 11
Input age = 10
Boy - Age >10 and <=15 Input age = 11 Input age = 13
Input age = 10
Input age = 15
Input age = 16
Girl - Age >10 and <=15 Input age = 11 Input age = 13
Input age = 10
Input age = 15
Input age = 16
Age<=5 Input age = 4 Input age = 3
Input age = 5
Age >15 Input age = 15 Input age = 25
Input age = 16
• 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.

You might also like