Why nobody is web testing in Java

Go into any IDE and create a default Web project and you’ll often get JUnit, but I have yet to see one include some form of web testing support (e.g. Cactus, Cargo, and HttpUnit) and that’s just lame! How many Java web projects have you worked on recently that included thorough web testing in the project? I’ll bet very few! Of those that did, how easy was it to write the web test, make a change to a controller, and instantly rerun the web test all from within your IDE? Probably none! Even if you have an exploded WAR with auto-class reloading enabled in your servlet container, most containers internally restart the WAR which is slow!

Bottom line, web testing in Java is complicated and currently the domain of seasoned Java developers. Appfuse get props for including full web testing framework support but the IDE vendors really need to up their game here!

In contrast Ruby on Rails makes it so easy that I was writing web tests within hours of writing my first line of Ruby and it worked instantaneously whether running from the command line or in the Eclipse based IDE RadRails. They are setting a good example for new developers and I would like to see Java doing a better job because web testing the output users get is arguably the most important thing you can test!

At GreatSchools our QA team addresses the issue by using TestComplate but it’s a completely separate product that doesn’t get triggered by our continuous integration system. Ultimately I think it will be best if we can move to using a web testing system such as Cargo/HttpUnit that will be part of our core project that the developers are engaged with and can be run in the IDE or via CruiseControl.

This entry was posted in Java, Ruby, Software Engineering, Web. Bookmark the permalink.

3 Responses to Why nobody is web testing in Java

  1. Todd,
    Your concerns are exactly the reason I founded Autoriginate and recently released HostedQA. While we don’t have the CI integration just yet (it’s coming any day now), the fact is that most QA solutions out there don’t deal with the concern of automating the _whole_ process (known initial state, resetting persistence state, deploying application, etc).

    If you’d like a free trial for HostedQA, just sign up for the form at http://www.autoriginate.com and I’ll get you started right away.

  2. Bram Smeets says:

    Altough I agree on your argument that there is still a lack of a mature web testing framework, you should have a look at Selenium.
    This is a good attempt to building a good web testing framework. It also has support for including web tests into your Continuous Integration solution.
    And it’s Open Source 😉

  3. Very good workaround is to use embedded servlet container (like tomcat) and create new JUnit test runner that starts embedded tomcat before tests and shuts it down when test are finished – it is very fast, no WARing, and you can set breakpoints both in server and application code …

Comments are closed.