White Box Testing

These techniques are used to make sure all parts of the code are exercised.

Common White Box Techniques

  • Statement Testing
    Ensures every line of code runs at least once.
  • Branch Testing
    Ensures every “if/else” decision is tested.
  • Path Testing
    Ensures all possible paths through the code are tested.
  • Condition Testing
    Tests how the program behaves when conditions evaluate to true or false.
  • Expression Testing
    Tests how regular expressions behave with different inputs.

Error-Based Testing (Finding Known Weak Spots)

These techniques focus on areas where defects are most likely to occur.

Examples include:

  • Fault Seeding
    Intentionally adding known defects to confirm tests can detect them.
  • Mutation Testing
    Making small changes to the code to see if tests catch the errors
    (Effective but time-consuming and expensive.)
  • Using Historical Test Data
    Prioritizing tests that failed often in the past.