Re: Dos and don'ts in C++ unit testing?
Rune Allnor wrote:
I hoped to get some answers to how to design code in order to
facilitate writing a "test suite" for my code (does that make
sense?), and then some clues about how to actually design the
test suite itself.
I'm not going to give you that many clues, but consider writing your
Without adding to it, that's bad advice. Consider writing the
requirements specifications first, then write the class and its
tests. In any order you want---you should be delivering both
together, and the job isn't done until both are done.
At the class level, most of my documentation (detailed design
specification) is in the header file, so that's what I write
first. I don't start writing a function or its tests until the
documentation for it is done. After that, I generally write the
function before its tests, but that's a personal choice; the
order doesn't matter.
James Kanze (GABI Software) email:email@example.com
Conseils en informatique orient?e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S?mard, 78210 St.-Cyr-l'?cole, France, +33 (0)1 30 23 00 34
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]