Unit-testing in Java
With AgitarOne developers can now do unit testing of their Java code modules very quickly, and eliminate all errors effectively
Rahul Sah
Thursday, November 08, 2007
  • Email
  • Print
  • Comments
  • RSS
  • Digg
  • Delicious
  • Reditt

Installation and setup

AgitarOne is based on Eclipse IDE and it comes packaged with it. Alternatively, it can also be installed separately as a plug-in to an existing Eclipse IDE. In the packaged version, Tomcat server is automatically configured for AgitarOne and the client machines can access AgitarOne's Dashboard remotely.


Once the server and clients have been configured, it's just a few clicks of process for developers to automate the unit-testing process for their code modules.


The developer has to select his project or a class-file and through Agitar's drop-down menu he can select to create tests, agitate the code, run the code-rule or generate the Dashboard result of the project.


AgitarOne in action

The software agitates on a given code module to check for what that code was intended to do and what it actually does. Agitation can be described as a process of creating multiple instances of classes, and calling all methods of those classes with a wide array of input data and observing the results thus generated.


This input data can be randomly generated by AgitarOne or can be manually passed by the developer through factories (user-defined subclasses). Then it's up to the developer to check which observation forwarded by AgitarOne is not matching the desired behavior and the reason for it.


For experiencing this agitation process, let us take a sample project provided with AgitarOne. We will try agitating Product class and see the observations presented by AgitarOne, so that we are able to assert on a few of them to validate code behavior.


In the Product class, we have validation checks for name and price fields. Where name can't be more than 20 characters and price field can have a value between 0 and 1000.


To start the agitation process on Product class, select Product.java and click on Agitate toolbar button or press Ctrl+F9. Now, in the editor window for Product.java, we can see in the Code Coverage style the number of times a particular line of code has been executed. The red indicates that some lines have not been touched by control flow. In AgitarOne Server view, status and coverage (indicates what percent of the code lines have been executed) is displayed.

<<PREVIOUS       NEXT>>



Name
 
Email
Comment Here
 
Code Verification 
   

Skip Navigation Links.
Collapse <div class='CommentsContainer'>Read Comments</div>
Read Comments
nikhil said on 2/14/2008 7:59:06 PM:
hjfjkdfgdf
to nikhil
ramesh papineni said on 1/25/2008 3:54:11 PM:
actually i am a prorammer but i like testing
to ramesh papineni
Prasanna said on 12/18/2007 2:31:31 PM:
to on Unit testin in java
to Prasanna
  
 
 




Copyright © CyberMedia India Online Ltd.
All rights reserved. Usage of content from web site is subject to Terms and Conditions.