PSD exam question

Answering: “What is test first development?”

By Hiro TakashimyaUpdated
Studying for the PSD exam? Try 5 free practice questions first.Start the free quiz →

Understanding Test-First Development

Test-first development is a key practice in Agile software development, where tests are written before the code that needs to satisfy them. This approach helps ensure that the code meets the specified requirements from the outset and allows developers to focus on delivering the functionality that is actually needed.

Exam Question

What is test first development?
(choose the best answer)
A. Testing existing code before adding more code to it.
B. Having the tester in the Scrum Team write the test plans before coding.
C. The continuous restructuring of software to retain flexibility.
D. Creating tests before satisfying them.

Correct Answer

D. Creating tests before satisfying them.

Explanation

Correct Answer

D. Creating tests before satisfying them:
Test-first development, also known as Test-Driven Development (TDD), involves writing tests before the corresponding code is written. The idea is to first define what the code should do by writing a test that fails (because the functionality does not yet exist), and then write the minimal amount of code necessary to make the test pass. This process ensures that every piece of code written has a corresponding test, leading to higher code quality and more reliable software.

Why the Other Options Are Less Appropriate

A. Testing existing code before adding more code to it:
While testing existing code is a good practice, it is not the essence of test-first development. Test-first development specifically refers to writing tests before writing the code that will satisfy those tests.

B. Having the tester in the Scrum Team write the test plans before coding:
In test-first development, the developer typically writes the tests as part of the development process. While having test plans in place is important, test-first development is more focused on the iterative process of writing and running tests as code is developed.

C. The continuous restructuring of software to retain flexibility:
This describes refactoring, which is often done in conjunction with test-first development, but it is not the same thing. Test-first development is about writing tests before the code, not about restructuring existing code.

Relevance to the PSD Exam

Understanding the principles and practices of test-first development is important for the PSD exam, as it highlights the focus on quality and the importance of ensuring that code meets its requirements from the very beginning.

Key Takeaways

  • Test-first development (or TDD) is the practice of writing tests before writing the code that will satisfy those tests.
  • This approach helps ensure that every piece of code has a corresponding test, leading to higher quality and reliability in the software.
  • Test-first development encourages developers to focus on meeting specific requirements, reducing the likelihood of writing unnecessary or incorrect code.

Conclusion

Test-first development is the practice of creating tests before satisfying them with the corresponding code. This approach is central to Test-Driven Development (TDD) and helps ensure high-quality, reliable software.

Professional Scrum Developer PSD™ Exam Prep

Get ready for the official PSD exam

127 PSD practice questions, each with an in-depth explanation like the one above.

  • Practice Mode: study at your own pace and choose the test length.
  • Mock Exam Mode: 80 random questions in 60 minutes, like the real exam.

$29 is ScrumPrep's one-time price. The official PSD exam fee ($200) is paid separately to Scrum.org.

More PSD exam questions

Practice all 127 PSD questions →

You cannot copy content of this page