test-driven development

alex 15th September 2024 at 8:46am

[27th of August, 2024: I now realise it's been way too much time for this page to be referenced to while not necessarily existing. So this is a very quick draft on what I think about test-driven development.]

Programming is very fun, but it can also be very frustrating sometimes, especially when trying to solve a problem and not knowing exactly what went wrong. With test-driven development, one first sets in stone what exactly the outcome of something should be, and then develops the code to match that outcome. There is more to this (but not really much more).

We should always look for ways to improve the readability of our tests. In addition to verifying the behavior of our code, tests also act as a documentation describing how that code should behave. Therefore, improving the readability of our tests is just as important as improving the readability of our code.

from Beginning Elm

I learned most of what I know about TDD by working through the Obey the Testing Goat book, which also doubles down as a great introduction to Django, even if slightly outdated. Some of my project roadmaps include some TDD as well — but they're definitely not tutorials (both because that was not the intention, nor am I any sort of authority in the field). I did, however, at some point try to break down how I tackle a problem with TDD — but it is a rather incomplete resource.