Softwaretesting Module4&5
Softwaretesting Module4&5
Input Space Partitioning (ISP) in black-box testing is a test design technique where the entire
range of possible inputs to a program is divided into smaller groups (partitions or classes).
Each partition contains inputs that are expected to be processed in the same way by the system.
Instead of testing every possible input, you select representative values from each partition.
Key Idea
If one value in a partition works (or fails), all values in that partition are likely to behave the
same way. So testing one or a few values from each partition is enough.
Example
Suppose a system accepts age values from 18 to 60.
Possible partitions:
Instead of testing every age from 0–100, we test a few representative values like 15, 30, and 65.
Types of Partitions
1. Valid partitions – Inputs that should be accepted.
2. Invalid partitions – Inputs that should be rejected or handled with errors.
Advantages
Reduces number of test cases
Improves test coverage efficiently
Helps detect input validation errors
Systematic way to design test cases
Related Techniques
Input Space Partitioning is closely related to:
Equivalence Partitioning
Boundary Value Analysis
Decision Table Testing
Input Domain Modeling (IDM) is a black-box test design technique used to systematically
identify and organize the input conditions of a program and then generate effective test cases
from them.
It focuses on analyzing the program’s input domain (all possible inputs) and modeling it so
testers can choose representative test cases that cover important scenarios.
Definition
Input Domain Modeling is the process of identifying input variables, their possible values,
and the relationships between them, and then dividing the input space into subdomains from
which test cases are selected.
Example
Consider a login system with inputs:
Username
Password
Benefits
Helps systematically design test cases
Ensures better coverage of input combinations
Reduces redundant tests
Detects input validation issues
Input Space Partitioning (ISP) in black-box testing is a test design technique where the entire
range of possible inputs to a program is divided into smaller groups (partitions or classes).
Each partition contains inputs that are expected to be processed in the same way by the system.
Instead of testing every possible input, you select representative values from each partition.
Key Idea
If one value in a partition works (or fails), all values in that partition are likely to behave the
same way. So testing one or a few values from each partition is enough.
Example
Suppose a system accepts age values from 18 to 60.
Possible partitions:
Instead of testing every age from 0–100, we test a few representative values like 15, 30, and 65.
Types of Partitions
1. Valid partitions – Inputs that should be accepted.
2. Invalid partitions – Inputs that should be rejected or handled with errors.
Advantages
Reduces number of test cases
Improves test coverage efficiently
Helps detect input validation errors
Systematic way to design test cases
Related Techniques
Input Space Partitioning is closely related to:
Equivalence Partitioning
Boundary Value Analysis
Decision Table Testing
The tester studies what the system is supposed to do and creates test cases to verify whether the
functionality works correctly.
Definition
Functionality-Based Approach is a method in black-box testing where the input domain is
modeled according to the system’s functional requirements, and test cases are designed to
verify each function.
Example
Consider an ATM withdrawal function.
Functional requirements:
Scenario Description
Valid transaction Correct PIN + sufficient balance
Invalid PIN Wrong PIN entered
Insufficient balance Amount greater than account balance
Exceed daily limit Withdrawal beyond daily limit
Each scenario represents a functional partition, and test cases are created for them.
Characteristics
Based on system behavior and requirements
Focuses on what the system should do
Covers functional scenarios
Advantages
Ensures all system functions are tested
Helps identify missing or incorrect functionality
Works well for requirement-based testing
Identifying Values in software testing (black-box testing) refers to the process of selecting
specific input values from each partition of the input domain to create effective test cases.
After dividing inputs using techniques like Input Space Partitioning or Input Domain
Modeling, testers must choose representative values to test the system.
Definition
Identifying values is the process of selecting specific test inputs from each input partition to
verify whether the software behaves correctly.
Example
Suppose a system accepts marks from 0 to 100.
Input partitions
Partition Range
Invalid Marks < 0
Valid 0 – 100
Invalid Marks > 100
Identified values
Here, -5, 50, and 120 are the identified test values.
Types of Values Often Selected
1. Typical values – Normal values within the partition
2. Boundary values – Values at the limits of the range
3. Invalid values – Values outside the valid range
4. Special values – Empty, null, or extreme inputs
Importance
Ensures proper test coverage
Helps detect edge-case errors
Reduces number of unnecessary tests
Improves test effectiveness
All Combinations Coverage in software testing is a test design strategy where test cases are
created to cover every possible combination of input values for all input parameters.
It ensures that the software is tested for every possible interaction between input variables.
Definition
All Combinations Coverage is a testing technique in which every possible combination of
input parameter values is tested at least once.
How it Works
1. Identify input parameters.
2. Determine possible values for each parameter.
3. Generate test cases that include all combinations of these values.
Example
Suppose a system has two inputs:
Browser: Chrome, Firefox
Operating System: Windows, Linux
Possible combinations
Formula
If there are:
n parameters
each with m possible values
Example:
3 parameters with values (2, 3, 2)
Advantages
Provides maximum coverage
Detects interaction faults between inputs
Ensures thorough testing
Disadvantages
Number of test cases grows rapidly with more inputs
Can become time-consuming and expensive
When Used
Systems with small number of input parameters
Critical systems where complete coverage is required
Configuration testing
Unlike All Combinations Coverage, it does not test every combination. It only ensures that
each individual value appears in at least one test case.
Definition
Each Choice Coverage is a test coverage criterion in which every possible value for each
input parameter must appear in at least one test case.
Example
Suppose a system has two inputs:
Coverage
Advantages
Simple and easy to apply
Requires fewer test cases
Provides basic input coverage
Limitation
May miss interaction errors between inputs.
Pairwise Coverage (also called 2-way testing) is a black-box testing technique where test
cases are designed so that every possible pair of input parameter values appears in at least
one test case.
The idea is that most software faults occur due to interactions between two parameters, so
testing all pairs provides good coverage while keeping the number of test cases manageable.
Definition
Pairwise Coverage is a testing technique in which all possible combinations of every pair of
input parameters are covered by the test cases.
Example
Suppose a system has three inputs:
These test cases ensure that every pair of parameter values (Browser–OS, Browser–Network,
OS–Network) appears at least once.
Example:
Advantages
Reduces number of test cases
Covers interaction between two parameters
More efficient than all combinations coverage
Limitations
May miss defects caused by interaction of three or more parameters
Not suitable for very critical systems where full coverage is required
T-wise Coverage (or t-way testing) in software testing is a generalization of pairwise testing
where test cases are designed so that every possible combination of any t input parameters
appears at least once in the test suite.
Definition
T-wise Coverage is a testing technique in which all combinations of values for any t
parameters are included in at least one test case.
Example
Suppose a system has three parameters:
If t = 2 (pairwise)
Every pair of parameters must appear together in at least one test case.
If t = 3 (3-wise)
Advantages
Detects interaction faults among multiple parameters
More thorough than pairwise testing
Flexible depending on value of t
Limitations
As t increases, number of test cases grows rapidly
Higher time and cost
This helps test the effect of changing one input while others remain constant.
Definition
Base Choice Coverage is a test coverage criterion in which a base value is chosen for each
input parameter, and test cases are generated by varying one parameter at a time while
keeping the others fixed at their base values.
Example
Suppose a system has three inputs:
Base values
Browser → Chrome
OS → Windows
Network → WiFi
Test cases
Each test case changes only one parameter from the base value.
Advantages
Requires few test cases
Easy to design and understand
Helps identify effect of individual input changes
Limitations
Does not cover all parameter interactions
May miss complex interaction faults
This approach increases coverage compared to the simple base choice method and is useful
when inputs have multiple representative values.
Definition
Multiple Base Choice Coverage is a test design technique in which more than one base value
is chosen for each input parameter, and test cases are created by varying one parameter at a
time while keeping the others fixed at one of their base values.
Steps
1. Identify input parameters
2. Select multiple base values for each parameter
3. Create all base combinations
4. Generate test cases by changing one parameter value at a time in each base combination
Example
Suppose a system has two inputs:
Base combinations:
1. Chrome + Windows
2. Chrome + Linux
3. Firefox + Windows
4. Firefox + Linux
Test cases (varying one parameter at a time for each base combination)
Here, each base combination is tested by changing one parameter at a time, giving better
coverage than single base choice.
Advantages
More thorough coverage than single base choice
Detects interaction faults missed by simple base choice
Still smaller number of test cases than all combinations
Limitations
Number of test cases increases with more base values
May still miss some higher-order interactions
Comparison
Technique Coverage Test Case Size
Base Choice One base value per parameter Small
Multiple Base Choice Multiple base values per parameter Moderate
All Combinations Every possible value combination Large
Try-Typical Testing is a black-box testing technique where test cases are chosen using typical
or normal input values that a user would commonly provide, rather than boundary or extreme
values. It focuses on expected system behavior under normal conditions.
Example Scenario
System: A student grading system accepts marks from 0 to 100 and assigns grades:
90–100 → A
80–89 → B
70–79 → C
60–69 → D
0–59 → F
Marks: 0 to 100
Step 2: Choose typical values
Instead of testing every value or boundaries, select normal, representative values from
each grade range.
Here, the test values are normal, representative values within each partition, which is exactly
what Try-Typical Testing does.
Advantages
Quick and easy to design
Covers usual expected input scenarios
Good for early or sanity testing
Limitations
Does not cover boundary or invalid inputs
May miss rare or edge-case defects
Functional Testing is a type of software testing that focuses on verifying the functions of a
system against its requirements. It checks what the system does, not how it does it internally.
Definition
Functional Testing is a testing technique where the functionality of the software is tested by
providing inputs and verifying that the outputs match the expected results according to the
specifications or requirements.
Key Characteristics
Black-box testing approach – Does not require knowledge of internal code.
Requirement-based – Tests are derived from functional specifications.
Validates features – Checks if each function works correctly.
Example
Consider an ATM system with the following functionality:
Advantages
Confirms the system meets business requirements
Detects functional errors early
Can be automated for repetitive tests
Limitations
Does not test non-functional aspects like performance, security, or usability
Cannot detect issues in the internal code logic
Howden’s approach suggests four key ideas for systematic functional test design:
Where:
This framing helps testers take a rigorous, mathematics-inspired view of input and output
behavior.
🧪 Example (Simplified)
Imagine a calculator function F(a, b):
1. Understand Requirements
7. Compare Results
8. Report Defects
9. Regression Testing
After fixing defects, re-run functional tests to ensure no new issues are introduced.
Summary Table
Step Description
1 Understand requirements
2 Identify functions to test
3 Determine input data
4 Define expected output
5 Design test cases
6 Execute test cases
7 Compare actual vs expected
8 Report defects
9 Regression testing
1. Unit Testing
3. System Testing
4. Smoke Testing
5. Sanity Testing
Performed after minor changes or bug fixes to ensure the related functionality works
correctly.
Narrow and focused testing.
Example: After fixing a payment gateway bug, testing only the payment process.
6. Acceptance Testing
Verifies that UI elements work correctly and trigger the expected functions.
Example: Clicking a submit button actually saves data to the database.
9. End-to-End Testing
Verifies complete workflow from start to finish across modules and systems.
Example: User registers → selects products → places order → receives confirmation
email.
Summary Table
Type Purpose Example
Unit Testing Test individual modules Interest calculator function
Integration Testing Test module interactions Login + Dashboard
System Testing Test complete system E-commerce workflow
Smoke Testing Quick basic check App homepage loads
Sanity Testing Test after changes Payment gateway bug fix
Acceptance Testing Verify business requirements Payroll system by HR
Regression Testing Test unchanged features Login, search after updates
UI Functional Testing Verify UI triggers correct actions Submit button saves data
End-to-End Testing Verify full workflow User registration → purchase → email
Definition
Equivalence Class Partitioning is a black-box testing method that divides input data into
equivalence classes such that any one value from each class can represent all values in that
class for testing purposes.
Key Concepts
1. Equivalence Class – A set of input values that are treated similarly by the program and
are expected to produce the same result.
2. Valid Class – Contains input values that are valid according to requirements.
3. Invalid Class – Contains input values that are invalid and should be rejected or handled
with errors.
Example
Suppose a system accepts age from 18 to 60.
Age: 0–120
Here, one value from each class is enough to test the behavior of the system.
Advantages
Reduces number of test cases significantly
Improves test coverage efficiency
Helps detect input validation errors
Limitations
May miss boundary errors (needs Boundary Value Analysis for that)
Only works well when classes are properly identified
Boundary Value Analysis (BVA) is a key black-box testing technique that focuses on testing
the edges or boundaries of input ranges, where errors are most likely to occur. It is often used
along with Equivalence Class Partitioning to improve coverage.
Definition
Boundary Value Analysis is a black-box testing technique where test cases are designed to
include values at the boundaries of equivalence classes, as errors often occur at the minimum,
maximum, just above, and just below boundary values.
Key Concepts
Boundaries are critical points in input ranges where the program might fail.
Test both valid and invalid boundary values.
Helps detect off-by-one errors and other boundary-related defects.
Example
Suppose a system accepts age between 18 and 60.
Minimum valid: 18
Maximum valid: 60
Invalid boundaries: 17, 61
Advantages
Detects boundary-related defects effectively
More efficient than testing all values
Complements Equivalence Class Partitioning
Limitations
Only works well if boundaries are properly defined
Does not guarantee all internal logic errors are found
Decision Tables are a powerful black-box testing technique used to represent and analyze
complex combinations of inputs (conditions) and their corresponding outputs (actions).
They help systematically design test cases when the system has multiple conditions affecting
behavior.
Definition
A Decision Table is a tabular representation of conditions and their corresponding actions. It
is used to derive test cases by enumerating all possible combinations of input conditions and
expected outputs.
Key Concepts
1. Condition – A specific input or state that affects system behavior.
2. Action – The system’s response corresponding to a set of conditions.
3. Rule – A column in the decision table that represents one unique combination of
conditions and its resulting action.
Example
Scenario: Login system with two conditions:
Actions:
Grant access
Deny access
Decision Table:
Advantages
Ensures all combinations of conditions are tested
Useful for complex business rules
Easy to understand and communicate with stakeholders
Limitations
Can become very large if there are many conditions (combinatorial explosion)
Requires careful analysis to avoid redundant rules
Random Testing is a black-box testing technique in software testing where test inputs are
generated randomly from the input domain, without considering any specific conditions,
partitions, or boundaries. It is mainly used to check the system’s behavior under unexpected or
arbitrary inputs.
Definition
Random Testing is a software testing technique in which inputs are randomly selected from
the input domain to test the system for correctness, robustness, and reliability.
Key Concepts
1. Black-box approach – No knowledge of internal code is required.
2. Input domain – All possible valid and invalid inputs are considered.
3. Random selection – Test cases are not systematic; they rely on randomness to uncover
defects.
Example
Suppose a program accepts age between 1 and 100:
Here, test cases are not planned; they are randomly generated to check system behavior.
Advantages
Simple and easy to implement
Can uncover unexpected defects that systematic testing may miss
Useful when input domain is large or complex
Limitations
May not cover all important cases
Can miss boundary cases or rare conditions
Effectiveness depends on number of random inputs
Module-5
Grey Box Testing is a software testing technique that combines elements of both black-box
and white-box testing. It tests the application with partial knowledge of the internal
structure while focusing on functional behavior.
Definition
Grey Box Testing is a technique where the tester has limited knowledge of the internal code
or architecture and tests the system primarily from the user’s perspective, while also
considering internal logic to design effective test cases.
Key Concepts
1. Partial knowledge – Testers know some internal details, like data structures, algorithms,
or architecture, but not the full code.
2. Combination approach – Leverages functional (black-box) and structural (white-
box) testing.
3. Focus areas – Inputs, outputs, data flow, and internal interfaces.
Advantages
Detects defects related to both functionality and internal logic
More effective than pure black-box testing
Can identify security issues, data flow problems, and interface errors
Limitations
Requires testers with some programming or system knowledge
May not detect all low-level code defects
Can be more time-consuming than black-box testing
When to Use
Testing web applications, APIs, or complex systems
Security and penetration testing
Integration testing where internal module interaction matters
Example
Suppose a web application allows users to log in:
Tester knows the database schema partially (user table, password hash)
Tester checks for:
o Correct login behavior (black-box)
o SQL injection vulnerabilities (grey-box, using partial internal knowledge)
Here, the tester doesn’t see the full source code but uses internal knowledge to design better test
cases.
Grey Box Testing Methodology
Grey Box Testing is a hybrid approach that combines aspects of black-box (functional) and
white-box (structural) testing. The methodology provides a structured way to plan, design, and
execute tests with partial knowledge of the internal system.
After defect fixes, re-run test cases to ensure no new defects are introduced.
Adjust tests as the system evolves.
Advantages
Limitations
Example
1. Black-box aspect: Verify correct login and error messages for invalid credentials.
2. Grey-box aspect: Use knowledge of database schema and authentication flow to test
for SQL injection or bypass attempts.
Matrix Testing is a black-box testing technique used to systematically test relationships
between inputs and outputs of a system. It is especially useful when the system has multiple
inputs and corresponding outputs, and you want to ensure all combinations are tested.
Definition
Matrix Testing is a method of black-box testing in which test cases are designed using a table
(matrix) that maps all possible input conditions to their expected outputs. It helps ensure
complete coverage of input-output relationships.
Key Concepts
1. Input conditions – The different input values or categories that affect system behavior.
2. Expected outputs – The corresponding system responses for each input combination.
3. Matrix representation – A table showing inputs vs outputs to design test cases.
Example
Scenario: Login system with two inputs:
Matrix Representation:
Username Valid Password Valid Expected Output
Yes Yes Grant Access
Yes No Deny Access
No Yes Deny Access
No No Deny Access
Here, each row is a test case, covering all input-output relationships systematically.
Advantages
Ensures systematic coverage of all input-output combinations
Helps detect errors caused by specific input interactions
Easy to visualize and communicate test cases
Limitations
Can become very large for many input parameters
May be time-consuming for complex systems
Regression Testing in black-box testing is a method used to ensure that new changes,
enhancements, or bug fixes in the software do not introduce new defects into existing
functionality. It focuses on testing the software’s behavior rather than its internal code.
Definition
Regression Testing is a type of software testing where previously executed test cases are re-
executed to verify that recent changes have not adversely affected existing functionality.
Key Concepts
1. Black-box approach – Tests are based on functional requirements rather than internal
code.
2. Re-execution of test cases – Existing test cases for previously tested functionality are
reused.
3. Change impact – Focuses on areas affected by new code or updates.
Example
Scenario: E-commerce website adds a new “discount coupon” feature.
Here, existing functionalities are retested to ensure nothing broke due to the new feature.
Advantages
Detects side-effects of code changes
Ensures software stability after updates
Can be automated for frequent regression testing
Limitations
Can be time-consuming if the test suite is large
Needs maintenance of test cases to reflect changes in requirements
Orthogonal Array Testing (OAT) is a systematic black-box testing technique used to test all
possible combinations of input parameters efficiently. It is especially useful when a system
has multiple inputs with multiple possible values, and exhaustive testing would be impractical.
Definition
Orthogonal Array Testing is a software testing technique that uses orthogonal arrays
(mathematical tables) to design a minimal set of test cases covering all pairwise or higher-
order interactions of input parameters.
Key Concepts
1. Input parameters – The factors or fields that affect system behavior.
2. Levels – The possible values each parameter can take.
3. Orthogonal array – A table that ensures every pair of parameter values appears at
least once in the selected test cases.
4. Efficient coverage – Reduces the number of test cases while covering critical
combinations.
Example
Scenario: Test a login system with three parameters:
Parameter Levels
Browser Chrome, Firefox, Edge
OS Windows, Linux
Parameter Levels
Network WiFi, Mobile
Advantages
Reduces the number of test cases significantly
Ensures pairwise or higher-order coverage
Systematic and mathematically sound
Limitations
Complex to set up for large number of parameters
Only detects interaction faults up to the level of the array (may miss higher-order
defects)
Requires knowledge of orthogonal arrays and mapping
Pattern Testing is a black-box software testing technique used to detect defects by checking
the software against typical input patterns, sequences, or usage scenarios. It focuses on
repeated structures or common sequences that are likely to reveal faults in the system.
Definition
Pattern Testing is a software testing method where test cases are designed using specific
input patterns or sequences that represent realistic or frequently occurring scenarios, to
uncover defects that occur under predictable or repetitive conditions.
Key Concepts
1. Patterns – Typical input values, sequences, or workflows commonly used by end users.
2. Focus on repetition – Tests how the system behaves with frequent, recurring inputs.
3. Black-box approach – Does not require internal code knowledge; focuses on observable
behavior.
Example
Scenario: Testing a text input field in a form:
Limitations
Does not guarantee full coverage of all input combinations
May miss edge cases or rare inputs
Highly dependent on correctly identifying typical patterns
PEX (Program EXploration) can also be applied in Grey Box Testing to systematically
generate test cases by using partial knowledge of the internal system along with observable
behavior. It combines the functional perspective of black-box testing with limited structural
insights from white-box testing, making it very effective for complex systems.
Definition
PEX in Grey Box Testing is an automated testing approach where inputs are generated
systematically to explore program behavior, using partial internal knowledge (e.g., data
structures, function contracts, or APIs) while still observing outputs as a black-box tester.
Key Concepts
1. Partial System Knowledge – Unlike pure black-box PEX, the tester has some insight
into the system’s logic or structure.
2. Symbolic or Generated Inputs – Inputs are generated to explore different execution
paths or boundary conditions.
3. Test Coverage – Focuses on critical paths, data flow, or API behavior informed by
partial system knowledge.
4. Observation-Based Validation – Outputs are checked against expected results or
specifications.
Steps in PEX Grey Box Testing
1. Identify Inputs and API Interfaces – Determine parameters or modules to test.
2. Apply Partial Knowledge – Use known constraints or data flow to guide input
generation.
3. Generate Test Inputs – Systematically create symbolic or concrete inputs covering
important paths.
4. Execute Program – Run the program with generated inputs.
5. Observe Outputs – Compare actual outputs with expected results.
6. Analyze Defects – Record failures related to functional behavior or internal constraints.
Example
Scenario: Testing a banking API function for fund transfer:
Known constraints:
o Transfer amount ≤ account balance
o Accounts must exist in the system
PEX generates inputs based on:
o Transfer amounts at boundary and typical values (0, balance, > balance)
o Account numbers from database and random invalid values
Test outputs:
o Transfer success for valid inputs
o Transfer failure or error messages for invalid inputs
Here, partial knowledge of account rules and system constraints guides input generation,
improving test effectiveness.
Advantages
Automates test case generation for complex systems
Uses partial internal knowledge to focus on critical areas
Detects both functional and constraint-related defects
Limitations
Requires understanding of system constraints or architecture
May produce many test cases, requiring careful selection
Not fully black-box, so some internal logic errors could still be missed
Problem: Designing test cases is more complex than pure black-box or white-box
testing.
Effect: Requires careful selection of functional tests plus targeted internal tests.
Example: Testing database transactions may require combining interface inputs with
knowledge of internal queries.
Problem: Grey box testing often involves both functional and structural aspects,
making it harder to prioritize.
Effect: Risk of overlooking critical paths or wasting resources on low-risk areas.
Example: API testing with partial code knowledge may miss critical data flow paths if
test coverage is not planned well.
4. Tool Dependency
Problem: Grey box testing often requires specialized tools for logging, code inspection,
or monitoring internal state.
Effect: Test effectiveness depends on tool availability and accuracy.
Example: Tools for inspecting database access patterns or system logs may not be
available for all systems.
5. Time-Consuming
Problem: Grey box testing primarily targets functional and internal data flow aspects.
Effect: Non-functional requirements like performance, scalability, or usability may be
insufficiently tested.
Summary Table
Definition
Pattern Unit Testing is a software testing technique where individual units or modules are
tested using predefined patterns of inputs and outputs to detect defects caused by common
usage or repeated sequences.
Key Concepts
1. Unit Testing Focus – Tests small modules or functions independently.
2. Pattern-Based Inputs – Uses typical sequences, repeated data, or structured
patterns to design test cases.
3. Defect Detection – Helps detect errors that occur with repeated or structured inputs
that may not appear in random testing.
Pattern inputs:
o All uppercase letters → "HELLO"
o All lowercase letters → "hello"
o Repeated characters → "aaaa"
o Mixed case → "HeLLo"
Expected outputs:
o "HELLO" → "OLLEH"
o "hello" → "olleh"
o "aaaa" → "aaaa"
o "HeLLo" → "oLLeH"
This ensures the unit behaves correctly for common and repetitive patterns.
Advantages
Detects defects related to typical and repetitive inputs
Complements other unit testing techniques (random, boundary, or equivalence class
testing)
Useful for modules with predictable or structured input behavior
Limitations
May not detect rare or exceptional inputs
Focused on patterned behavior, so coverage may be incomplete
Requires good understanding of input patterns
Symbolic Execution in Grey Box Testing is a technique where inputs are treated as symbolic
variables, and partial knowledge of the system’s internal structure is used to explore
program behavior, generate test cases, and detect defects.
Key Concepts
1. Symbolic Inputs – Inputs are represented as symbols instead of concrete values.
2. Constraints – Partial knowledge of system logic is used to formulate constraints that
must hold for different execution paths.
3. Path Exploration – Different paths in the program are explored based on symbolic input
constraints.
4. Test Case Generation – Concrete inputs are generated by solving constraints to cover
important scenarios.
5. Observation-Based Validation – Output is checked against expected results.
Example
Scenario: Bank transfer function
Input: amount (symbolic a), balance (symbolic b)
Partial knowledge:
o Transfer allowed if a <= b
o Amount must be > 0
Path constraints:
o Path 1: a > 0 && a <= b → Success
o Path 2: a <= 0 || a > b → Failure
Solve constraints to generate concrete test cases:
o a = 50, b = 100 → Success
o a = 150, b = 100 → Failure
o a = -10, b = 100 → Failure
Here, partial knowledge of business rules guides the test, making it more effective than pure
black-box symbolic execution.
Advantages
Systematically generates test cases for critical paths
Detects defects in both functional behavior and partial internal logic
Reduces redundant tests compared to random testing
Limitations
Requires some understanding of system rules or architecture
Can become complex for large systems with many constraints
May miss errors unrelated to known constraints
A Symbolic Execution Tree (SET) in grey box testing is a graphical representation of all
possible execution paths in a program, based on symbolic inputs and partial knowledge of the
system’s internal logic.
This helps testers systematically explore paths using partial internal knowledge while focusing
on functional correctness.
Key Concepts
1. Symbolic Inputs – Variables represented symbolically instead of concrete values.
2. Path Constraints – Conditions that must be satisfied for execution to follow a particular
path.
3. Nodes – Represent program statements, decision points, or states.
4. Edges – Represent branching conditions (true/false).
5. Leaves – Represent outputs or program termination points.
Example
Program snippet:
if x > 0:
if y < 5:
output = "A"
else:
output = "B"
else:
output = "C"
Start
|
[x > 0?]
/ \
Yes No
/ \
[y < 5?] output = "C"
/ \
Yes No
/A/ /B/
Path Constraints & Test Cases:
o Path 1: x > 0 and y < 5 → Output A → Test: x=1, y=0
o Path 2: x > 0 and y >= 5 → Output B → Test: x=2, y=5
o Path 3: x <= 0 → Output C → Test: x=-1, y=any
Advantages
Provides systematic coverage of program paths
Helps detect defects in both functional behavior and partially known internal logic
Useful for critical systems and boundary testing
Limitations
Can grow exponentially for complex programs
Requires partial knowledge of internal logic
Constraint solving may be computationally expensive
2. Boundary Testing
4. Regression Testing
Helps test interactions between modules or APIs by generating input sequences that
cover different scenarios.
Can be used in grey-box testing to focus on critical data flow paths.
Limitations