Practice question · Select all that apply
Every unit test in a project passes. Select every kind of defect that could still be present.
Hints
- Unit tests check single units in isolation against the inputs the tests happen to choose.
- Two options describe failures that a passing unit test suite would already have exposed.
Show the answer
- C. A function returns the wrong value for an input no test supplies
- D. Two modules disagree about the format of the data they exchange
- E. The program is unusable end to end even though each part works
Why
Isolation is the blind spot: interface disagreements and end-to-end failures survive a green unit suite, as do inputs nobody thought to test. A function failing on its own test input, or code that will not compile, could not coexist with a passing suite, which is why integration and system tests sit above the unit level rather than replacing it.
Practise Testing Larger Behaviours
The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.
More questions on Testing Larger Behaviours
- Sort each claim by whether a coverage report can actually support it.
- Test-driven development requires the new test to FAIL before any code is written. Why is that step not a…
- A test suite runs in four hours and developers stop running it before pushing. What has the suite become?
- A test suite can execute every line of a function and still miss the input that breaks it.