¿ªÔÆÌåÓý

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

Re: "bottom-up" TDD and common behaviors


 

What motivates implementing a setter method under TDD unless there is a test that requires it to exist and work?? Extra tests would only be required if we also need to implement is<X>Modifiable() for some field X.


On Mon, Dec 2, 2019 at 12:26 PM Ron Jeffries <ronjeffriesacm@...> wrote:
If we're gonna be like that, wouldn't you need a test for every modifiable field? :)

On Dec 2, 2019, at 11:16 AM, Steve Gordon <sgordonphd@...> wrote:

Just because an object has a method implemented to "know" whether or not a field is modifiable?does not mean that that method is correctly implemented.? If there is such a method, you would still have to have at least two tests that verifies returns true only when that field is actually modifiable and false only when it is not.??

Unless the application itself needs such a method, I would have a test that gets the fields value, sets it to a different value, and gets the field value to verify it changes.


Ron Jeffries

Master your instrument, master the music, then forget all that shit and just play. -- Charlie Parker

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