db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: doubt on JUnit.!!
Date Tue, 29 May 2007 06:24:43 GMT
Ravinder Reddy wrote:
>     hello all,
>         I have read somewhere that , in junit testing the focus is on 
> testing the behavior of Object rather than each individual method.
>     what if that a behavior test of an Object , which operates on two 
> methods,passes even though the two methods contain defects(they may 
> cancel out one another).???
>     how we found the defects of these methods..!!

Hello Ravinder,

Without any more details about the issues you mention, I think it is 
pretty much up to the test writer how well the object in question is 
tested. If you test several methods in the same test, it is a general 
advice to make sure results from intermediate steps are correct - 
typically by using asserts.

There is nothing in JUnit that stops you from testing only a single 
method, in fact I believe that is what many of our tests do. That said, 
since we are at a high level (JDBC), the single method call will depend 
on lots of other code which we probably don't test directly.

We have also had a few discussions on being able to test package private 
classes, which are typically at a lower level then the public APIs for 
the database. I think we agreed on a plan, but so far no tests have been 
contributed and the required bits and pieces to compile and and run them 
are not in place.

If you are still worried that the testing is too restrictive or poor, 
please let us know so we can discuss the matters and improve the testing 
of Derby.


>                 Thank You..!!

View raw message