Re: C++ fluency
On May 7, 2:30 pm, Pete Becker <p...@versatilecoding.com> wrote:
James Kanze wrote:
Testing the test? If the test is supposed to test something
very specific and non-trivial, it might be worth creating a
special version of the code to be tested, with the exact
error the test is meant to reveal.
Or the other way around, to improve test coverage. Several
years ago there was an idea called "mutation testing", where
some high-level test tool went through your source code
systematically, reversing the sense of each test that the code
did, one at a time, and running the pertinent test code to see
whether the "error" was detected. I didn't look into this too
deeply because it seems like it would take an inordinate
amount of time.
If it's the computer which is doing it, why not? Of course, I'm
not sure that it buys that much---I've seen a lot of errors
because a variable was incorrectly initialized, a expression was
wrong (missing a parentheses, or the parentheses in the wrong
place), the code used the wrong variable or called the wrong
function, etc., etc. Not to mention issues of thread safety,
object lifetime, numeric stability in floating point algorithms,
etc. But every little bit helps.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34