|
Re: Post-TDD
|
Posted: Sep 1, 2005 12:13 AM
|
|
> Clearly tests are crucial, but they are also undeniably > time-consuming to write, and execute.
Its worth pointing out that these are coding time hits, not run time (since the tests are not part of the product). In any serious product development, coding time is a small percentage of the overall development. Taking a hit there to produce demonstrably correct code is not a worry (unlike the hit taken as a result of developing code that can't be shown to work).
> Reducing tests can only be done when you know something to > be correct, or by reducing the design complexity.
No, you can't reduce the tests when you 'know something to be correct' - for two reasons: One, you never really know something is correct, you can only surmise it; two, Tests don't tell you something is correct only that it was correct (with respect to that test) at the time and under the circumstances when the test was run. Once the tests are removed, that test run date recedes into the past along with the reliance that can be placed upon it, the applicable circumstances, etc. Hence the TDD requirement to run all tests as frequently as possible.
> My > approach for a long time has been to rely on code which is > verifiably correct, and to use implicit testing > techniques. For instance I would write code which reused > small functions, even when it would lead to more code and > less efficient designs. This put an extra strain on the > function which would lead to an implicit "stress-test".
Is this different to 'optimistic coding' (i.e. treating the fact that something didn't go wrong as being equivalent to saying it is right)?
> I guess what I am getting at is that reuse of verified > code (demonstrably correct through: explicit tests, > implicit stress-tests, proofs, assertions, and simple > inspection), reduces the need for certain tests and thus > can streamline the development process.
Which tests qualify as the "certain tests" that can be removed? Once you have removed those tests, how do you demonstrate that changes elsewhere in the system do not impact on that code?
Interesting that you refer to 'simple inspection' as a test method. Surely once you've made such an inspection and corrected the code, if necessary, then simple inspection no longer works because you can no longer simply see any problems with the code. This therefore makes the tests more necessary - to catch the unseen problems. Vince.
|
|