Introduction
When testing software, it's hard to know if every part of the code has been checked. Statement coverage helps solve this by showing which lines of code have been run during tests.
Imagine reading a book and wanting to make sure you read every page. Statement coverage is like marking each page you read to see which ones you missed. This way, you know exactly what parts of the book you haven't seen yet.
┌─────────────────────────────┐
│ Code Statements │
├─────────────┬───────────────┤
│ Executed │ Not Executed │
│ Statements │ Statements │
│ (Covered) │ (Missed) │
└─────────────┴───────────────┘
↑ ↑
│ │
Tests run Need more testsdef check_number(num): if num > 0: return "Positive" else: return "Non-positive" print(check_number(5)) print(check_number(-3))