A couple of years ago I wrote a #php script that mucks around with some system files. Because I didn't want to break my system while testing the code, I wrote some relatively tedious tests in #phpunit with mock objects, validating the parameters that were passed down to the filesystem.
It was a real pain in the butt, but I got the thing debugged without making a mess of my working environment.
Today I decided to add a new feature, and there's no way to express how much time having all that stuff set up saved. I copied a similar test, adapted it to the new feature, got it to pass tests, and deployed it without issue.
Coding a good test suite pays back over, and over, and over again.
@alan And beyond that, a well thought out system overall just saves time. A lot of it...
@arnan A good test suite has paid back at *least* 10:1 in terms of time saved on every project I've worked on. That doesn't include the pain that releasing something with a regression would have caused, and the number of times a test suite has caught regressions caused by an "easy fix" is not small.
I'm not great at front end code, and adopting a test-driven design approach to what little FE code I've done has also been a serious win.