Computer Science I / Testing Larger Behaviours
Practice question · Multiple choice

Test-driven development requires the new test to FAIL before any code is written. Why is that step not a waste of time?

Hints
  1. Imagine a test with a typo in its assertion that passes on an empty codebase.
  2. What has a green test told you if it was green already?
Show the answer

A. Because a test that passes before the feature exists is testing nothing

Why

The red step validates the test itself. Skipping it is how suites fill with tests that would pass no matter what the code did.

Read the lesson: Testing Larger Behaviours →

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