Test-generation process

You create tests using a wizard that leads you through the test-generation process. The wizard generates a JUnit test behavior script, a test suite, and test data tables for storing test data.

Test projects

All generated tests are contained within a test project. Typically, you create your test project before creating your first test, but you can also create a test project when you create a test. When you create a test project, folders are created for storing test behavior scripts, test suites, test runs, and stubs.

Create Component Test wizards

The Create Component Test wizards lead you through the following steps in the test generation process:
  1. Selecting a test project for storing your test.
  2. Selecting a test pattern to use as a template for the test.
  3. Defining the scope of the test by specifying which objects to test (classes, interfaces, beans, Web services, and so on). You can use the test metrics that are displayed to help you decide what to test.
  4. Further defining the test by specifying the methods and constructors to include in the test.

Test patterns

The Rational® Developer products contain several test patterns that you can use to help you create your tests. There are test patterns for method-level Java™ testing, scenario testing, testing of Java interfaces, abstract classes, and super classes, and EJB testing. Each pattern is a template of a JUnit test. Once the test is created, you can use the Java source code editor to further define the test.

For testing Web services, a regular J2SE interface is generated to access the Web service. This interface is based on a WSDL2.java tool. All of the J2SE test patterns are applicable to Web service testing. There are no patterns specific to Web services.

Test data

Test data is maintained in test data tables. When you create a test, a test data table is created for each test case. The test data table provides a way to enter and visualize test data that is used when the test is run. Test data tables give you the ability do data-driven testing, in which you can have several sets of data all with the same test behavior, allowing you to create tests with all possible ranges of data.

Related concepts
Standard Java test patterns
Test patterns for Enterprise JavaBeans
Test data tables
Related tasks
Creating new component test projects
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.