Testing Frameworks

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.

JsUnit is a Unit Testing framework for client-side JavaScript. Web application contains more and more dynamic HTML and Ajax components. I have had some bad experience with client-side JavaScript because JavaScript execution can change from one browser to another.

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.

I think using a testing tool is a must for developing any application. Especially web applications need more than one test tool because they contain many technologies (Data Base, Java, JEE, JSP, HTML, CSS, JavaScript, Ajax …). Even if there is one tool that can test the whole application like Selenium, I think using at least an other test framework is necessary because it helps identifying regressions with more precision and correcting them faster.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s