fhg
Volume 9, Number 20 -- June 17, 2009

A Testing Tip

Published: June 17, 2009

by Ted Holt

One of the annoyances of maintenance programming is that testing a program change often takes longer--even several times longer--than the process of making the change. One impediment to testing is the inordinate amount of time required to load a test database with the data appropriate for a good test. In the following paragraphs, I share a simple tip that in some situations reduces the effort to establish a good test environment.

Many shops maintain a separate system (either another computer or a logical partition of the machine that houses their production system) for program testing. This testing system may contain old production data, although for security reasons, it is better that the testing system not contain old production data.

The test data, whatever its source, is often inadequate for robust testing, for at least two reasons. First, the data in the test database may not contain enough variety or enough invalid data to properly exercise all parts of a program. For example, suppose a program reads an invoice, then must randomly read (i.e., RPG chain) the customer to whom the invoice was sent. In a clean production database, the random read never fails. If the test data is an old copy of a production database, the case of a failed random read may not get tested.

Second, test database files are often too large to manage. A programmer does not need to sift through a 200-page report to verify that a program works correctly, and shorter run times make quick work.

For reasons like these, I prefer to test with small database files in a scratch library of my own, then run a final test against the official test database. But building such a database contributes to the long testing time about which I complained in the first paragraph, especially when a program uses more than a few files. If a program uses logical files, you must first copy the physical files, then recreate the logical files, and this is a process that gets messy quickly. Here is a timesaver that has come in handy for me on many occasions.

When you copy a logical file and specify CRTFILE(*YES), the created file will be a physical file that looks like the logical file. Obviously this only works for single-format logical files. In the following example, logical file MROITEM serves as a pattern for physical file QTEMP/MROITEM.

CPYF FROMFILE(MROITEM) TOFILE(QTEMP/MROITEM) +
        CRTFILE(*YES)  NBRRCDS(5)

The new physical file contains five records. Use your favorite database utility to edit the new physical file as often as necessary, keying the values you need to get a good test. You don't have to worry that a logical file points to a wrong file or file member. You won't worry about select/omit criteria that might keep your test data from being selected. In the case of a join logical file, you won't have to determine which of the various underlying physical files a field comes from in order to key in the desired data values.

Once you've tested satisfactorily with the dummy physical files, by all means run a test against the regular test database. Hopefully, there will be no surprises and your program changes will be ready for production.




                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
WORKSRIGHT SOFTWARE

Do you need area code information?
Do you need ZIP Code information?
Do you need ZIP+4 information?
Do you need city name information?
Do you need county information?
Do you need a nearest dealer locator system?

We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

Just call us and we'll arrange for 30 days FREE use of either
ZIP/CITY or PER/ZIP4.

WorksRight Software, Inc.
Phone: 601-856-8337
Fax: 601-856-9432
E-mail: software@worksright.com
Web site: www.worksright.com


Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Erwin Earley, Brian Kelly, Michael Sansoterra
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

New Generation Software:  FREE Query Migration Planning Webinar, June 25, 2 p.m. EST
Fujitsu PROGRESSION:  RPG to .NET. . . Smart move made simple
CNX:  Valence is bringing Web 2.0 to System i. Download a FREE 90-day trial


 

IT Jungle Store Top Book Picks

Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
The iSeries Express Web Implementer's Guide: List Price, $49.95
The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
The System i Pocket RPG & RPG IV Guide: List Price, $69.95
The iSeries Pocket Database Guide: List Price, $59.00
The iSeries Pocket SQL Guide: List Price, $59.00
The iSeries Pocket Query Guide: List Price, $49.00
The iSeries Pocket WebFacing Primer: List Price, $39.00
Migrating to WebSphere Express for iSeries: List Price, $49.00
Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
Getting Started with WebSphere Express for iSeries: List Price, $49.00
Can the AS/400 Survive IBM?: List Price, $49.00
Chip Wars: List Price, $29.95


 
The Four Hundred
Infrastructure Business Monopoly

Power6+ Blade Performance: IBM's Competitive Analysis

PowerVM Hypervisor Gets Active Memory Sharing

Mad Dog 21/21: Playing For Keeps in Peoria

CIOs Cut IT Spending 5 Percent in Q1, Gartner Says

Four Hundred Stuff
Crossroads Pushing VTL Solution to System i Customers

IBI Updates WebFOCUS BI Platform

Micro Focus Consolidates Legacy Code Modernization Solutions

xTuple Opens an Online Store for ERP Extensions

QlikTech Continues BI Industry Leadership with QlikView 9

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

System i PTF Guide
June 13, 2009: Volume 11, Number 24

June 6, 2009: Volume 11, Number 23

May 30, 2009: Volume 11, Number 22

May 23, 2009: Volume 11, Number 21

May 16, 2009: Volume 11, Number 20

May 9, 2009: Volume 11, Number 19

TPM at The Register
EMC pushes services for virtual servers

HP servers still half-cold to Ubuntu

IBM churns up CloudBurst clouds

Cisco California pricing revealed

Sun's top brass get golden parachutes...

Voltaire punts monster 10 GE switch

Web servers get 'leccy bill

AMD cooking up low-power, twin server

OpenSolaris ported to ARM chips

AMD claws cash back from Intel

HP serves up cookie sheet servers

Germans fire up 200 teraflop Juropa2 super

Apple tight-leashes 'Snow Leopard' Server

Red Hat goes one louder with Fedora 11

THIS ISSUE SPONSORED BY:

ProData Computer Services
WorksRight Software
CNX


Printer Friendly Version


TABLE OF CONTENTS
V6R1 Run SQL Scripts: Saving Scripts to a System i Source File

A Testing Tip

Admin Alert: A Simple Save While Active Backup Program

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
PHP CLI Call

Perl, PHP, and/or ZendCore

batch printing PDF files from RPG program

Using db2_connect in PHP on iSeries

How to return value from CL program?

ADO.NET/IBM.Data.DB2.iSeries/ iDB2Connection

Order by alias names




 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2009 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement