Guide to First Law of TDD
The First Law of Test-Driven Development (TDD) is pivotal within the domain of software development, particularly for PMI-ACP students, as it forms the foundation of understanding TDD and implementing it efficiently.
It is derived from the principles of TDD and states 'You are not allowed to write any production code unless it is to make a failing unit test pass.'
This rule reinforces the essential practice of writing unit tests before the actual code. In turn, it assures that the code is bug-free, adequately meets the user requirements, and handles potential error scenarios.
How it Works: The process begins with a developer writing a failing test case that defines a desired improvement or new function. Next, they write the smallest amount of code to pass that test and finally, refactor the code to acceptable standards.
For your exam:
Exam Tips - Answering Questions on First Law of TDD: 1) Understand the definition clearly; 2)Know how the First Law works in a practical scenario; 3) Be prepared for questions on its application or scenarios in the software development process; 4) Remember, you can’t write code until you have a failing unit test, which you are then obliged to pass with the minimum amount of production code; 5) Lastly, practise answering typical questions that could come up in your exam for better preparation.