[Twisted-Python] Bugfixes and tests [was: CPUShare-Twisted]

Andrew Bennetts andrew-twisted at puzzling.org
Sun Jan 22 22:24:03 EST 2006

On Mon, Jan 23, 2006 at 02:50:06AM +0100, Andrea Arcangeli wrote:
> > So I see no reason why a unit test or test program
> > should not be required. Twisted, like most open-source
> We may argue about new features, but for bugfixes it makes no sense to
> require them, and my mind isn't going to change about that.

Tests for bugfixes help ensure the bug remains fixed, just like how tests for
features help ensure the feature keeps working.  The difference is minimal,
except that bugs are usually much easier to specify and thus write tests for.

An anecdote: at one point, the FTP code in Twisted got rewritten, and as part of
that the person doing the rewrite decided it would be easiest to just remove
some tests rather than figure out how to update them[1].  Some time later, a bug
report got filed and I thought "I remember fixing this already" -- sure enough I
had, but the test that would have detected it had been thrown away in the
rewrite, so no-one noticed when the bug was reintroduced until after it had been

Tests being thrown away almost never happens -- it was clearly a mistake that
time.  Based on the fact that our range of automated tests is always increasing
(aside from the rare hiccup like that one), I speculate that the number of bugs
prevented from recurring is probably quite high.  It's hard to measure;
generally code that breaks tests isn't committed.

Anyway, my point is this: the reason why Twisted is of such good quality (even
though there's still room to do much better) is because of the tests.   That's
why we're so fussy about having them.


[1] To be fair the original tests weren't particularly well written, but neither
    was the rest of the FTP code...

More information about the Twisted-Python mailing list