Writing tests alongside your code can often be helpful. It can help you think of edge cases where things might go wrong, provide a safety net when refactoring, and help you optimise your architecture for low coupling and reuse. Adding tests is relatively easy when you have enough time and are working on a greenfield project (i.e. you don’t have to worry about existing code). However, we don’t always have this luxury. The code we work with may have been written under different circumstances and/or without testing in mind.
Share this post
How to Add Tests for Existing Code with…
Share this post
Writing tests alongside your code can often be helpful. It can help you think of edge cases where things might go wrong, provide a safety net when refactoring, and help you optimise your architecture for low coupling and reuse. Adding tests is relatively easy when you have enough time and are working on a greenfield project (i.e. you don’t have to worry about existing code). However, we don’t always have this luxury. The code we work with may have been written under different circumstances and/or without testing in mind.