Test Frameworks NG

Posted by Jonathan

I’ve stumbled over a nice comparison of test frameworks for Java on TheServerSide.com. It compares JUnit 3.x, JTiger, and TestNG. Further it has a look at the next version of JUnit that will use new features of JDK 1.5. Also Frank Westphal has a good article on JUnit 4 (german, but the code is self-explanatory).

What is apparent from these articles is that the new trend for test frameworks is to disband the habit of forcing naming conventions like setUp(), tearDown(), testXXX() and ClassTest. Instead JDK 1.5 annotations are used:

public class ClassTest {
 @before public void init() {
  ...
  ...
 }
 @Test public void emptyList() {
  ...
  ...
 }
 @after public void clear() {
  ...
  ...
 }
}

Further the various assert* methods are expanded and more complex tests are possible. Make sure to read the articles if you are interested in Unit Testing even if you have no interest in Java as these features are interesting for every Unit Test framework.

Currently Ruby’s Test::Unit is built in style of JUnit 3.x. Are there any efforts to create a JUnit 4.x style Unit Test framework for Ruby?

Comments

Leave a response