Re: A simple unit test framework
Pete Becker wrote:
You slipped from "write tests before code" to "write tests based only on the
specifications before writing code".
Even under high amnesia situations, that N-byte buffer must be one function
call away from its test driver. This improves the odds you notice it and
question if production code can overflow it. And if you expressly treat the
test cases as documenting the code, then you should write tests which
document that buffer.
All methodologies still require review...
--
Phlip
Pete Becker wrote:
Nope. Test driven design cannot account for the possibility that a
function will use an internal buffer that holds N bytes, and has to
handle the edges of that buffer correctly. The specification says
nothing about N, just what output has to result from what input.
function will use an internal buffer that holds N bytes, and has to
handle the edges of that buffer correctly. The specification says
nothing about N, just what output has to result from what input.
specifications before writing code".
Even under high amnesia situations, that N-byte buffer must be one function
call away from its test driver. This improves the odds you notice it and
question if production code can overflow it. And if you expressly treat the
test cases as documenting the code, then you should write tests which
document that buffer.
All methodologies still require review...
--
Phlip
Comment