Hilarious dream-logic (was Re: [Twisted-Python] [patch] (etc)

Justin Warren daedalus at eigenmagic.com
Fri May 19 00:26:33 EDT 2006


On Fri, 2006-05-19 at 05:04 +0200, Andrea Arcangeli wrote:
> On Fri, May 19, 2006 at 10:41:35AM +1000, Justin Warren wrote:
> > break existing code, ie: regression testing. I'm personally a big fan of
> > this feature of test suites.
> 
> I'm a big fun of test suites as well. I only disagree with wasting time
> delaying the integration of a valid bugfix just because the unit test
> doesn't exist yet. I absolutely never said unit tests are a waste of
> time. For the last months I've always said that "unit tests" are
> _welcome_ at the top of the cpushare-twisted webpage.

Righto. How do you know it's a valid bugfix without a test? Personally,
I know that I make mistakes from time to time, so I think it's handy to
have something that will independantly verify if I've made one or not.
Many a time I've thought I knew what was broken only to find out it was
something completely different.

The twisted folks appear to disagree with you about the necessity of
writing a unit test as part of the bugfix integration process. Since
it's their code, they get to make the rules.

> > Incidentally, those with slightly more CS knowledge know that it is
> > possible, though by no means easy, to build a system that is provably
> > correct. An investigation of the Z specification language may prove
> > enlightening. I think you mean that a test suite proves that the system
> > passes all the tests, not that it is bug free.
> 
> What I mean is that a test suite cannot prove the code is bug free. Nor
> that any bugfix is correct. If nothing else because the test suite may
> be buggy too. This is obvious.

Obvious to you and me, perhaps, but there may be others who read this to
whom it isn't so obvious. Hopefully they find this thread helpful.

> Clearly a test suite is welcome and can only help, but its mandatory
> requirement for any change to the code sounds way excessive.

I guess we'll just have to agree to disagree on this point. I support
the mandatory unit test requirement.

> I perfectly know about formal demonstrations being possible too (I spoke
> about those matters for a long time last year in a completely different
> context) but they're not unit-tests (certainly not the ones you see in
> the twisted reposistory), so I didn't mention this to avoid further
> confusion. I doubt it's feasible to demonstrate Twisted bug free
> formally (to back my guess I remind you Alan Cox quote saying twisted is
> a 6m unauditable weirdness, I guess he was partly joking though).

My apologies for starting a thread derail. I was simply responding to
your assertion that nothing can be proven to be bug free. Rather petty
of me in hindsight.

> My current worries are the troubles with poll, I worry about the lack of
> epoll, I worry about scaling in SMP with one thread per cpu. Those are
> the things that should be discussed instead of receiving emails from
> people about lack of unit tests for fixes that can be trivially verified
> by reading the code.

We disagree on the 'trivially verified by reading code' part. It is my
opinion that only trivially simple code can be correctly verified simply
by reading it, particularly by so fallible a human as myself. Perhaps
your code reading skills are far superior to my own. Unit tests help me
to understand other's code. I have enough trouble understanding my own
code six months after writing it.

As you suggest, perhaps now is the time to move on to discussing other
issues?

[snip benchmarking bits]

Interesting reading. My apologies to everyone else on the list for
contributing to the... clutter.

-- 
Justin Warren <daedalus at eigenmagic.com>





More information about the Twisted-Python mailing list