> Say, initially you were told "if I click this button the status should
> update to complete", you write the test, you implement the code, rinse and
> repeat until a demo. During the demo, you discover that actually they'd
> rather the button become a slider, and it shouldn't say Complete when it's
> pressed, it should show a percent as you pull it more and more. Now, all the
> extra care you did to make sure the initial implementation was correct turns
> out to be useless.
Sure, this happens. You work on a thing, put it in front of the folks who asked for it, and they realize they wanted something slightly different. Or they just plain don't want the thing at all.
This is an issue that's solved by something like Agile (frequent and regular stakeholder review, short cycle time) and has little to do with whether or not you've written tests first and let them guide your implementation; wrote the tests after the implementation was finished; or just simply chucked automated testing in the trash.
Either way, you've gotta make some unexpected changes. For me, I've really liked having the tests guide my implementation. Using your example, I may need to have a "percent complete" concept, which I'll only implement when a test fails because I don't have it, and I'll implement it by doing the simplest thing to get it to pass. If I approach it directly and hack something together I run the risk of overcomplicating the implementation based on what I imagine I'll need.
I don't have an opinion on how anyone else approaches writing complex systems, but I know what's worked for me and what hasn't.
This is an issue that's solved by something like Agile (frequent and regular stakeholder review, short cycle time) and has little to do with whether or not you've written tests first and let them guide your implementation; wrote the tests after the implementation was finished; or just simply chucked automated testing in the trash.
Either way, you've gotta make some unexpected changes. For me, I've really liked having the tests guide my implementation. Using your example, I may need to have a "percent complete" concept, which I'll only implement when a test fails because I don't have it, and I'll implement it by doing the simplest thing to get it to pass. If I approach it directly and hack something together I run the risk of overcomplicating the implementation based on what I imagine I'll need.
I don't have an opinion on how anyone else approaches writing complex systems, but I know what's worked for me and what hasn't.