A programming aid should always shorten a programmers list of problems. Many tools fall short of that goal, merely replacing familiar coding tasks with the nuisance of instructing an intrusive, clumsy assistant. One welcome exception is Agitator 2.0, a capable and intuitive test environment for Java developers, delivered this month by Agitar Software Inc. eWEEK Labs reviewed the 2.0 version in its final form immediately prior to release. Agitator 2.0 is priced beginning at $50,000 for a 10-seat license, including one year of product support plus on-site training and mentoring.To make the partnership work, the tool must be a capable but deferential sidekick, offering options and pointing out pitfalls but not imposing its own ideas. Thats the feeling we had when working with Agitator. The tap of the F9 key to "agitate" a file of Java code soon became an automatic habit, like the Ctrl-S that saves a file whenever the train of thought stops moving. Invoking Agitator triggered an impressively insightful series of automated tests, yielding informative cues for actions that we could take to make our code far more robust. Like a bright but ignorant apprentice, Agitator began by making accurate but somewhat idiotic observationsfor example, that a particular variables value had never left the range between -100 and +100. These values had actually been inserted by Agitator, during multiple passes through our code, and bore no relevance to our problem; wed provided no clue as to what a reasonable input value would be, in the form of an assertion or a test that could throw an exception. We could, however, easily edit that uninteresting observation to reflect our knowledge of the problemfor example, by saying that a value should never be less than 0and then check a box to say that this now-refined observation should thereafter be treated as an assertion. Re-agitating the code yielded a complaint that our new assertion was failing because we still had not done anything to constrain the input values. This follows the somewhat controversial doctrine of "test-first development," in which every line of code is written to correct a problem identified by a test thats already been written and tried. Those who decry the test-first technique as cumbersome might change their Opinion after working with Agitator: It quickly became quite natural to write an assertion, confirm with a tap of the F9 key that our code wasnt honoring it, then add the necessary logic (such as an exception clause) to contain the problem. Notable during this process was Agitators automatic scrutiny of each new boundary condition that we introducedrather like a tenacious if ignorant assistant muttering, "I dont know why this boundary matters, but Im going to make sure its observed." Agitators coverage analysis revealed other errors. For example, an exception clause that was never triggered turned out to contain a logically impossible statement, making it useless as protection of our process. We tested Agitator on Windows 2000 and appreciated the full integration with the Eclipse Foundations Eclipse development environment thats new to the 2.0 release. Complex J2EE (Java 2 Platform, Enterprise Edition) projects will benefit from Version 2.0s added depth and rigor in generating mock objects to exercise Enterprise JavaBeans or Struts interfaces; large development teams will also want to evaluate the companion Management Dashboard product from Agitar, which monitors testing and focuses attention on high-risk modules. Technology Editor Peter Coffee can be reached at email@example.com. Check out eWEEK.coms for the latest news, reviews and analysis in programming environments and developer tools.
In a coders complex and constrained world, there are many potentially right things to dobut also a vastly greater number of wrong moves. This creates a perfect opportunity for automated assistance: The programmer can think about the purpose of the code and the common-sense characteristics of the problem while the machine can be unimaginative but thorough in asking "what-if" questions.