Chapter 4: Test Management

Test Planning

Creating a roadmap for testing activities.

Test Strategy vs Test Plan

Test Strategy: High-level approach Test Plan: Detailed execution plan

# Example: Risk-based test prioritization
def prioritize_tests(test_cases):
    """Prioritize based on risk = probability Γ— impact"""
    for test in test_cases:
        test.risk_score = test.probability * test.impact
    
    return sorted(test_cases, key=lambda x: x.risk_score, reverse=True)

Test Estimation

Techniques for estimating test effort:

  1. Expert Judgment: Based on experience
  2. Work Breakdown: Divide into smaller tasks
  3. Three-Point Estimation: Best, worst, likely scenarios
Estimate = (Best + 4Γ—Likely + Worst) / 6

Entry & Exit Criteria

Entry Criteria (When to start testing):

  • Code is checked in
  • Build is successful
  • Test environment ready

Exit Criteria (When to stop testing):

  • All planned tests executed
  • 95% pass rate achieved
  • No critical bugs open

Test Metrics

Track testing progress and quality:

def calculate_test_metrics(total_tests, passed, failed, blocked):
    pass_rate = (passed / total_tests) * 100
    defect_density = failed / total_tests
    
    return {
        'pass_rate': pass_rate,
        'defect_density': defect_density,
        'test_coverage': (passed + failed) / total_tests * 100
    }

Key Takeaways

βœ… Plan testing activities early βœ… Use risk-based prioritization βœ… Define clear entry/exit criteria βœ… Track metrics to measure progress

Complete Lab 4 to create a complete test plan!