站内搜索: 请输入搜索关键词
当前页面: 图书首页 > How to be a Successful Technical Architect for J2EE Applications

Chapter 18: Functional Testing Guidelines - How to be a Successful Technical Architect for J2EE Applications

Team LiB
Previous Section Next Section

Chapter 18: Functional Testing Guidelines

Overview

Throughout the book, I've recommended that you create test cases for all data access objects and business logic objects because these layers contain most of the application's complexity. I've also mentioned that these tests are used for unit testing as well as part of a regression test suite. In this chapter, I show you how to use open source testing components, based on JUnit, to accomplish this.

JUnit is an open source framework that facilitates the writing and running of test cases and grouping them into test suites. You can download JUnit from the project home page at http://www.junit.org/index.htm.

I use open source testing components because they're popular and easy for anyone to access. Those of you using commercial testing packages can look at the examples in this chapter as conceptual. All commercial testing tools I'm aware of will support the testing concepts illustrated in this chapter. Performance and load testing concepts are covered in chapter 19.

Ideally, I'd recommend highly automated ways to test the presentation layer. Currently, the most popular product to do this appears to be Apache's Cactus. However, this product has limited testing capabilities. For instance, although it can test if session attributes are set properly, it can't tell if the aesthetics of the resulting page are working. Consequently, you have to do manual testing before release anyway, which significantly reduces the benefits of setting up a regression test for the presentation layer.

Additionally, the setup work for Cactus is verbose and tedious. Between the two drawbacks I've mentioned, the cost of setting a regression test up with Cactus usually outweighs the benefits. I'm sure that this will change given time. You can download Cactus from the project home page at http://jakarta.apache.org/cactus/.


Team LiB
Previous Section Next Section