OO in Python? ^^
Alex Martelli
aleax at mail.comcast.net
Sun Dec 11 20:29:56 EST 2005
Mike Meyer <mwm at mired.org> wrote:
> Steven D'Aprano <steve at REMOVETHIScyber.com.au> writes:
> > Of course, the IT world is full of people writing code and not testing
> > it, or at least not testing it correctly. That's why there are frequent
> > updates or upgrades to software that break features that worked in the
> > older version. That would be impossible in a test-driven methodology, at
> > least impossible to do by accident.
>
> That sentence is only true if your tests are bug-free. If not, it's
> possible to make a change that introduces a bug that passes testing
> because of a bug in the tests. Since tests are code, they're never
> bug-free. I will agree that the frequency of upgrades/updates breaking
> things means testing isn't being done properly.
Yours is a good point: let's be careful not to oversell or overhype TDD,
which (while great) is not a silver bullet. Specifically, TDD is prone
to a "common-mode failure" between tests and code: misunderstanding of
the specs (generally underspecified specs); since the writer of the test
and of the code is the same person, if that person has such a
misunderstanding it will be reflected equally in both code and test.
Which is (part of) why code developed by TDD, while more robust against
many failure modes than code developed more traditionally, STILL needs
code inspection (or pair programming), integration tests, system tests,
and customer acceptance tests (not to mention regression tests, once
bugs are caught and fixed;-), just as much as code developed otherwise.
Alex
More information about the Python-list
mailing list