The Observations view indicates where the problems may be lying with the code module, in our case the Product class. Notice the following observation listing for the Product class.
0 <= this.getName().length() <= 46
As we had defined that a name can't be more than 20 characters long, in this observation we can see that AgitarOne was able to pass more than 20 characters long values to the field 'name'. This means a validation for that is not being executed or is being ignored by the program control during execution.
Now the developer can directly presume that the validateName() method of the code is not being called when setName() method passes the value for name field. By changing the setName method to look as following code snippet we can eliminate the error.
public void setName(String name) throws IllegalArgumentException { validateName(name); this.name = name; }
When we again agitate the Product class, under the Observations view, we see a modified observation listed. The observation for getName() has also been modified.
Similarly, the developer can make assessment for other observations. He can assert an observation to hold true for a situation and can again run agitation to check the code behavior. This way a developer, who is well familiar with his code, can at developmental stage only eliminate possible redundant errors, by using AgitarOne.
The functionality of Dashboard is an added advantage, both for a developer and the project leader. As in Dashboard, the whole coverage percentage of the projects' classes, their progress and the highest risk classes can be viewed.
Upon agitation the coverage style is represented along the editor code lines and Observations view shows the various observations from the agitation result
Conclusion With the automation of unit-testing, a developer with the help of AgitarOne can implement quality code creation, right from developmental stage onwards. Hence, enterprises will benefit with reduced time of testing and developers will be able to debug their code and improve productivity, significantly.
Get most out of your technology infrastructure investments with Dell
About CIOL | Media Kit | Site Map | Contact Us | Help | Write to us | Jobs@CyberMedia | Privacy Policy
Copyright © CyberMedia India Online Ltd. All rights reserved. Usage of content from web site is subject to Terms and Conditions.