Introduction
Testing software can be tricky because errors often happen at the edges of input ranges. Boundary value analysis helps find these errors by focusing on the values right at the limits where things might break.
Imagine a water tap that only works properly when turned between 1 and 10 clicks. Turning it just a bit less or more might cause leaks or no water. Checking the tap at exactly 1, 10, and just outside these clicks helps find problems.
┌───────────────┐ │ Input Range │ │ 1 ───────── 10│ └─────┬───┬─────┘ │ │ ↓ ↓ Test 1 Test 10 Test 0 Test 11
def is_valid_age(age: int) -> bool: return 18 <= age <= 60 # Test cases for boundary value analysis test_ages = [17, 18, 19, 59, 60, 61] for age in test_ages: print(f"Age {age}:", "Valid" if is_valid_age(age) else "Invalid")