You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Ravinder Reddy <pa...@students.iiit.ac.in> on 2007/05/26 21:37:56 UTC

doubt on JUnit.!!


 	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..!!

 				Thank You..!!


-- 
******************************************************************************

    Every problem that has been solved can be solved again in a better way

                                                   - Ravinder Reddy

*******************************************************************************


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Re: doubt on JUnit.!!

Posted by Kristian Waagan <Kr...@Sun.COM>.
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.



regards,
-- 
Kristian

> 
>                 Thank You..!!
> 
>