Imagine you are testing a new app feature. Why does using a systematic testing technique help improve coverage compared to random testing?
Think about how planning helps cover all rooms in a house instead of just some.
Systematic techniques use a planned method to cover all parts of the software, reducing the chance of missing bugs in untested areas.
Given two test sets for a function with 5 branches, one systematic covering all branches, one random covering some, what is the coverage percentage?
branches = ['A', 'B', 'C', 'D', 'E'] systematic_tests = ['A', 'B', 'C', 'D', 'E'] random_tests = ['A', 'C', 'E'] systematic_coverage = len(systematic_tests) / len(branches) * 100 random_coverage = len(random_tests) / len(branches) * 100 print(f"Systematic coverage: {systematic_coverage}%") print(f"Random coverage: {random_coverage}%")
Count how many branches each test set covers out of total branches.
Systematic tests cover all 5 branches (100%), random tests cover 3 out of 5 (60%).
You have a test report object with a coverage field showing percentage coverage. Which assertion best confirms full coverage?
test_report = {'coverage': 100}Full coverage means exactly 100%, not less or more.
Only assertion A checks that coverage is exactly 100%, confirming full coverage.
What is wrong with this code that calculates coverage percentage?
def coverage_percentage(tested, total): return tested / total print(coverage_percentage(80, 100))
Think about how percentages are usually shown.
The function returns a fraction (0.8) but coverage is usually shown as a percentage (80%).
In a test framework, which feature helps ensure systematic coverage of all input cases?
Think about how to run the same test many times with different inputs.
Parameterization allows running tests with all planned inputs, supporting systematic coverage.