To design tests of an application, you need
to determine the type of data that the application uses and how the
application accesses that data.
About this task
This information assumes that you do all testing on a
separate system, and that the person who created the test tables and
views has an authorization ID of TEST. The table names are TEST.EMP, TEST.PROJ and
TEST.DEPT.
To
design test tables and views, first analyze the data needs of your
application.
Procedure
To
analyze the data needs of your application:
- List the data that your application accesses and describe
how it accesses each data item.
For example, suppose that
you are testing an application that accesses the
DSN8C10.EMP,
DSN8C10.DEPT,
and
DSN8C10.PROJ
tables. You might record the information about the data as shown in
Table 1.
Table 1. Description of the application data
| Table or view name |
Insert rows? |
Delete rows? |
Column name |
Data type |
Update access? |
| DSN8C10.EMP |
No |
No |
EMPNO |
CHAR(6) |
No |
| LASTNAME |
VARCHAR(15) |
No |
| WORKDEPT |
CHAR(3) |
Yes |
| PHONENO |
CHAR(4) |
Yes |
| JOB |
DECIMAL(3) |
Yes |
| DSN8C10.DEPT |
No |
No |
DEPTNO |
CHAR(3) |
No |
| MGRNO |
CHAR (6) |
No |
| DSN8C10.PROJ |
Yes |
Yes |
PROJNO |
CHAR(6) |
No |
| DEPTNO |
CHAR(3) |
Yes |
| RESPEMP |
CHAR(6) |
Yes |
| PRSTAFF |
DECIMAL(5,2) |
Yes |
| PRSTDATE |
DECIMAL(6) |
Yes |
| PRENDATE |
DECIMAL(6) |
Yes |
- Determine the test tables and views that you need to test
your application.
Create a test table on your list when
either of the following conditions exists:
- The application modifies data in the table.
- You need to create a view that is based on a test table because
your application modifies data in the view.
To continue the example, create these test tables:
- TEST.EMP,
with the following format:
| EMPNO |
LASTNAME |
WORKDEPT |
PHONENO |
JOB |
| ⋮ |
⋮ |
⋮ |
⋮ |
⋮ |
- TEST.PROJ,
with the same columns and format as DSN8C10.PROJ,
because the application inserts rows into the DSN8C10.PROJ
table.
To support the example, create a test view of the
DSN8C10.DEPT
table.
- TEST.DEPT view,
with the following format:
Because the application does not change any data in the
DSN8C10.DEPT
table, you can base the view on the table itself (rather than on a
test table). However, a safer approach is to have a complete set of
test tables and to test the program thoroughly using only test data.