My favorites | Sign in
Project Logo
                
People details
Project owners:
  maestri.stefano
Project committers:
alessio.soldano, john.verhaeg, luca.perfetti

In a nutshell TestedBy aims to change the point of view regarding test classes and classes under test. What we would obtain is to put class under test (the most important classes of your projects) on the centre and link from there your test class and test method. Code may help this explanation:

public class TestedBySample {

    /**
     * @param args
     */
    public static void main( String[] args ) {
        TestedBySample sample = new TestedBySample();
        System.out.print(sample.add(1, 2));

    }

    @TestedBy( testClass = "it.javalinux.testedby.TestedBySampleTest", testMethod = "addShouldWork" )
    public int add( int i,
                    int j ) {
        return i + j;
    }
 @TestedByList( {@TestedBy( testClass = "it.javalinux.testedby.TestedBySampleTest", testMethod = "addShouldWork" ),
        @TestedBy( testClass = "it.javalinux.testedby.TestedBySampleTest", testMethod = "addShouldWork2" )} )
    public int add2( int i,
                     int j ) {
        return i + j;
    }

}

which are advantages of this approach?

  1. It become navigable in eclipse 3.4 (with your class under test opened you can navigate to your test class. Isn't cool?)
  2. You will find this annotation in you javadoc. Think how much advantage you can get if you are using a BDD approach, defining test methods like shouldNotAcceptNull() or shouldThrowsExceptionIfEmpty and so on. With a BDD approach you can in fact define contracts and with TestedBy document it!
  3. You can run test starting from class under test and not test class. What does it mean? You can for example run test only for class under test is changed (aka compiled).
  4. More to come...Test class generation, inheritance of test runned and so on.

Project status

Well, I've committed some classes, but they are more or less just a proof of concept. I've post on my blog an article for project kickstart: http://www.javalinux.it/wordpress/?p=116. Read it to have more information of designed feature and how to contribute. TestedBy have also an home page there: http://www.javalinuxlabs.org/drupal/?q=node/21 where you can find some section about contributions and roadmap.









Hosted by Google Code