QuestionQ217

Chapter 2: Testing Throughout the Software Development Lifecycle

Which of the following accurately describes a test-first approach?

  • A Tests are derived from acceptance criteria and run to check that the code passes these tests
  • B Application behaviour is written in Given/When/Then format and tests are then written and run
  • C First the tests fail then the code is written to pass the tests and this is iterated
  • D Code is refactored first then tests are written and run
Explanation

A test-first approach begins by creating a failing test, then implementing code that makes the test pass, and repeating this cycle. Refactoring may follow once the tests pass.

Community Discussion

No comments yet. Be the first to start the discussion!