This sounds like a good idea.
I also have good overall experience with a rigorous unit testing process.

Maybe the section on Contributions should add:
Submit a unit test along with the patch to cover the error or new
functionality.

This way unit tests can be added gradually over time, as Ross sugests.



Ivelin




----- Original Message -----
From: "Ross Gardler" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 15, 2002 12:07 PM
Subject: Getting test cases written


> > Thus after applying a patch, or implementing an enhancement
>  > you run the JUnit tests, and you might see - depending
>  > on the completness of the tests that still everything is fine,
>  > or the patch has some unwanted side effects.
>  >
>  > Thus building up a JUnit test base might help to keep
>  > a stable codebase
>
>
> I am sure many of you are aware of the benifits of unit testing etc. (if
> not then you *must* read Extreme Programming Explained by kent Beck)
>
> I have been using unit tests on many projects for a while. In my
> experience getting people to write them up front is next to impossible
> so what I do now is:
>
> 1) regularly autogenerate test classes against the code base using a
> wizrd in our IDE (TogetherJ, but we want to move to one that works from
ANT)
>
> 2) Whena bug is discovered the *first* thing the developer does is write
> a test case to reproduce it. The name of this test case is logged in the
> buzilla bug report and the bug number is inserted into a comment in the
code
>
> 3) The developer can then go about fixing the bug.
>
> 4) When the developer wishes to test a fix they need only run a single
> test case. Making for a much quicker cycle through the "possible fix",
> "doesn't work" and "whoo, it works" states
>
> 5) Once that test passes, the developer runs the whole test suite on the
> whole application. If a new bug is discoverred go back to step 2.
>
> 6) Once all tests are passed the CVS is updated
>
> Over time you build up a very comprehensive set of tests that start to
> catch bugs for you at the point of applying the patch. Furthermore, the
> crossreferncing with past bugs in the bug database often helps in
> solving future bugs.
>
> Of course writing the tests up front would be better but the reality is
> (especially in Open Source projects) that they don;t get written. Our
> method at least gets some written.
>
> I promise you that the speed of our bug fixes has improved since
> implementing this process.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to