nerdexam
Cisco

200-901 · Question #15

Which task is performed because the test-driven development approach is being used?

The correct answer is B. refactoring code that is covered by existing tests. Test-Driven Development (TDD) follows the Red → Green → Refactor cycle: first write a failing test, then write the minimum code to make it pass, then refactor the now-passing code to improve its design. Option B describes this refactor phase - improving code that is already…

Software Development and Design

Question

Which task is performed because the test-driven development approach is being used?

Options

  • Atesting existing software before developing new code
  • Brefactoring code that is covered by existing tests
  • Cwriting code without committing any coding violations
  • Dcreating test scenarios based on continuous development

How the community answered

(55 responses)
  • A
    4% (2)
  • B
    95% (52)
  • C
    2% (1)

Explanation

Test-Driven Development (TDD) follows the Red → Green → Refactor cycle: first write a failing test, then write the minimum code to make it pass, then refactor the now-passing code to improve its design. Option B describes this refactor phase - improving code that is already covered by tests, so regressions are caught immediately. Option A describes regression testing of legacy code, not TDD. Option C describes linting/style enforcement, unrelated to TDD. Option D reverses the TDD order - in TDD, tests are written before new code, not based on code that was continuously developed first.

Topics

#Test-Driven Development (TDD)#Refactoring#Software Development Methodologies

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice