gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] more on the merge-fest


From: zander
Subject: Re: [Gnu-arch-users] more on the merge-fest
Date: Tue, 25 Nov 2003 21:19:12 +0100

On Tue, Nov 25, 2003 at 07:41:52PM +0000, Mark Thomas wrote:
> On Tue, 25 Nov 2003 address@hidden wrote:
> 
> > I may misunderstand the point here since I dont know the context, but this
> > seems a bit strange to me.
> > All the docu for java test suites tell it the other way around; if there
> > is a bug or a change in behavior you define the way it should work by
> > programming the test suite to do what you expect the API to do.
> > If the testsuite breaks (it will) then you fix the sources to make the
> > test suite pass.
> 
> This style of unit testing is not a panacea.  It encourages "coding to the
> test suite" where you just write code so that it passes (unless you have a
> perfect test suite, which you won't, there can still be some cases that
> you miss.  The worst case scenario is where in writing for a buggy test
> suite, you actually break the code).

Practice proves that the behavior you are worried about actually never
happens.  Not if the programmer is worth a bit ;-)

In programming there is no such thing as 'panacea', only 'good enough'.
The practice I described has been found (by many people) to be good enough,
and way better then many alternatives.

I actually tell my people to either write documentation or to create test
cases since the latter explains the API just as well as the first. With the
added advantage that if the test-cases break, you will be notified. If the
docs go wrong, nobody objects until it is (usually) too late.


Anyway; thanx for your opinion, I just wanted to find out if the unit-testing
stuff as I know it was known here, since I have never actually see test cases
outside of java. The C++ ones are a second, but they were pretty pathethic :}

-- 
Thomas Zander




reply via email to

[Prev in Thread] Current Thread [Next in Thread]