By Peter Coffee  |  Posted 2004-11-29 Print this article Print

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.

In a coders complex and constrained world, there are many potentially right things to do—but 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.

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 observations—for 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 problem—for example, by saying that a value should never be less than 0—and 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 introduced—rather 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 peter_coffee@ziffdavis.com.

Check out eWEEK.coms for the latest news, reviews and analysis in programming environments and developer tools.

Peter Coffee is Director of Platform Research at salesforce.com, where he serves as a liaison with the developer community to define the opportunity and clarify developersÔÇÖ technical requirements on the companyÔÇÖs evolving Apex Platform. Peter previously spent 18 years with eWEEK (formerly PC Week), the national news magazine of enterprise technology practice, where he reviewed software development tools and methods and wrote regular columns on emerging technologies and professional community issues.Before he began writing full-time in 1989, Peter spent eleven years in technical and management positions at Exxon and The Aerospace Corporation, including management of the latter companyÔÇÖs first desktop computing planning team and applied research in applications of artificial intelligence techniques. He holds an engineering degree from MIT and an MBA from Pepperdine University, he has held teaching appointments in computer science, business analytics and information systems management at Pepperdine, UCLA, and Chapman College.

Submit a Comment

Loading Comments...
Manage your Newsletters: Login   Register My Newsletters

Rocket Fuel