
7.4 Nice Domains and Ugly Domains

In the following sections we discuss the concepts of set theory that would be of great use in domain testing.

In domain testing, nice domains are prerequisite in order to ensure achievable paths. However defining nice domain is not so easy. Many bugs that have origin in requirement specifications , architecture, design or program specifications are because of ill defined domains.

7.4.1 Nice Domains

Nice domains have well defined domain boundaries. This would help in providing right inputs so as to ensure achievable paths.

Nice domains have well defined boundaries that satisfy several important properties. Nice boundaries are linear, complete, systematic, orthogonal, consistently closed, connected and convex. Better is the fulfillment of these properties, superior will be the domain testing. Also bug frequencies are lower for nice domains. Following are the meanings of properties of nice domains.


Linear Boundaries: A linear boundary is defined as a relational expression that is having a linear inequality where a relational expressions are having operands which are connected using relations like >, > =, =, < =, < > or <. Linear domain boundaries when interpreted in terms of input variables exhibit linear inequalities or equations. As such, if linear equation is representing  a straight line then we can provide only two test inputs; a plane then three test inputs etc. Thus to test ndimensional hyperplane we need to provide n+1 test inputs. In software, most of boundary predicates are directly linear with >, > =, =, < =, < > or < operators in them. As such, test inputs for testing ndimensional boundaries require n+1 test inputs.

Complete Boundaries: Complete boundaries have well defined number spaces that are constrained by a clear upper bound value and lower bound value with a set of numbers in that boundary with no discontinuity. When any input value is picked from a complete boundary and is supplied to a program, there will be a predicate path corresponding to this input value which is getting executed and also achievable. In domain testing this property of complete boundaries is very effective since it allows us to select one set of input values in order to test the execution of corresponding path segment in the program and also to verify whether that path segment is achievable. If the boundary has values in the number space that corresponds to different segments, then the boundary must be split into many domains in such a manner that each such domain belongs to a specific segment. While testing a set of input values for each domain shall be picked, supplied and corresponding predicate segment shall be executed. In domain testing two considerations related to input values from a given boundary play very important role in verifying the behavior of program – 1) The behavior of the program and the output produced by the program after the input values within the given boundary are supplied; and 2) The behavior of the program and the output produced by the program after the input values outside the given boundary are supplied.

Systematic Boundaries: Systematic Boundaries consist of a set of boundaries where one boundary is inequal to another boundary by a simple function such as a constant. For example consider a linear function represented as
fi(X) >= h(i,k)
For i = 1, 2, 3, 4, we get following systematically spaced four parallel lines represented by:
f1(X) >= h(1,k)
f2(X) >= h(2,k)
f3(X) >= h(3,k)
f4(X) >= h(4,k)
If we identify test inputs values for any one of the above four lines, the same input values can be used for testing remaining three lines.

Orthogonal Boundaries: If P and Q are boundary set in such way that every inequality in Q is perpendicular to every inequality in P then P and Q boundaries sets are termed as orthogonal. When we find any boundary set as orthogonal then each of those boundary sets shall be tested independently.

Closure Consistency: For the boundaries that are parallel, if the closure of one boundary is differing from closure of another boundaries and pattern of such a difference is simple then we say that there is closure consistency among these parallel boundaries.

Convex: Nice domains are convex. For example consider two different boundaries. Take two arbitrary points on each of them and join those two points by a line. If you notice that all the points on the two boundaries and also all points on the line drawn fall within the figure then that figure is termed as Convex.

Simply Connected: Nice domains are simply connected which means that all the points belonging to that domain are in one partition rather than spread across many partitions.






Khannur's Book 

Arunkumar Khannur, Software Testing  Techniques and Applications,
Published by Pearson Publications, 2011
(ISBN:9788131758366; Pages:341 + xxii) 
Follow Khannur 

Khannur's Company 

ISQT Process & Consulting Services Pvt. Ltd., Bangalore, INDIA

Khannur's Software Testing Forum 

STEPAUTO Forum

Contact Khannur 
ISQT Process & Consulting Services Pvt. Ltd.
#732, 1st Floor, 12th Main,
3rd Block,
Rajajinagar,
Bangalore  560010, INDIA
Phone: +91 80 23012511
URL: www.isqtinternational.com
Email: khannur@isqtinternational.com
Skype: arun.isqt 
