software-engineering testing

Definition

Boundary Testing

Boundary Testing is a specification-based testing technique that tests inputs at the boundaries of input domains. It is based on the observation that defects are more likely to occur at the edges of equivalence partitions than within the “centre”.

Principles

Boundary analysis extends equivalence partitioning by checking the edges of valid and invalid partitions.

Terminology

  • On Point: A value that lies exactly on the boundary.
  • Off Point: The value closest to the boundary that belongs to a different partition (adjacent to the boundary).
  • In Point: The value closest to the boundary that belongs to the same partition (used in 3-value analysis).
Boundary ConditionOn Point (Boundary)Off Point (Invalid)In Point (Valid)
x \ge 1010911
x > 1010 (Invalid)11 (Valid)12 (Valid)
x == 10109, 11N/A

Strategies

1. 2-Value Boundary Testing (Standard)
Checks the boundary and its immediate invalid neighbour.

  • Points: On Point, Off Point.
  • Total tests per boundary: 2.

2. 3-Value Boundary Testing (Rigorous)
Checks the boundary, its invalid neighbour, and its valid neighbour.

  • Points: On Point, Off Point, In Point.
  • Total tests per boundary: 3.
  • Why? Detects errors where the boundary was shifted by 1 in the wrong direction or where logical operators were mixed up ( vs ).

Hidden Boundaries

Sometimes boundaries are not explicitly stated in the specification but exist due to the environment or programming language.

Hidden Boundaries

  • Physical Limits: Memory size, disk space, screen resolution.
  • Data Type Limits: Integer.MAX_VALUE, Integer.MIN_VALUE.
  • Domain Limits: Time (00:00 - 23:59), Angles (0-360).

Example

Consider an input field accepting integers 1 to 100 inclusive.

1. Partitions:

  • Invalid Low:
  • Valid:
  • Invalid High:

2. Boundary Analysis:

BoundaryOn PointOff PointIn Point (3-Value)
Lower ()1 (Valid)0 (Invalid)2 (Valid)
Upper ()100 (Valid)101 (Invalid)99 (Valid)
HiddenMAX_INTMAX_INT + 1 (Overflow)N/A

3. Test Cases (2-Value Approach):

  • min: 1 (Valid)
  • max: 100 (Valid)
  • min - 1: 0 (Invalid)
  • max + 1: 101 (Invalid)