📖 What is Statement Coverage?
The percentage of executable statements in the source code that have been exercised by a test suite. It is calculated by dividing the number of executed statements by the total number of executable statements.
"A highly testable point: 100% statement coverage does NOT guarantee 100% branch coverage. It is the weakest of the white-box coverage metrics."
📚 Certification: Certified Tester Foundation Level (CTFL-v4.0)
🔑 What are the Key Concepts of Statement Coverage?
- ▸ Percentage of executed statements
- ▸ Weakest white-box metric
- ▸ Does not guarantee branch coverage
- ▸ Calculated as executed / total executable
🎯 How does Statement Coverage appear on the CTFL-v4.0 Exam?
Calculate statement coverage from a control flow graph.
Determine the minimum tests to achieve 100% statement coverage.
Evaluate if statement coverage is sufficient.
❓ Frequently Asked Questions
Does 100% statement coverage mean all bugs are found?
No, it just means every line of code ran at least once.
Why is it considered weak?
It may not test all logical paths or false outcomes of decisions.