Coursify

SOFTWARE ENGINEERING

Functional Testing Techniques

Covers black-box testing approaches for validating software behavior against specifications using boundary values, equivalence partitions, decision logic, and cause-effect relationships.

Learning Goals

  • Apply boundary value analysis to derive test cases for valid, invalid, minimum, maximum, and near-boundary input conditions.
  • Partition input domains using equivalence class testing and select representative test cases from each class.
  • Construct decision tables for systems with multiple conditions and actions, and derive corresponding test scenarios.
  • Develop cause-effect graphs to model logical dependencies between inputs and outputs and convert them into test cases.
  • Compare boundary value analysis, equivalence class testing, decision table testing, and cause-effect graphing in terms of suitability for different problem types.

Black-Box Testing (also known as functional or specification-based testing) focuses entirely on the inputs and outputs of a software system . Rather than inspecting the internal source code, testers evaluate whether the software complies with its documented functional specifications .

In modern software development, testing every possible input is mathematically impossible due to the infinite variation of real-world data. For instance, a single 3232-bit integer input can accept over 44 billion distinct values, making exhaustive validation a logical impossibility.

To overcome this challenge, functional testing relies on systematic techniques to partition input domains, target critical edge-cases, and model complex combinations of business rules. This lesson covers four fundamental black-box testing approaches: Equivalence Partitioning, Boundary Value Analysis, Decision Table Testing, and Cause-Effect Graphing.

The following diagram illustrates the black-box testing paradigm, showing how specifications act as the single source of truth for generating expected outputs and verifying actual program behavior:

Footnotes

  1. Guru99 EP and BVA Tutorial - Detailed breakdown of equivalence partitions, boundary values, and practical test design.

  2. Ficode BVA & EP Testing - Exploration of black-box testing methodologies and range validation boundaries.

Boundary Value Analysis and Equivalence Partitioning: Software Testing Tutorial

Equivalence Partitioning (EP)

Equivalence Partitioning is a fundamental technique designed to reduce test redundancy . It operates on a simple premise: if one value in a class behaves correctly, all other values in that same class will behave similarly .

We divide the input domain of the program into distinct equivalence classes (also called partitions):

  1. Valid Equivalence Classes: Input values that represent legitimate, expected inputs that the program should process successfully.
  2. Invalid Equivalence Classes: Input values that represent erroneous or unexpected inputs that the program should reject or handle via error routines.

Equivalence Class Types

Partitions are defined based on specification criteria:

  • Range Boundaries: If a specification requires an input between 11 and 100100, we create three classes: x<1x < 1 (Invalid), 1x1001 \le x \le 100 (Valid), and x>100x > 100 (Invalid).
  • Enumerated Sets: If an input must be a specific payment type (e.g., Credit Card, PayPal, Direct Debit), we create valid classes for each member and an invalid class for any unrecognized payment method.
  • Boolean States: For a flag that is either True or False, we test both valid options.
  • Array Sizing: For a list that must contain between 11 and 1010 items, we establish classes for empty lists (Invalid), lists of size 1 to 101 \text{ to } 10 (Valid), and lists with >10> 10 items (Invalid).

Coverage Criteria

When executing equivalence class testing, the tester must decide on the level of combinations:

  • Weak Normal Testing: Tests one representative nominal value from each valid class. It assumes inputs are independent.
  • Strong Normal Testing: Evaluates all combinations of valid classes. It assumes inputs are interdependent and interact.
  • Weak Robust Testing: Focuses on invalid classes. It tests one invalid value at a time, along with valid nominal values for other inputs, to prevent masking of errors.
  • Strong Robust Testing: Tests every combination of valid and invalid classes. This leads to a larger, highly exhaustive test suite.

Boundary Value Analysis (BVA)

Boundary Value Analysis is a companion technique to Equivalence Partitioning . Experience shows that software errors are highly concentrated at the edges or boundaries of input ranges rather than in the center. Typical mistakes include off-by-one errors, such as a developer writing < instead of <= in a conditional loop .

While Equivalence Partitioning selects any representative from the middle of a class, BVA targets the exact values at the boundaries of these partitions and their immediate neighbors.

Footnotes

  1. Guru99 EP and BVA Tutorial - Detailed breakdown of equivalence partitions, boundary values, and practical test design.

  2. Ficode BVA & EP Testing - Exploration of black-box testing methodologies and range validation boundaries. 2

  3. TutorialsPoint Cause-Effect Graphing - Overview of Cause-Effect graphing syntax, boolean logic models, and mapping to decision tables.

Why Boundaries Fail

Off-by-one errors are among the most common bugs in software development. Programmers frequently write < instead of <=, or initialize loops at 00 instead of 11 . Designing test cases that target the exact boundary values and their immediate neighbors (+1,1+1, -1) is mathematically proven to discover these flaws with minimal effort.

Footnotes

  1. Ficode BVA & EP Testing - Exploration of black-box testing methodologies and range validation boundaries.

2-Value Boundary Value Analysis

2-Value BVA is the traditional industry standard for black-box range validation . For each boundary, it selects exactly two points:

  1. The boundary value itself.
  2. The point immediately adjacent to it on the opposite side of the boundary line.

For a valid range of [18,65][18, 65], the boundaries are 1818 and 6565. 2-Value BVA selects:

  • Lower Boundary (1818): 1818 (valid) and 1717 (invalid).
  • Upper Boundary (6565): 6565 (valid) and 6666 (invalid).
  • Nominal: A representative middle value (e.g., 41.541.5).

Total standard test cases: 55 points (1717, 1818, 41.541.5, 6565, 6666).

Suitability: Ideal for systems where specification transitions are simple and binary. It is highly efficient and minimizes test suite size.

Footnotes

  1. Guru99 EP and BVA Tutorial - Detailed breakdown of equivalence partitions, boundary values, and practical test design.

Decision Table Testing

While Equivalence Partitioning and Boundary Value Analysis are excellent for isolated, independent inputs, they fail when multiple inputs interact to produce different behaviors . Decision Table testing resolves this by modeling complex business logic based on combinations of conditions.

A decision table is structured into four quadrants:

  1. Condition Stub: Lists all input conditions or variables.
  2. Action Stub: Lists all possible system actions or outputs.
  3. Condition Entries: Indicates the states (True/False/Don't Care) of each condition for a rule.
  4. Action Entries: Marks which actions are executed for each rule.

E-Commerce Case Study

Consider an online store with the following business rules:

  • VIP customers get a 15%15\% discount.
  • Orders over \100receiveareceive a10%$ bulk discount and free shipping.
  • Customers with a valid coupon code get a 5%5\% discount.
  • VIP and coupon discounts can stack, but the bulk discount cannot stack with others (if bulk is applied, VIP and coupon discounts are inactive).

The table below lists all possible logical combinations (rules) and their corresponding outcomes:

Condition / ActionRule 1Rule 2Rule 3Rule 4Rule 5Rule 6Rule 7Rule 8
Is VIP Customer?YYYYNNNN
Order Value > \100$?YYNNYYNN
Has Coupon Code?YNYNYNYN
Apply VIP Discount (15%15\%)XX
Apply Bulk Discount (10%10\%)XXXX
Apply Coupon Discount (5%5\%)XXX
Free ShippingXXXX

Note: In Rules 1 and 2, even though the customer is a VIP, the Order Value > \100triggersthetriggers the$10%$ bulk discount, which overrides the VIP discount due to the non-stacking rule.

Simplifying Decision Tables

Many decision tables contain redundant rules where a condition does not affect the outcome. We can simplify tables by introducing a Don't Care entry (denoted as - or I for Irrelevant) . For example, if "Is VIP Customer" is False and "Order Value > \100$" is False, then the VIP and Bulk discounts are irrelevant, and only the Coupon condition determines the output. Collapsing these columns reduces test suite size without compromising logical coverage.


Cause-Effect Graphing

Cause-Effect Graphing is a systematic approach to designing decision tables . It uses a graphical notation (similar to digital logic circuits) to represent the logical relationships between input conditions (Causes) and system actions (Effects), including physical constraints .

Core Logic Gates

  • Identity: If cause AA is True, effect BB is True.
  • NOT (\sim): If cause AA is True, effect BB is False; if AA is False, BB is True.
  • OR (\lor): If at least one of the causes is True, the effect is True.
  • AND (\land): The effect is True only if all contributing causes are True.

Footnotes

  1. Atria Elearning Software Testing Unit 4 - Academic slides on test generation from requirements using Decision Tables and logical circuit mapping. 2 3

  2. TutorialsPoint Cause-Effect Graphing - Overview of Cause-Effect graphing syntax, boolean logic models, and mapping to decision tables.

Combinatorial Explosion

Without constraints, a system with nn binary inputs requires 2n2^n test cases. For just 1010 binary variables, this results in 1,0241,024 columns . Always identify mutually exclusive constraints (such as the EE or OO constraints) early to prune impossible combinations and keep the decision table manageable!

Footnotes

  1. Atria Elearning Software Testing Unit 4 - Academic slides on test generation from requirements using Decision Tables and logical circuit mapping.

Converting Cause-Effect Graphs to Test Cases

  1. 1
    Step 1

    Analyze the software specification to separate the distinct input conditions (Causes) from the resulting system actions (Effects) . Assign a unique identifier to each Cause (C1,C2,...C_1, C_2, ...) and each Effect (E1,E2,...E_1, E_2, ...).

    Footnotes

    1. TutorialsPoint Cause-Effect Graphing - Overview of Cause-Effect graphing syntax, boolean logic models, and mapping to decision tables.

  2. 2
    Step 2

    Draw the logical network linking causes to effects. Use standard Boolean operators: identity, NOT (\sim), OR (\lor), and AND (\land). Add system constraints (e.g., E, I, O, R, M) to model mutually exclusive inputs or conditional dependencies between causes or effects .

    Footnotes

    1. Atria Elearning Software Testing Unit 4 - Academic slides on test generation from requirements using Decision Tables and logical circuit mapping.

  3. 3
    Step 3

    Trace backward from each Effect to determine the combinations of Cause states that trigger it. Each valid combination forms a column (Rule) in the decision table. Mark forbidden combinations as invalid based on graph constraints.

  4. 4
    Step 4

    Convert each rule (column) of the simplified decision table into a concrete test case. Specify the exact input values that will satisfy the rule's cause states, and document the expected outputs as the rule's active effects .

    Footnotes

    1. Guru99 EP and BVA Tutorial - Detailed breakdown of equivalence partitions, boundary values, and practical test design.

Understanding Cause-Effect Constraints

Black-Box Testing Technique Assessment

Comparison of techniques across core software engineering metrics (scale of 1-10)

Technique Comparison and Heuristic Selection

Selecting the right black-box technique depends heavily on the structure of the input space and the complexity of the business logic. No single technique fits all scenarios.

TechniquePrimary FocusBest Suited ForKey Limitation
Equivalence Partitioning (EP)Uniformity of domainsLarge input domains, simple data types Does not test boundary edges
Boundary Value Analysis (BVA)Edge-case behaviorNumerical ranges, array indexes, dates Fails to detect complex interactions
Decision Table TestingLogical combinationsComplex business rules, interacting parameters Tables grow exponentially if unsimplified
Cause-Effect GraphingInterdependent constraintsHighly logical specification flows, safety-critical code Requires high initial modeling effort

Selection Heuristics

  1. Range & Limits: If inputs have numerical, date, or chronological bounds, immediately apply Boundary Value Analysis (2-Value or 3-Value depending on criticality) alongside Equivalence Partitioning.
  2. Category/Type Classification: For inputs consisting of categories, roles, or payment types, define Equivalence Partitions and test nominal representatives.
  3. Independent Interactivity: If inputs do not interact, use Weak Normal EP and 2-Value BVA to keep the test suite compact.
  4. Combinatorial Business Logic: When actions are determined by combinations of logical conditions (such as user status, inventory level, and coupon code), construct a Decision Table.
  5. Highly Interdependent Systems: For systems with severe constraints, mutually exclusive options, or cascading dependencies, model with a Cause-Effect Graph first to ensure no valid states are missed and invalid rules are systematically pruned.

Footnotes

  1. Guru99 EP and BVA Tutorial - Detailed breakdown of equivalence partitions, boundary values, and practical test design.

  2. Ficode BVA & EP Testing - Exploration of black-box testing methodologies and range validation boundaries.

  3. Atria Elearning Software Testing Unit 4 - Academic slides on test generation from requirements using Decision Tables and logical circuit mapping.

  4. TutorialsPoint Cause-Effect Graphing - Overview of Cause-Effect graphing syntax, boolean logic models, and mapping to decision tables.

Knowledge Check

Question 1 of 4
Q1Single choice

If a software specification dictates a valid age range of [18,65][18, 65] inclusive, which set represents the correct test points generated by a robust 3-Value Boundary Value Analysis?