A fellow developer on a project I am on believes that doctests are as good as unit-tests, and that if a piece of code is doctested, it does not need to be unit-tested. I do not believe this to be the case. Can anyone provide some solid, ideally cited, examples either for or against the argument that doctests replace the need for unit-tests?
Thank you
-Daniel
EDIT: Can anyone provide a reference showing that doctesting should not replace unit-testing?
There's a concrete example in the Python standard library that persuades me that doctests alone aren't always enough, namely the decimal module.  It has over 60000 individual testcases (in Lib/test/decimaltestdata);  if all those were rewritten as doctests, the decimal module would become very unwieldy indeed.   It's possible the number of tests could be slimmed down whilst still giving good coverage, but many of the numerical algorithms are sufficiently complicated that you need huge numbers of individual tests to cover all possible combinations of branches.
Does Python doctest remove the need for unit-tests?