Basic BVA tests at two points per boundary โ the value at the edge and the value just past it. But more rigorous variations exist that increase defect detection at the cost of additional test cases. Three-value BVA adds one more point per boundary. Robust BVA extends testing to include values far outside the valid range. Worst-case testing combines boundary values from multiple variables simultaneously. Understanding when to apply each strategy lets you calibrate your testing depth to the risk level of the feature.
BVA Variations โ From Basic to Worst-Case
Each BVA variation offers a different trade-off between the number of test cases and the probability of catching defects.
# BVA variations applied to a field: valid range 1-100
RANGE_MIN = 1
RANGE_MAX = 100
# โโ Basic (Two-Value) BVA โโ
# Test at: boundary and one step inside
basic_bva = [
{"value": 0, "label": "Below min", "expected": "Invalid"},
{"value": 1, "label": "At min", "expected": "Valid"},
{"value": 100, "label": "At max", "expected": "Valid"},
{"value": 101, "label": "Above max", "expected": "Invalid"},
]
# โโ Three-Value BVA โโ
# Test at: one below, at boundary, one above
three_value_bva = [
{"value": 0, "label": "Min - 1", "expected": "Invalid"},
{"value": 1, "label": "At min", "expected": "Valid"},
{"value": 2, "label": "Min + 1", "expected": "Valid"},
{"value": 99, "label": "Max - 1", "expected": "Valid"},
{"value": 100, "label": "At max", "expected": "Valid"},
{"value": 101, "label": "Max + 1", "expected": "Invalid"},
]
# โโ Robust BVA โโ
# Three-value BVA PLUS extreme values outside valid range
robust_bva = three_value_bva + [
{"value": -999, "label": "Extreme low", "expected": "Invalid"},
{"value": 0, "label": "Zero", "expected": "Invalid"},
{"value": 999999, "label": "Extreme high", "expected": "Invalid"},
{"value": -1, "label": "Negative", "expected": "Invalid"},
]
# โโ Worst-Case BVA (two variables) โโ
# Cross-product of boundary values for TWO fields
# Field A: 1-100, Field B: 1-50
field_a_boundaries = [0, 1, 2, 50, 99, 100, 101]
field_b_boundaries = [0, 1, 2, 25, 49, 50, 51]
worst_case_count = len(field_a_boundaries) * len(field_b_boundaries)
print("BVA Variations Compared โ Field: Valid Range 1-100")
print("=" * 60)
print(f"\n Basic (Two-Value) BVA: {len(basic_bva):>3} test values")
print(f" Three-Value BVA: {len(three_value_bva):>3} test values")
print(f" Robust BVA: {len(robust_bva):>3} test values")
print(f" Worst-Case (2 fields): {worst_case_count:>3} test combinations")
print(f"\nThree-Value BVA Test Values:")
print(f" {'Value':>6} {'Label':<12} {'Expected'}")
print(f" {'-'*40}")
for t in three_value_bva:
print(f" {t['value']:>6} {t['label']:<12} {t['expected']}")
# When to use which strategy
print(f"\n\nSelection Guide:")
print(f" Basic BVA: Low-risk fields, limited testing time")
print(f" Three-Value: Standard choice for most fields")
print(f" Robust BVA: Security-sensitive or financial fields")
print(f" Worst-Case: Critical multi-field interactions (e.g. pricing engine)")
Common Mistakes
Mistake 1 โ Always using basic BVA regardless of risk level
โ Wrong: Applying basic two-value BVA to a financial calculation field where rounding errors at boundary+1 could cause incorrect charges.
โ Correct: Using robust BVA for financial and security-critical fields (including extreme values) and three-value BVA as the standard for general fields.
Mistake 2 โ Applying worst-case BVA to every multi-field form
โ Wrong: Generating 343 worst-case boundary combinations for a low-risk address form.
โ Correct: Using worst-case BVA selectively for critical multi-field calculations (pricing, tax, insurance premium) and pairwise EP for standard forms.