Header logo.
A study of bugs

Notes tagged with “tdd”


Go has superb built-in support for good programming practices, such as test-driven development. In fact, I'm learning a lot about TDD while learning Go from this book: “Learn Go with Tests”.

If you want to test a bunch of similar inputs and outputs, it's handy to run table-driven tests. What you do is list input values and expected output in an array, then loop through all the test cases.

I found this blog post by Lorenzo Peppoloni quite helpful. It gives examples in both Golang and Python for table-driven tests. ⋯