Unit-3 notes
Unit-3 notes
Domain Testing: domains and paths, Nice & ugly domains, domain testing
domains and interfaces Testing, domain and interface testing, domains and
testability.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Example: For an input range of 1-100, test values: 0, 1, 2, 99, 100, 101.
***********************************************************************************************
1
Domains and Paths in Software Testing
In Domain Testing, the focus is on identifying input domains and testing
representative values within them. Paths, on the other hand, relate to the flow of
execution in the system and are analysed in Path Testing. Below, I explain both
concepts in detail.
1. Domains in Testing
A domain in software testing refers to the set of possible inputs for a given program or
function. Testing different domains ensures that the system handles all valid and
invalid inputs correctly.
Types of Domains:
1. Numeric Domains – Inputs are numbers, e.g., age (1-100).
2. Character/String Domains – Inputs are text, e.g., names, passwords.
3. Boolean Domains – Inputs have two values (True/False, Yes/No).
4. Enumerated Domains – Inputs belong to a fixed set, e.g., weekdays (Monday-
Sunday).
5. Structured Domains – Inputs have a complex structure, e.g., dates
(DD/MM/YYYY).
Domain Testing Techniques:
Equivalence Partitioning: Divides input values into valid and invalid sets.
Boundary Value Analysis: Tests values at the edges of domains.
Domain Coverage Testing: Ensures all input domains are covered.
2. Paths in Testing
A path in software testing refers to a sequence of statements or decisions executed
during program execution. Path Testing is a white-box testing technique that ensures
all possible execution paths are tested.
Key Concepts of Path Testing:
1. Control Flow Graph (CFG): Represents the program's flow using nodes
(statements) and edges (transitions).
2. Decision Points: Conditions (e.g., if, while) that determine different execution
paths.
3. Independent Paths: Unique paths that introduce new control flow in the
program.
4. Cyclomatic Complexity: Measures the number of independent paths in a
program. It is calculated as:
V(G)=E−N+2PV(G) = E - N + 2P
Where:
o EE = Number of edges in the graph
o NN = Number of nodes
o PP = Number of connected components
Types of Path Coverage:
Statement Coverage: Ensures each line of code is executed at least once.
Branch Coverage: Ensures all decision outcomes (True/False) are tested.
Path Coverage: Ensures all possible execution paths are tested.
Example of Path Testing:
Consider the following code:
if (x > 0):
print("Positive")
else:
print("Negative or Zero")
Paths:
o Path 1: x > 0 → "Positive"
o Path 2: x <= 0 → "Negative or Zero"
To achieve complete path coverage, test cases should include x = 5 (positive) and x =
-3 (negative).
2
Difference Between Domain and Path Testing
Feature Domain Testing Path Testing
Focus Input values and their validity Execution paths in the program
Testing Type Black-box testing White-box testing
Techniques Equivalence Partitioning, Control Flow Graph, Cyclomatic
Used Boundary Value Analysis Complexity
Ensure the system handles all Ensure all execution paths are
Goal
input domains correctly covered
1. Nice Domains
A Nice Domain consists of input values that behave predictably and do not cause
errors in the system. These inputs fall within the expected range and are processed
correctly by the software.
Characteristics of Nice Domains:
✔ Inputs produce expected and valid outputs.
✔ No unusual edge cases or system-breaking values.
✔ Values are within a well-defined, smooth range.
✔ No sudden changes or discontinuities in behaviour.
Example of a Nice Domain:
A system that accepts ages from 18 to 60:
o Valid inputs: 20, 30, 45, 59
o All these values are within the expected range and cause no issues.
2. Ugly Domains
An Ugly Domain consists of input values that can cause errors, unexpected behavior,
or crashes in the system. These values often occur at boundaries, involve special
cases, or exploit system weaknesses.
Characteristics of Ugly Domains:
❌Inputs that cause crashes, errors, or unpredictable results.
❌Values near boundaries or transition points.
❌Sudden jumps in system behavior (e.g., rounding errors, integer overflows).
❌Special cases like null values, empty strings, and non-standard formats.
Example of an Ugly Domain:
Age Input (18 to 60):
o Boundary cases: 17, 60, 61 (values close to the limit)
o Invalid cases: -5, 150, "abc" (out-of-range values, incorrect data types)
o Edge cases: 18.5 (if system expects integers, this might break it)
3
Domain Testing, Domains, and Interface Testing
Domain Testing is a black-box testing technique used to verify how a system handles
different sets of input values (domains). The goal is to test representative values from
input domains and ensure correct system behaviour.
A domain in testing refers to the set of all possible inputs that a function, system, or
component can accept.
Types of Domains:
Types of Interfaces:
1. User Interface (UI) – Interaction between users and software (e.g., web forms).
2. Application Programming Interface (API) – Communication between different
software components (e.g., REST, SOAP).
3. Hardware Interfaces – Interaction between software and hardware (e.g., USB,
Bluetooth).
4. Database Interfaces – Communication between an application and a database
(SQL queries).
4
4. Relationship Between Domain Testing and Interface Testing
Feature Domain Testing Interface Testing
Focus Input values and system behaviour Communication between components
Scope Individual functions/modules Data exchange between systems
Techniques Equivalence Partitioning, BVA API Testing, Security Testing
Goal Ensure correct processing of inputs Ensure smooth integration
Conclusion
Domain Testing ensures individual components handle different inputs
correctly.
Interface Testing ensures seamless data communication between components.
Both are essential for robust software testing.
In software testing, domains represent the set of possible inputs for a system, while
testability refers to how easily and effectively a system can be tested. Understanding
domains helps improve testability by ensuring systematic coverage of inputs and
identifying potential problem areas.
1. Domains in Testing
A domain is the range of possible inputs a software component can accept. The
effectiveness of domain testing depends on how well these domains are defined and
analysed.
Types of Domains
Domain Type Example Testing Challenges
Finite Numeric Age (1-100) Boundary values (e.g., 0, 101)
Infinite Numeric Temperature (-∞ to +∞) Impossible to test all values
Boolean IsAdmin (True/False) Limited test cases
String/Text Username, Password Special characters, empty strings
Enumerated Days of the week (Mon-Sun) Handling unexpected values
Structured Date (DD/MM/YYYY) Leap years, invalid formats
5
Domain Testing Techniques
✔ Equivalence Partitioning – Grouping inputs into valid and invalid classes.
✔ Boundary Value Analysis (BVA) – Testing at the limits of valid ranges.
✔ Decision Table Testing – Analyzing input conditions and outputs systematically.
Conclusion
Well-defined domains make software easier to test.
Testability improvements reduce testing effort and increase defect detection.
Applying domain testing techniques enhances test coverage and reliability.