• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • A Testing Tip

    June 17, 2009 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

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    DRV Tech

    Get More Out of Your IBM i

    With soaring costs, operational data is more critical than ever. IBM shops need faster, easier ways to distribute IBM applications-based data to users more efficiently, no matter where they are.

    The Problem:

    For Users, IBM Data Can Be Difficult to Get To

    IBM Applications generate reports as spooled files, originally designed to be printed. Often those reports are packed together with so much data it makes them difficult to read. Add to that hardcopy is a pain to distribute. User-friendly formats like Excel and PDF are better, offering sorting, searching, and easy portability but getting IBM reports into these formats can be tricky without the right tools.

    The Solution:

    IBM i Reports can easily be converted to easy to read and share formats like Excel and PDF and Delivered by Email

    Converting IBM i, iSeries, and AS400 reports into Excel and PDF is now a lot easier with SpoolFlex software by DRV Tech.  If you or your users are still doing this manually, think how much time is wasted dragging and reformatting to make a report readable. How much time would be saved if they were automatically formatted correctly and delivered to one or multiple recipients.

    SpoolFlex converts spooled files to Excel and PDF, automatically emailing them, and saving copies to network shared folders. SpoolFlex converts complex reports to Excel, removing unwanted headers, splitting large reports out for individual recipients, and delivering to users whether they are at the office or working from home.

    Watch our 2-minute video and see DRV’s powerful SpoolFlex software can solve your file conversion challenges.

    Watch Video

    DRV Tech

    www.drvtech.com

    866.378.3366

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    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

    Elementool Keeps Bugs from Falling Through the Cracks AS/400: Still Kicking After 21 Years

    Leave a Reply Cancel reply

Volume 9, Number 20 -- June 17, 2009
THIS ISSUE SPONSORED BY:

ProData Computer Services
WorksRight Software
CNX

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

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • The Power11 Transistor Count Discrepancies Explained – Sort Of
  • Is Your IBM i HA/DR Actually Tested – Or Just Installed?
  • Big Blue Delivers IBM i Customer Requests In ACS Update
  • New DbToo SDK Hooks RPG And Db2 For i To External Services
  • IBM i PTF Guide, Volume 27, Number 33
  • Tool Aims To Streamline Git Integration For Old School IBM i Devs
  • IBM To Add Full System Replication And FlashCopy To PowerHA
  • Guru: Decoding Base64 ASCII
  • The Price Tweaking Continues For Power Systems
  • IBM i PTF Guide, Volume 27, Numbers 31 And 32

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle