News for hackers. Stuff that matters.
Re:Thoughts on Testing by scaryclam on Friday January 05, 2024 @04:43AM (#38877318)
Exactly. A decent test suite will do two things:

1) Give you confidence that if you refactor something, when you do something silly it'll break the tests and show you where you went wrong quickly

2) Allow you as a developer to write new things in isolation, so you can run the code without needing to jump through any hoops to see that it's correct

I tend to write tests when the thing I'm developing isn't simple/cheap to access. Writing tests should help you do things faster, as well as stopping future you from doing daft things. Writing tests dogmatically however, is a waste, and if tests are hard or onerous to write, it shows that the application is probably poorly designed and architected.

There are no comments on this comment yet.