Re: Dos and don'ts in C++ unit testing?
Francis Glassborow wrote:
In article <1171706042.378302.7240@j27g2000cwj.googlegroups.com>, James
Kanze <james.kanze@gmail.com> writes
That's one way of doing it. Although I think you often have to
group them: it's hard to test a setter without having written
the getter, and vice versa.
True, but if I write such pairs of functions I start questioning my
design (sometimes it is fine, but often it is a symptom of limited
understanding)
It depends on the application, but that particular pair was only
meant as an example. The point is that many functions do
"group" in some way; that the results of one function depend on
other functions. In fact, I'd also say that if any of the
functions in a class are independant, I'd start questioning the
design; it might be that I really should be using several
different classes.
--
James Kanze (GABI Software) email:james.kanze@gmail.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! ]