¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: [TDD] Three Law of TDD - to strictly follow, or not?


 

Hi Kaleb,

On Tue, Aug 26, 2014 at 4:48 PM, Kaleb Pederson
kaleb.pederson@... [testdrivendevelopment]
<testdrivendevelopment@...> wrote:
[...]
Coworker 2 recently came to me with some questions. He described his process wherein he would:

* Create an empty test
* Add a variable assignment: var instance = new MyClass();
Stop! Go back to where you had the empty test. Now, write the assert
that matches the intent of the test. It (probably) won't compile, but
at least you have the assert, and that's what drives everything else.
Now fill in enough details so that the test compiles, etc.

In general, if you think of a test as Arrange / Act / Assert, work
backwards: Assert first, then Act, then Arrange. This is the TDD
process in action /within/ the test.
Cheers,
Kevin
--
-- remote one-to-one tutoring in TDD and OO
-- software development coaching
-- Refactoring in Ruby, the book

Join [email protected] to automatically receive all group messages.