Recall & Review
beginner
What does test coverage measure in software testing?
Test coverage measures how much of the code is executed by the tests. It shows which parts of the code have been tested and which parts have not.
Click to reveal answer
beginner
Why is high test coverage important?
High test coverage means more code is tested, reducing the chance of bugs. It helps ensure the software works as expected in many situations.
Click to reveal answer
intermediate
Can 100% test coverage guarantee bug-free software?
No, 100% coverage means all code lines run during tests, but it does not guarantee all bugs are found. Tests must also check for correct behavior.
Click to reveal answer
beginner
How does pytest help measure test coverage?
Pytest can be combined with coverage.py to track which lines of code run during tests. It generates reports showing coverage percentage and uncovered code.
Click to reveal answer
beginner
What is a practical way to improve test coverage?
Add tests for parts of the code that are not covered yet. Focus on important or complex code to catch more bugs and improve software quality.
Click to reveal answer
What does test coverage show?
✗ Incorrect
Test coverage shows which parts of the code are run during testing, helping measure test completeness.
Which tool can be used with pytest to measure coverage?
✗ Incorrect
coverage.py is a tool that tracks code execution during tests and works well with pytest.
Does 100% test coverage mean no bugs remain?
✗ Incorrect
Even with full coverage, tests must verify correct behavior to find bugs.
Why improve test coverage?
✗ Incorrect
Improving coverage reduces untested code, helping find bugs and improve quality.
What does low test coverage indicate?
✗ Incorrect
Low coverage means many code lines are not executed by tests, risking undetected bugs.
Explain why test coverage is a useful measure of test completeness.
Think about how coverage relates to code execution and test thoroughness.
You got /4 concepts.
Describe how pytest and coverage.py work together to measure test coverage.
Consider the roles of both tools in testing and reporting.
You got /4 concepts.