In web application development we focus more and more in test. We find many testing Frameworks like JUnit, DbUnit, Fitnesse, Sceleminum, JsUnit … On one hand, using testing frameworks can be very helpful for integration test and to avoid regressions, but on the other hand, it could cost too much to develop tests. The picture below presents some test frameworks and the parts of the web application that can be tested by each test framework.
JUnit is most known testing framework. It is very used to test java code but it is not very practical for testing web pages or data persistence.
DbUnit is a great solution for testing DAO. It can help to populate database with test data. In some projects DBunit can be used to initialize database.
In some agile projects using test-driven development, test tools like Fitnesse or Green Pepper are usually used. Those tools manage application specification and execute functional tests which improve development productivity. But it can be problematic if the general contractor is not motivated to use the test tool or does not handle it. It is neither practical or recommanded to let developer create the functional test.
HttpUnit is a test framework based on JUnit which allows testing the presentation part of the Web application.
Selenium is a great tool for testing web application. It tests the client side by launching a web browser and executing functional tests. Developping a test is very easy; we need just to record the test one time by Selenium IDE (Firefox plug-in). The recorded test can be exported to a JUnit test.