IBM 1130 User Manual page 215

Computing system
Hide thumbs Also See for 1130:
Table of Contents

Advertisement

TESTING TACTICS
Many techniques exist to assist your programmer
during the checkout phase of a program. Each has
its own advantages and disadvantages. The one to
be used for a particular problem will depend on
your programmer's thoughts as to what area of his
program is in error. Some very useful techniques
are:
1. Core Storage Dump.
This is a printout of the
contents of core storage. There are two methods of
producing it.
The first is with one of the utility programs sup-
plied with the 1130 Programming Systems. These
utilities will produce a core storage dump in hexa-
decimal.
Since manual hexadecimal-to-decimal conversion
is very tedious and time-consuming, this method is
not recommended.
The recommended method of dumping core storage
is with the dynamic DUMP facilities of FORTRAN
and the Assembler Language. The information
dumped with this method can appear in hexadecimal,
integer, or real format.
In FORTRAN, the DUMP facility is accessed
through use of the PDUMP subroutine. You would
write CALL PDUMP (A1, B1, F1, ... , An, Bn, Fn).
Blocks of core storage are dumped. A1 and B1
are variable data names, subscripted or nonsub-
scripted, indicating the inclusive limits of the first
block of storage to be dumped. Similarly, An and
Bn indicate the inclusive limits of the nth block of
storage to be dumped.
The format of a block is determined by the Fx
associated with that block. F1 through Fn are in-
tegers and are assigned in the following manner:
o
=
Hexadecimal
4
=
Integer
5
=
Real
The Assembler Language dump facilities, DUMP
and PDMP, are used in a similar fashion.
All of the core storage dump facilities will pro-
duce a printout of core storage, by address. You
should use these facilities when a program "bug"
requires, in the judgment of your programmer, an
examination of all or part of core storage.
2. Ari thmetic Trace.
The use of this technique
involves subroutines that are executed whenever a
value is assigned to a variable on the left of an equal
sign. If Console Entry Switch 15 is turned on at
execution time, and the *ARITHMETIC TRACE
FORTRAN control record is used, the value of the
assigned variable is printed, as it is calculated, with
one leading asterisk.
Section
Subsections
Page
30
20
I
00
01
As an optional use, you can elect to trace only
selected parts of the program by placing statements
in the source program to start and stop tracing.
This is done as follows:
CALL
TSTOP (to stop tracing)
CALL
TSTRT (to start tracing)
Thus, tracing occurs only
if:
• The trace control record is compiled with the
source program.
• Console Entry Switch 15 is on (can be turned
off at any time).
• A CALL TSTOP has not been executed, or a
CALL TSTR T has been. executed since the last CALL
TSTOP.
If tracing is requested, an *IOCS control record
must also be present to indicate that either type-
writer or printer is needed. If both typewriter and
printer are indicated in the *IOCS record, the printer
is used for tracing.
Use of this facility will increase execution time
considerably. The trace facility should not be pres-
ent in a production program; if it is, you should
recompile the production program after testing is
complete, leaving out the trace.
3. Transfer Trace. In this case, the FORTRAN
compiler generates linkage to trace routines which
are executed whenever an IF statement or Computed
GO TO statement is encountered.
If
Console Entry
Switch 15 is turned on at execution time and the
*TRANSFER TRACE FORTRAN control record is
used, the value of the IF expression or the value of
the Computed GO TO index is printed. For the
expression of an IF statement, the traced value is
printed with two leading asterisks. The traced
value for the index of a Computed GO TO statement
is printed with three leading asterisks.
The optional use of trace explained under Arithme-
tic Trace also applies to Transfer Trace (use of
TSTOP and TSTRT), as does the information follow-
ing optional use.
4. Extensive Use of PAUSE. It may turn out that
some parts of your program execute correctly and
some incorrectly. What you would like to do is to
check the progress of the program while it is run-
ning. A very useful technique is to place PAUSEs
at strategic places throughout your program. In
order to know where the program is at any point in
time, number the PAUSEs consecutively:
C-----READ INPUT
PAUSE 1
CALL READ(IN, 1,80, N)
C-----IDENTIFY INPUT
PAUSE 2

Advertisement

Table of Contents
loading

Table of Contents