Recently want to study some of the Java Unit Testing tools, the current market mainstream business unit testing tools mainly have jtest and agitator, others may not be known, I am not very clear. Here are the two tools to compare, of course, I do not use very deep.
1. Code rules Check
(1), JTest
I think the main feature of Jtest is its Code rules review piece, the function is very powerful, you can define code rules to adapt to the team, and even the company's development norms. Its rulewizard features are very distinctive. Just like the latest Jtest 7.5 evaluation version seems to have removed the rulewizard, of course, you can copy the previous version of Rulewizard to a directory in Jtest 7.5, can also be used. This should not change much in each version. Another point is that Jtest's evaluation version does not seem to support the GBK and other character sets, I confirmed that the jtest included in the JRE is missing a JDK1.5 charsets.jar file, just copy it.
Also, because Jtest code rules check for a long time, you can combine rational Robot to automatically run reports that automatically generate code checks. Of course, you can also combine CruiseControl, Ant and other tools to automatically generate such reports.
(2), agitator
Compared to the agitator code rules of the overall interface of the friendliness and convenience, rather than jtest. Of course, it also provides integration with tools such as CruiseControl, ant, or automatically generate reports.
(3), summary
In code rules check this piece, jtest to occupy a certain advantage. Of course, because agitator is a new tool, many of them need to pass the market test, I think this piece of agitator will improve in the future.
2. Unit Test
(1), JTest
Now the unit tests for each version of Jtest are automatically generated by the JUnit unit test case, and Jtest has been extended to JUnit, adding some of its own features. But because the unit test cases are generated automatically, most of those test cases are of no value to the developer, so it can be said that the automatically generated unit test cases are virtually worthless.
In JTest7.5, I found a new feature, that is, user-defined unit test cases, but the interface is not very convenient. It's a bit like a domestic company launch of the C + + unit Test tool visualunit. But overall it needs a lot of improvement. After all, for unit testing, the tools that make it easy for programmers to carry out unit tests and significantly save programmers ' time are the way forward. Because for a project, the duration is very tense, if you need to write 2~5 times of unit test code, too expensive project time, especially for the domestic software environment.
(2), agitator
and agitator is very convenient, basically the program personnel do not need to write JUnit unit test cases, mainly for simple interface operation, you can complete unit testing work, this is very attractive to programmers, as long as fill in the blanks, you can complete the unit test, is simply too wonderful. In addition, the main features of agitator are its expert functions, providing some of the most common tools in the market, such as spring, hibernate and other tools to integrate, very convenient, and applied the idea of mock. Another feature is that custom unit tests are more convenient and can be used in a variety of ways, such as factories and lists.
(3), summary
In unit testing, agitator occupies a certain advantage, which may be some unit test master figures in their company, such as Kent Beck and so on.
3. Report function and management control
(1), JTest
Jtest itself does not provide reporting functionality, but needs to purchase the company's GRS to provide, I think this is an additional investment, I think GRS should be tied to jtest, should not be independent. While GRS overall function is strong, I am the GRS1.0 version of the trial, now the new version does not provide download, and GRS is more difficult to configure, and the interface is not very friendly. I'd recommend using Eclipse RCP in a way that's much better than jtest tightly integrated.
(2), agitator
Dashboard is more convenient and can be integrated with CruiseControl, Ant and other tools. More convenient.
(3), summary
The two pitches.
4. Defects
Both of them do not know the interface of the unit test work, such as awt/swing, SWT, and so on, this is the two need to improve.
5. Conclusion
From the unit test point of view, I tend to use agitator.