DEV Community

Discussion on: Demonstrating TDD (Test-driven development) in Go

Collapse
 
individualit profile image
Artur Neumann

Yes you are right, thank you for the comment.
I could have splitt the test cases more. E.g. first test a year conversion, then a month conversion, then a day. And fix the problems between the tests. Also more scientifically correct would have been to test a single date only, fix it, test an other date, etc.

On the other hand one could argue I have only tested correct dates. Next iteration should test incorrect Gregorian dates, the one after that, dates that are outside of the provided table, etc.

Collapse
 
quii profile image
Chris James

It's actually very important that you write one test as a time, make it pass and then refactor.

Doing large chunks is how a lot of people get in to a mess.