Re:Calculating the sample size required for developing a cli...
by virgilp on Monday September 07, 2020 @04:23PM
(#24402470)
Yes but then the tests would formally describe the requirements - i.e.they would be a de-facto implementation. Congratulations, you just coded an (indirect) solution to your problem (a solution that you postulate is correct/bug-free)
Re:Calculating the sample size required for developing a cli...
by tonyhb on Tuesday September 08, 2020 @09:42AM
(#24408226)
Are you saying this like it's a bad thing?
Tests describing requirements acts as documentation, validation, and regression prevention with future refactors.
Re:Calculating the sample size required for developing a cli...
by virgilp on Tuesday September 08, 2020 @10:01AM
(#24408424)
My beef is with the assumption that tests can fully encode the requirements - to the point where any bug would trigger a test failure. Having such a test suite is no simpler than having a perfect implementation of the requirements - i.e. it's probably only feasible, at all, in the simplest/ "didactic" cases.
Having a perfect implementation is not bad, of course. It's just not realistic.
This is a great point, and it articulates some challenges that I’ve seen with test-driven development.
I would say that if you can write tests that fully specify the desired functionality, rather than merely check a few possible inputs, it’s less of an issue. This is a reason to try to build things with less knobs to twiddle, so the space of inputs has lower dimensionality.