#testing
Focuses on the importance testing, discussing both the rationale behind testing, its effects on software design, and various tips and tricks.
2024
Why write unit tests? 🧪
·18 mins
A deep dive into unit testing looking to answer why, how much, and what.
Testable code is reusable code ♻️
Testability and reusability goes hand in hand. When you test a function, you run the code in another context than it was built for.
Functional foundations ⚙️
·23 mins
A selection of functional programming concepts that I feel are helpful to all developers.
2012
See tests as living documentation
A few examples of how viewing tests as documentation can affect your test writing.
Don’t test private methods
The need to test a private method often indicates a new class waiting to get out.
Find each bug once
For every bug you fix there should be an automated test which will fail if the bug reappears.
How unit testing changes your design
Most complexity should be in classes with few dependencies, and most dependencies should be in classes with little complexity.
How to unit test code calling a static method
Don’t try to test code which calls static methods, try to get rid of the static methods.