JPS62108338A - Program testing device - Google Patents

Program testing device

Info

Publication number
JPS62108338A
JPS62108338A JP60249656A JP24965685A JPS62108338A JP S62108338 A JPS62108338 A JP S62108338A JP 60249656 A JP60249656 A JP 60249656A JP 24965685 A JP24965685 A JP 24965685A JP S62108338 A JPS62108338 A JP S62108338A
Authority
JP
Japan
Prior art keywords
program
execution
command
undefined
executed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP60249656A
Other languages
Japanese (ja)
Other versions
JPH0766343B2 (en
Inventor
Shoichi Nagatsuma
永妻 昭一
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Omron Corp
Original Assignee
Omron Tateisi Electronics Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Omron Tateisi Electronics Co filed Critical Omron Tateisi Electronics Co
Priority to JP60249656A priority Critical patent/JPH0766343B2/en
Publication of JPS62108338A publication Critical patent/JPS62108338A/en
Publication of JPH0766343B2 publication Critical patent/JPH0766343B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Abstract

PURPOSE:To execute a program execution test on a source level by continuing forcibly the execution of a program by giving a prescribed command, when a line containing an undefined part is executed in the course of executing a program of the source level. CONSTITUTION:With respect to an undefined function (f) whose existence is known in the course of generating a program, an instruction (stub) for returning automatically a prescribed value is prepared, and described in advance in a program list. On the other hand, as for an undefined function which has been detected in the source of a program execution test, an instruction (return) for returning manually an optional value is prepared. Also, the execution of a program is stopped temporarily in a state that the undefined function has been executed, a key input from a terminal equipment 12 is received, and the execution of the program is continued by returning directly a value to the interpreter side by the (return) instruction.

Description

【発明の詳細な説明】 〈発明の技術分野〉 本発明は、プログラムのテスト装置、特に未定義部分を
含むソースレベルのプログラムを対話形式で実行テスト
するものに関する。
DETAILED DESCRIPTION OF THE INVENTION Technical Field of the Invention The present invention relates to a program testing device, and particularly to one that interactively tests the execution of a source-level program including undefined portions.

〈発明の概要〉 この発明は、ソースレベルのプログラムを逐次実行する
インクプリタタイプのプログラムテスト装置であって、
未定義部分を含むラインを実行したことを検出すると、
プログラムの実行レベルのまま未定義部分に対応した値
を強制的に返して、プログラムの実行継続を可能とする
ことにより、トップダウン手法によるプログラム開発を
容易にせんとするものである。
<Summary of the Invention> The present invention is an inscriber type program test device that sequentially executes a source level program,
When it detects that you have executed a line that contains an undefined part,
The purpose is to forcibly return values corresponding to undefined portions at the program execution level, allowing program execution to continue, thereby facilitating program development using a top-down method.

〈発明の背景〉 一般にrCJ等の各種構造化言語は、多数の関数あるい
はサブルーチンにより1つのプログラムが構成されてお
り、コンパイラおよびリンケージエディタを用いて全体
を1つの機械語プログラムとして統合することにより始
めて実行テストが可能となる。更にこの場合、プログラ
ムリスト中に未定義部分を含むことは許されず、従来は
プログラムが全て完成するのを待つか、スタブを予め作
成する等の方法が採られていた。
<Background of the Invention> In general, in various structured languages such as rCJ, one program is composed of many functions or subroutines, and it is necessary to integrate the entire program into one machine language program using a compiler and linkage editor. Execution tests are possible. Furthermore, in this case, it is not allowed to include undefined portions in the program list, and conventional methods have been adopted such as waiting until all programs are completed or creating stubs in advance.

しかしながらスタブの作成作業それ自体が極めて繁雑な
作業であり、特に未定義部分がテスト中に発見された場
合は、例えその未定義関数が重要でな(そのまま通過し
たい場合でも、再度始めからコンパイル、リンク等の作
業を行わねばならない等、迅速なプログラムの実行テス
トを行うことは困難であった。
However, the process of creating a stub itself is extremely complicated, and especially if an undefined part is discovered during testing, even if the undefined function is not important (and you want to pass it as is), you may have to compile it from the beginning again. It has been difficult to perform a quick program execution test because it requires linking and other tasks.

上記問題に対し、ソースレベルのプログラムを直接実行
するインクプリタタイプのプログラムテスト装置も提案
されているが、未定義部分に対しては従来と略同様にス
タブの定義およびリンク等の繁雑な作業を必要とし、更
にテスト実行途中に未定義部分が見つかった場合は、依
然としてプログラムの実行テストを一旦停止してインタ
プリタの実行レベルからエディタによる編集レベルに入
る必要があるなど、オペレータにとって能率的で快適な
プログラムテスト環境からはほど遠い。
In response to the above problem, an inscriber type program test device has been proposed that directly executes a source-level program. Furthermore, if an undefined part is found during test execution, it is still necessary to temporarily stop the program execution test and enter the editor editing level from the interpreter execution level. It is far from a program testing environment.

〈発明の目的〉 本発明は、上記問題に鑑みてなされたものであって、イ
ンクプリタ形式でソースレベルのプログラムを実行中に
未定義な関数あるいは外部変数に行き着いた場合、自動
的にあるいは手動で一定のコマンドを与えてプログラム
の実行を強制的に続行させることにより、未定義部分を
含むプログラムの実行テストが迅速かつ容易に行えるプ
ログラムのテスト装置を提供することを目的とする。
<Purpose of the Invention> The present invention has been made in view of the above-mentioned problem, and when an undefined function or external variable is encountered while executing a source-level program in an inscriber format, the present invention automatically or manually It is an object of the present invention to provide a program testing device that can quickly and easily perform an execution test of a program including an undefined portion by giving a certain command to forcibly continue the execution of the program.

〈発明の構成および効果〉 この発明はソースレベルのプログラムを実行テストする
装置であって、プログラムを1行づつ取り出して順次解
釈実行して行(手段と、該実行手段により未定義な部分
を含むラインが実行されると、実行手段に対して実行を
強制的に継続させるコマンドを送出可能とする手段とを
備えたことを特徴とする。
<Structure and Effects of the Invention> The present invention is an apparatus for executing and testing a source-level program, which extracts a program line by line and sequentially interprets and executes the program (including undefined portions). The present invention is characterized by comprising means capable of sending a command to the execution means to forcibly continue execution when the line is executed.

この発明の構成によれば、プログラム中に未定義な部分
を含んでも同等コンパイル、リンク等の手間を要するこ
となくそのままソースレベルでプログラムの実行テスト
が行え、プログラムの開発能率の向上が図れる利点を有
する。
According to the configuration of the present invention, even if a program includes an undefined part, the program can be executed and tested at the source level without requiring the effort of equivalent compiling, linking, etc., and the advantage is that the program development efficiency can be improved. have

〈実施例の説明〉 以下図面に示す実施例に基づき、本発明を具体的に説明
する。
<Description of Examples> The present invention will be specifically described below based on examples shown in the drawings.

なお実施例では、汎用コンピュータを用い、テスト目的
に応じてソフトウェアを取り替えることにより適用範囲
を広げたC言語用のインクブリタタイプのプログラムデ
バソグシステムに本発明を実施した一例を示すがこれに
限らず、それ単独で動作するテスト専用機等にも略同様
に実施でき、又、被デバツグプログラムの記述言語もr
cJ以外の各種高級言語に変更して略同様に実施できる
ことは勿論である。
In the example, an example is shown in which the present invention is implemented in an inkblitter-type program debugging system for the C language, which uses a general-purpose computer and expands the scope of application by replacing software according to the test purpose, but the invention is not limited to this. It can be carried out in almost the same way on a test-only machine that operates independently, and the writing language of the program to be debugged is R.
Of course, it is possible to change to various high-level languages other than cJ and carry out substantially the same implementation.

本発明を実施するプログラムデバソグシステムは、第3
図に示す如(、汎用コンピュータを使用したエンジニア
リングワークステーション11と、該ワークステーショ
ン11に対するオペレータの直接的なアクセスを可能と
する端末装置12とから構成される。
The program debugging system implementing the present invention has a third
As shown in the figure, the system is comprised of an engineering workstation 11 using a general-purpose computer, and a terminal device 12 that allows an operator to directly access the workstation 11.

ワークステーション11は、マイクロプロセッサを使用
した演算制御装置21を中心として、RAMから成る内
部記憶装置22と、ハードディスクドライブ等の外部記
憶装置23と、周辺装置に対するインターフェース回路
を備えた入出力装置24とを各種バス25を介して接続
したものであって、更にワークステーション11に対し
、入出力装置24を通じて端末装置12が接続される。
The workstation 11 is centered around an arithmetic and control unit 21 using a microprocessor, an internal storage device 22 consisting of a RAM, an external storage device 23 such as a hard disk drive, and an input/output device 24 equipped with an interface circuit for peripheral devices. are connected through various buses 25, and a terminal device 12 is further connected to the workstation 11 through an input/output device 24.

端末装置12は、ワークステーション11に対する直接
的なアクセスを可能とするキーボード26と、ワークス
テーション11内でのデータ処理状況を視認しうる形で
表示するCRT等のディスプレイ装置27とから成り、
キーボード26からのコマンド人力により、外部記憶装
置23に予め格納しておいたインタプリタデバッガ、被
デバツグプログラムファイル等のプログラム及びデータ
を内部記憶装置22にロードしたあとインタプリタの制
御の基に、被デバツグプログラムを1行づつ取り出して
順次解釈実行させることにより、ワークステーション1
1は全体でプログラムテスト装置として動作する。
The terminal device 12 includes a keyboard 26 that allows direct access to the workstation 11, and a display device 27 such as a CRT that visually displays the data processing status within the workstation 11.
After the programs and data such as the interpreter debugger and debugged program file stored in advance in the external storage device 23 are loaded into the internal storage device 22 by manual commands from the keyboard 26, the debugged program files are loaded into the internal storage device 22. By extracting the bug program line by line and sequentially interpreting and executing it, the workstation 1
1 operates as a program test device as a whole.

本発明は、被デバツグプログラムの実行中に未定義な関
数あるいは外部変数を含むラインを実行した際、該プロ
グラムの実行を継続するためのコマンドを上記インタプ
リタに対して追加したことを特徴とする。
The present invention is characterized in that when a line containing an undefined function or external variable is executed during execution of the debugged program, a command is added to the interpreter to continue the execution of the program. .

すなわち第1図に示す如く、プログラムの作成中に存在
が判っている未定義関数fに対しては、所定の値を自動
的に返す命令”s tub”を用意し、プログラムリス
ト31中に予め記述しておく。一方、プログラムの実行
テスト中に見つかった未定義関数に対しては、手動で任
意な値を返す命令“return”を用意するとともに
、プログラムの実行を未定義関数を実行した状態で一旦
停止して、端末装置12からのキー人力を受け付け、r
eturn命令により直接的に値をインタプリタ側に戻
してプログラムの実行を継続させる。
That is, as shown in FIG. 1, for an undefined function f whose existence is known during program creation, an instruction "s tub" that automatically returns a predetermined value is prepared, and it is added in the program list 31 in advance. I will write it down. On the other hand, for undefined functions found during program execution testing, we manually prepare a "return" instruction that returns an arbitrary value, and also temporarily stop program execution with the undefined function executed. , accepts key input from the terminal device 12, r
The etern instruction directly returns the value to the interpreter side and continues execution of the program.

より具体的な例をもって説明すると、returnコマ
ンドは、rreturn  引数」のフォーマントで記
述され、この命令が実行されると強制的に引数の値を呼
び出し側に戻してプログラムを継続する。
To explain with a more specific example, the return command is written in the form "rreturn argument", and when this command is executed, the value of the argument is forcibly returned to the calling side and the program continues.

一方s tubコマンドは、rstub  関数名 実
行文」のフォーマットで記述されるものであって、「関
数名」には具体的な未定義関数の名前“f“を記述する
か、あるいは全ての未定義関数に対して同一の動作をさ
せるのであれば、9*”のマークを記入する。更に「実
行文Jには、単純に数値を戻すのであれば上記retu
rn命令を用い、変数に一定の演算処理を加えるのであ
れば、演算式を記述することにより、第1図に示す如く
、「未定義な関数f」に到達すると自動的にスタブ関数
の「実行文」が実行された後に所定値が呼び出し側に戻
され、被デバツグプログラムの実行を継続するのである
On the other hand, the s tub command is written in the format "rstub function name executable statement", where "function name" is the name of a specific undefined function "f", or all undefined If you want the function to perform the same operation, enter the mark 9*.Additionally, if you want to simply return a numerical value, enter
If you use the rn instruction to perform certain arithmetic processing on variables, by writing the arithmetic expression, as shown in Figure 1, when the ``undefined function f'' is reached, the stub function is automatically executed. After the statement is executed, a predetermined value is returned to the caller, and execution of the debugged program continues.

例えば全てのスタブ関数が、外部変数aに1を加える動
作で正常にプログラムの実行が′a続され得るのであれ
ば、rstub  *  a++ Jと定義する。また
スタブ関数fに行き着いた時、強制的に1を返してプロ
グラムを継続したい場合はrstub  f  ret
urn  I Jとソースプログラムのりスト31上に
記載しておく。
For example, if all stub functions can continue program execution normally by adding 1 to the external variable a, define rstub * a++ J. Also, when you reach the stub function f, if you want to forcefully return 1 and continue the program, use rstub f ret
Write urn I J on source program list 31.

一方スタブ関数を定義しないで未定義のままその関数に
行き着いた場合に、「0」を返してプログラムを継続し
たい時には、プログラムの実行が停止した時点でキーボ
ードからr returnO」を入力する。
On the other hand, if you do not define a stub function and arrive at the undefined function and want to return "0" and continue the program, input "r returnO" from the keyboard when the program execution stops.

なお未定義関数に対して全て同一の処理で良いのなら、
コマンドファイルを別に用意して該ファイル上にret
urn命令を記述しておくとともに、未定義関数を実行
した場合に、コマンドファイルを参照してコマンドを自
動実行させる様にすればよい。
Furthermore, if the same processing is sufficient for all undefined functions,
Prepare a separate command file and ret on the file
In addition to writing the urn command, when an undefined function is executed, the command file can be referenced to automatically execute the command.

第2図は、インタプリタによる制御の流れを説明するも
のであって、ステップ41において被デバツグプログラ
ムの実行を開始すると、インタプリタはプログラムリス
ト31から1行取り込み(ステップ42)、その行の命
令を解釈実行する(ステップ43)。ここでステップ4
4で、入力行に未定義関数を含むか否かの判定がなされ
、判定が“NO“であればステップ42に戻って順次被
デバツグプログラムを実行テストして行く。
FIG. 2 explains the flow of control by the interpreter. When execution of the program to be debugged is started in step 41, the interpreter takes in one line from the program list 31 (step 42) and executes the instructions in that line. The interpretation is executed (step 43). Here step 4
In step 4, it is determined whether the input line contains an undefined function or not. If the determination is "NO", the process returns to step 42 and the program to be debugged is sequentially executed and tested.

しかし、ステップ44の判定が“YES″であれば、未
定義関数を実行中であると判断されるので、次にステッ
プ45で5tub関数が既に定義されているか否かの判
定がなされ、判定が“YES”であればスタブ命令を実
行したあと(ステップ46)、ステップ42に戻る。ス
テップ45の判定が“NO”であれば、コマンドファイ
ルが存在するか否かの判断がなされ(ステップ47)、
“YES”であればコマンドファイル中のコマンドを実
行(ステップ48)したあとステップ42に戻るが、“
NO”であれば、プログラムの実行を一旦停止して、未
定義関数が呼び出された旨のコメントをディスプレイ装
置27上に表示(ステップ49)するとともに、端末装
置12からのキー人力を受け付け(ステップ50)、ス
テップ51でコマンド入力が確認されると、そのコマン
ドを実行(ステップ52)したあと、ステップ42に戻
ってプログラムを継続するのである。
However, if the determination in step 44 is "YES", it is determined that an undefined function is being executed, and then in step 45 it is determined whether or not the 5tub function has already been defined. If "YES", the stub instruction is executed (step 46), and then the process returns to step 42. If the determination in step 45 is "NO", it is determined whether the command file exists (step 47),
If “YES”, the command in the command file is executed (step 48) and then the process returns to step 42, but “
If "NO", the execution of the program is temporarily stopped, a comment indicating that an undefined function has been called is displayed on the display device 27 (step 49), and key input from the terminal device 12 is accepted (step 49). 50), when the command input is confirmed in step 51, the command is executed (step 52), and then the process returns to step 42 to continue the program.

【図面の簡単な説明】[Brief explanation of drawings]

第1図はプロゲラ11リスト上の処理の流れを示す説明
図、第2図は制御の処理手順を説明する流れ図、第3図
は本発明を実施する装置の一例を示すブロック図である
。 11・・・・ワークステーション 12・・・・端末装置 31・・・・プログラムリスト
FIG. 1 is an explanatory diagram showing the flow of processing on the PRO GERER 11 list, FIG. 2 is a flow chart explaining the control processing procedure, and FIG. 3 is a block diagram showing an example of a device implementing the present invention. 11... Workstation 12... Terminal device 31... Program list

Claims (3)

【特許請求の範囲】[Claims] (1)ソースレベルのプログラムを1行づつ取り出して
順次解釈実行して行く手段と、 該実行手段により未定義な部分を含むラインが実行され
ると、実行手段に対して実行を強制的に継続させるコマ
ンドを送出可能とする手段とを備えたプログラムテスト
装置。
(1) A means for extracting a source-level program line by line and sequentially interpreting and executing it, and when the execution means executes a line that includes an undefined part, forcing the execution means to continue execution. A program test device comprising means for sending a command to perform the program.
(2)前記コマンド送出手段から送られるコマンドは、
ソースプログラムの未定義な部分に対応して予め設定し
ておいた値を返すコマンドであって、ソースプログラム
リスト上に予め記述され、未定義部分を実行手段が実行
すると自動的に該コマンドが実行される特許請求の範囲
第1項記載のプログラムテスト装置。
(2) The command sent from the command sending means is:
This is a command that returns a preset value corresponding to an undefined part of a source program, and is written in advance on the source program list, and the command is automatically executed when the execution means executes the undefined part. A program test device according to claim 1.
(3)コマンド送出手段から送られるコマンドは、ソー
スプログラムの未定義な部分に対応した値を返したあと
プログラムの実行を再開させるコマンドであって、未定
義部分を実行手段が実行するとプログラムの実行を一旦
停止して、前記コマンドの手動による入力を受け付ける
特許請求の範囲第1項記載のプログラムテスト装置。
(3) The command sent from the command sending means is a command that resumes execution of the program after returning a value corresponding to an undefined portion of the source program, and when the executing means executes the undefined portion, the program is executed. 2. The program test device according to claim 1, wherein the program testing device temporarily stops the program and receives manual input of the command.
JP60249656A 1985-11-06 1985-11-06 Program test equipment Expired - Lifetime JPH0766343B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60249656A JPH0766343B2 (en) 1985-11-06 1985-11-06 Program test equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60249656A JPH0766343B2 (en) 1985-11-06 1985-11-06 Program test equipment

Publications (2)

Publication Number Publication Date
JPS62108338A true JPS62108338A (en) 1987-05-19
JPH0766343B2 JPH0766343B2 (en) 1995-07-19

Family

ID=17196262

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60249656A Expired - Lifetime JPH0766343B2 (en) 1985-11-06 1985-11-06 Program test equipment

Country Status (1)

Country Link
JP (1) JPH0766343B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01136212A (en) * 1987-11-24 1989-05-29 Hitachi Ltd Test system for sequence control program
JPH0228839A (en) * 1988-07-19 1990-01-30 Nec Corp Load module generating system for routine single test processing system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS50114138A (en) * 1974-02-15 1975-09-06
JPS58175061U (en) * 1983-04-06 1983-11-22 凸版印刷株式会社 spelling

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS50114138A (en) * 1974-02-15 1975-09-06
JPS58175061U (en) * 1983-04-06 1983-11-22 凸版印刷株式会社 spelling

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01136212A (en) * 1987-11-24 1989-05-29 Hitachi Ltd Test system for sequence control program
JPH0228839A (en) * 1988-07-19 1990-01-30 Nec Corp Load module generating system for routine single test processing system

Also Published As

Publication number Publication date
JPH0766343B2 (en) 1995-07-19

Similar Documents

Publication Publication Date Title
US6249907B1 (en) Method system and article of manufacture for debugging a computer program by encoding user specified breakpoint types at multiple locations in the computer program
EP0785510B1 (en) Program debugging system for debugging a program having a graphical user interface
WO2008147741A2 (en) In-process debugging using external debugging infrastructure
JP2004326789A (en) Just-my-code debugging method
JPH02272645A (en) Method for supporting program debugging
JPH07175654A (en) Context specifications in callback-style programming
JPH03296145A (en) Method of automatically executing interactive type operation program
JPS62108338A (en) Program testing device
JPS62113244A (en) Program test device
JP4055197B2 (en) Device for analyzing procedures included in the program
JP2007004516A (en) Program debugging method of built-in system
JPH11110256A (en) Device and method for debugging program, and computer readable recording medium recorded with the method for the same
JPH02275539A (en) Debugging system
Johnson The design of a high-level, language-independent symbolic debugging system
JP2004287869A (en) Program execution monitoring device and method
JPS626260B2 (en)
JPH07295612A (en) High-level language sequence instruction program generation part and general sequencer
JPS6292034A (en) Program debugging device
JP3372387B2 (en) Program inspection method
JP2659366B2 (en) Debugging method and device
JPH01152505A (en) Program debugging system for pc
JPH06250884A (en) Device for supporting module test
JPS6292032A (en) Test method for program
JP2006350676A (en) Program debugging method of built-in system
JPH07319730A (en) Test debugging method

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term