JP2011113277A - Apparatus, method and program for testing program - Google Patents

Apparatus, method and program for testing program Download PDF

Info

Publication number
JP2011113277A
JP2011113277A JP2009268772A JP2009268772A JP2011113277A JP 2011113277 A JP2011113277 A JP 2011113277A JP 2009268772 A JP2009268772 A JP 2009268772A JP 2009268772 A JP2009268772 A JP 2009268772A JP 2011113277 A JP2011113277 A JP 2011113277A
Authority
JP
Japan
Prior art keywords
test
module
program
information
input
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
JP2009268772A
Other languages
Japanese (ja)
Other versions
JP5230587B2 (en
Inventor
Koichi Nakagawa
晃一 中川
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2009268772A priority Critical patent/JP5230587B2/en
Publication of JP2011113277A publication Critical patent/JP2011113277A/en
Application granted granted Critical
Publication of JP5230587B2 publication Critical patent/JP5230587B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Testing And Monitoring For Control Systems (AREA)
  • Debugging And Monitoring (AREA)
  • Programmable Controllers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a program testing apparatus to test a program under programmable conditions. <P>SOLUTION: A program to be tested input from an input part is divided into a plurality of modules. Information on each module and variable information used in each module are obtained by analysis. Information on a function to be implemented by each module is acquired from the input part and added to the information on the module to form module information. The module information and variable information are used to generate a test input screen for input of test logic necessary for a program test of each module from the input part. A test program generated from the test logic input on the test input screen is executed, and test results are stored in a test database. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

この発明は、産業プラントのようにポンプやバルブなどの操作器や、流量計・圧力計などのセンサが大量に配置されているシステムにおいて、センサが検出した運転データをオペレータが監視することで、プラントの状態を即時に把握し、操作器を操作することで安定した運転を支援するコンピュータのプログラムを試験するプログラム試験装置に係るものである。   In the present invention, an operator monitors the operation data detected by an operator in a system in which a large number of sensors such as a pump and a valve and sensors such as a flow meter and a pressure gauge are disposed as in an industrial plant. The present invention relates to a program test apparatus that tests a computer program that supports a stable operation by immediately grasping the state of a plant and operating a controller.

プラントはボイラや発電機などの大型の設備が多数あり、各設備にはポンプやバルブといった操作器、圧力計や流量計といったセンサなど、多数の機器が配置される。プラントの運転状態を監視するには、こうした機器がもつ信号を系統図や設備構成図などのGUI(Graphic User Interface)画面に表示されるグラフィックシンボルに割り付け、中央監視室と呼ばれる部屋で現在値を監視し、あるいは機器で生じた故障をメッセージやグラフィック形式でオペレータが確認して、操作器を操作することが行われている。こうしたプラントの現場ではPLC(programmable logic controller)と呼ばれるコンピュータが設置され、センサの値を使って演算を行いながら、オペレータの指示によりプラントの機器の制御を行うプログラムが実行されている。   The plant has a large number of large equipment such as boilers and generators, and each equipment is provided with a number of devices such as operating devices such as pumps and valves and sensors such as pressure gauges and flow meters. In order to monitor the operational status of the plant, the signals of these devices are assigned to graphic symbols displayed on the GUI (Graphic User Interface) screens such as system diagrams and equipment configuration diagrams, and the current value is assigned to a room called the central monitoring room. An operator operates the controller by monitoring or checking a failure occurring in the device in a message or graphic format. A computer called PLC (programmable logic controller) is installed at the site of such a plant, and a program is executed to control plant equipment according to instructions from an operator while performing calculations using sensor values.

こうしたプログラムを試験する場合は、信号の値を模擬するシミュレータを用いて主にオペレータが手動で値を操作・設定を行いながら目視で挙動を確認することが多い。また、プラントは信頼性が重要視されるので、プラントにつながれている信号の全点について確認を行う必要がある。プラントで扱う点数は規模にもよるが数百点から数万点の信号点数をもつものがあり、実施する試験の数が多く、試験するプログラムの規模も大きいためデバッグや保守が難しい。   When testing such a program, it is often the case that the behavior is visually confirmed mainly by an operator manually operating and setting values using a simulator that simulates signal values. Moreover, since reliability is regarded as important for a plant, it is necessary to check all points of signals connected to the plant. Although the number of points handled in a plant depends on the scale, there are some that have hundreds to tens of thousands of signal points, the number of tests to be performed is large, and the scale of the program to be tested is large, so debugging and maintenance are difficult.

このような試験(テスト)において、必要となるテストデータを設定するプログラムを自動生成することにより、テスト費用を削減するものがあった(例えば特許文献1)。テストで必要になるプログラムにはテストデータを設定するプログラムと、プログラムから出力された結果を評価するプログラムの2つがある。特許文献1では、テスト対象ラダー管理部にある試験対象となるプログラム(ラダープログラム)から入出力変数抽出部により入力となる変数を抽出することで、仮想入力ラダー生成部によりテストデータを設定するプログラムを自動的に生成することができる。また、テスト入力シーケンス管理部によりユーザが簡単なコマンドとパラメータを指定するだけで出力結果を評価するプログラムをつくることができ、比較的高度な知識を必要とするラダー言語を知らなくてもテストを行うことができる。   In such a test (test), there has been a test cost reduction by automatically generating a program for setting necessary test data (for example, Patent Document 1). There are two programs required for the test, a program for setting test data and a program for evaluating the result output from the program. In Patent Document 1, a program for setting test data by a virtual input ladder generation unit by extracting a variable to be input by an input / output variable extraction unit from a test target program (ladder program) in a test target ladder management unit Can be generated automatically. In addition, the test input sequence management unit allows users to create a program that evaluates output results by simply specifying commands and parameters, and tests can be performed without knowing a ladder language that requires relatively advanced knowledge. It can be carried out.

特開2005-63425号公報(図2)Japanese Patent Laying-Open No. 2005-63425 (FIG. 2)

特許文献1に開示されている技術によれば、テスト結果を評価するプログラム(手順)の設計はプログラム言語であるラダープログラムの記述方法を知らなくてもよいが、シーケンスプログラムの基本動作や、どのプログラム内のサブモジュールの依存関係や、どの変数がどこで参照されているかなどのプログラム設計者に相当するプログラムの内部情報
がないと設計ができない。
また、テスト結果の検証は正常値との比較といった単純なものだけしか扱うことができないため、複数の条件を組み合せたり、時間や状態変化を考慮するものであったり、ある条件での試験結果を他の条件の入力データとして使ったりするなどプログラマブルな条件を指定することができない。
本発明は、このような課題を解決するためになされたもので、複数の条件を組み合せたり、時間や状態変化を考慮できたり、ある条件での試験結果を他の条件の入力データとして使ったりするなど、プログラマブルな条件でプログラム試験が行えるプログラム試験装置を提供することを目的とする。
According to the technique disclosed in Patent Document 1, the design of a program (procedure) for evaluating a test result does not need to know a description method of a ladder program that is a program language. The design cannot be made without the internal information of the program corresponding to the program designer, such as the dependency relationship of the submodules in the program and which variable is referenced where.
In addition, since verification of test results can only deal with simple things such as comparison with normal values, it is possible to combine multiple conditions, consider time and state changes, or test results under certain conditions. Programmable conditions such as using as input data for other conditions cannot be specified.
The present invention has been made to solve such a problem, and a plurality of conditions can be combined, time and state changes can be taken into account, or test results under certain conditions can be used as input data for other conditions. An object of the present invention is to provide a program test apparatus capable of performing a program test under programmable conditions.

本発明に係るプログラム試験装置は、入力部から入力された試験対象プログラムを複数のモジュールに分割し、この分割されたモジュール毎のモジュールの情報と、モジュール毎に用いられている変数情報とを解析して取得し、モジュール毎に当該モジュールが実現する機能の情報を入力部から取得してモジュールの情報に加えてモジュール情報とし、このモジュール情報と変数情報とをテストデータベースに格納するプログラム解析部と、テストデータベースに格納されたモジュール情報と変数情報とを用いて、モジュール毎にプログラム試験を行うために必要なテストロジックとテストデータとを入力部から入力するためのテスト入力画面を生成してこのテスト入力画面を構成するためのテスト入力画面情報を上記テストデータベースに格納するテスト入力画面生成部と、テスト入力画面情報を用いて表示部にテスト入力画面を表示させるとともに、テスト入力画面を用いて入力されたテストロジックから生成されたテストプログラムと入力されたテストデータをテストデータベースに格納するテスト編集部と、入力されたテストデータを用いてテストプログラムを実行し、テスト結果をテストデータベースに格納するテストプログラム実行部とを備えたものである。   The program test apparatus according to the present invention divides a test target program input from an input unit into a plurality of modules, and analyzes module information for each of the divided modules and variable information used for each module. A program analysis unit that acquires information on the functions realized by the module for each module from the input unit, adds the module information to module information, and stores the module information and variable information in a test database; Using the module information and variable information stored in the test database, generate a test input screen for inputting the test logic and test data necessary for performing the program test for each module from the input unit. Test input screen information for configuring the test input screen in the test database The test input screen generation unit to be sent and the test input screen are displayed on the display unit using the test input screen information, and the test program generated from the test logic input using the test input screen and the input test data In the test database, and a test program execution unit that executes the test program using the input test data and stores the test result in the test database.

この発明によれば、テストに際して、テストロジックをオペレータが入力するようにしたので、複数の条件を組み合せたり、時間や状態変化を考慮できたり、ある条件での試験結果を他の条件の入力データとして使ったりするなど、プログラマブルな条件でプログラム試験が行える。   According to the present invention, since the test logic is input by the operator during the test, a plurality of conditions can be combined, time and state changes can be taken into account, and test results under certain conditions can be input data of other conditions. Program tests can be performed under programmable conditions such as

本発明の実施の形態1によるプログラム試験装置の概要を示すブロック図である。It is a block diagram which shows the outline | summary of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態1によるプログラム試験装置のテストデータベースのデータ構成の一例を示す図である。It is a figure which shows an example of the data structure of the test database of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態1によるプログラム試験装置のハードウエア構成の概要を示すブロック図である。It is a block diagram which shows the outline | summary of the hardware constitutions of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態1によるプログラム試験装置のプログラム解析部の動作の概要を説明するフローチャート図である。It is a flowchart figure explaining the outline | summary of operation | movement of the program analysis part of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態1によるプログラム試験装置のプログラム解析部によって表示する入力画面の一例を示す図である。It is a figure which shows an example of the input screen displayed by the program analysis part of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態1によるプログラム試験装置のモジュール情報の構成の一例を示す図である。It is a figure which shows an example of a structure of the module information of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態1によるプログラム試験装置のテストデータベースの詳細構成の一部を示す図である。It is a figure which shows a part of detailed structure of the test database of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態1によるプログラム試験装置のテスト入力画面の変数情報の入力部分の生成例を示す図である。It is a figure which shows the example of a production | generation of the input part of the variable information of the test input screen of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態1によるプログラム試験装置のテスト入力画面生成部の動作の概要を説明するフローチャート図である。It is a flowchart figure explaining the outline | summary of operation | movement of the test input screen production | generation part of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態1によるプログラム試験装置のテスト入力画面のロジック入力部分の生成例を示す図である。It is a figure which shows the example of a production | generation of the logic input part of the test input screen of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態1によるプログラム試験装置のテスト入力画面の一例を示す図である。It is a figure which shows an example of the test input screen of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態1によるプログラム試験装置のテスト実行結果を表示する画面の一例を示す図である。It is a figure which shows an example of the screen which displays the test execution result of the program test apparatus by Embodiment 1 of this invention. 本発明の実施の形態2によるプログラム試験装置のプログラム解析部の動作の概要を説明するフローチャート図である。It is a flowchart figure explaining the outline | summary of operation | movement of the program analysis part of the program test apparatus by Embodiment 2 of this invention. 本発明の実施の形態2によるプログラム試験装置のプログラム解析部によって表示する入力画面の一例を示す図である。It is a figure which shows an example of the input screen displayed by the program analysis part of the program test apparatus by Embodiment 2 of this invention. 本発明の実施の形態2によるプログラム試験装置のテスト入力画面生成部の動作の概要を説明するフローチャート図である。It is a flowchart figure explaining the outline | summary of operation | movement of the test input screen production | generation part of the program test apparatus by Embodiment 2 of this invention. 本発明の実施の形態2によるプログラム試験装置のテスト入力画面の一例を示す図である。It is a figure which shows an example of the test input screen of the program test apparatus by Embodiment 2 of this invention.

実施の形態1.
図1は本発明の一実施の形態によるプログラム試験装置の概要を示すブロック図である。プログラム試験装置はテストデータベース80と制御部70と、オペレータからデータを入力できる入力部4と、出力結果をグラフィックあるいはテキスト形式で表示する表示部2で構成される。なお、制御部70はコンピュータがプログラムにより実行するものである。すなわち制御部70はプログラム試験プログラムと同義である。入力部4から制御部70にテストに関するデータの入力を行い、その出力結果を表示部2に出力する。入力部4から試験対象プログラム92が入力されると、制御部70は試験対象プログラム92をいくつかのモジュールに分割し、モジュールのもつ変数に設定するテストデータやテストに指定するロジックを機能単位で分割してテストデータベース80に記憶する。また試験対象プログラム92を解析してプログラム中に宣言されている変数の情報をテストデータベース80に格納する。記録したテストプログラムを実行するとテスト実行結果85がテストデータベース80に記憶される。
Embodiment 1 FIG.
FIG. 1 is a block diagram showing an outline of a program test apparatus according to an embodiment of the present invention. The program test apparatus includes a test database 80, a control unit 70, an input unit 4 that can input data from an operator, and a display unit 2 that displays an output result in a graphic or text format. The control unit 70 is executed by a computer using a program. That is, the control unit 70 is synonymous with the program test program. Data related to the test is input from the input unit 4 to the control unit 70, and the output result is output to the display unit 2. When the test target program 92 is input from the input unit 4, the control unit 70 divides the test target program 92 into several modules, and sets the test data to be set in the variable of the module and the logic specified for the test in units of functions. The data is divided and stored in the test database 80. Further, the test object program 92 is analyzed and information on variables declared in the program is stored in the test database 80. When the recorded test program is executed, a test execution result 85 is stored in the test database 80.

テストデータベース80はテストに関するデータを管理する。変数情報81はテストの対象となるプログラムの中でどのような変数があり、その変数がどのように使われているかに関する情報を管理する。モジュール情報82は試験対象プログラム92の中にあるモジュールを機能毎に管理する。またどのモジュールでどの変数が使われているかも管理する。テストプログラム83はテストロジックをスクリプトのような軽量言語を使って記述したもので、モジュール単位で管理されている。テストデータ84はモジュール単位で管理され、各モジュールがもつ変数がテストプログラム83に格納されたテストプログラムごとにどのような値をもつかを格納したものである。テストプログラム83はローダ93によりPLC94で実行できる形式に変換されてPLC94上で実行される。実行された結果は関連する機能やテスト実行単位(何月何日の何回目の実行かなど)やバージョン単位で記録してテスト実行結果85として管理する。   The test database 80 manages data related to tests. The variable information 81 manages information regarding what variables are present in the program to be tested and how the variables are used. Module information 82 manages modules in the test target program 92 for each function. It also manages which variables are used in which modules. The test program 83 describes test logic using a lightweight language such as a script, and is managed in units of modules. The test data 84 is managed in units of modules, and stores what values the variables of each module have for each test program stored in the test program 83. The test program 83 is converted into a format that can be executed by the PLC 94 by the loader 93 and executed on the PLC 94. The execution result is recorded as a test execution result 85 by recording the related function, test execution unit (month, date, number of times, etc.) or version unit.

本発明の実施の形態1によるプラント試験装置の制御部70は概略以下のように動作する。まず、入力部4から試験対象となる試験対象プログラム92を入力する。試験対象プログラム92は、プログラム解析部75により複数モジュールに分割され、モジュールごとに関連する機能や使われている変数と変数の利用状況が解析される。これらの解析は、例えば、モジュールに分割する部分などは良く知られたプログラム解析ツールなどで行われるが、以下に説明するように、モジュールがどのような機能を果たしているのかなど、解析ツールだけでは解析しきれない部分を、オペレータが関与して解析を行う。ここに本
発明の特徴がある。
The control unit 70 of the plant test apparatus according to Embodiment 1 of the present invention generally operates as follows. First, a test target program 92 to be tested is input from the input unit 4. The test target program 92 is divided into a plurality of modules by the program analysis unit 75, and the functions related to each module and the variables used and the usage status of the variables are analyzed. These analyzes are performed by, for example, a well-known program analysis tool for the part divided into modules, etc. However, as explained below, the analysis tool alone is used to explain what functions the module performs. The operator is involved in the analysis of the part that cannot be analyzed. This is the feature of the present invention.

プログラムを解析することにより得られた情報からは各モジュールで使われる変数の属性を知ることができるので、それに合わせてモジュール毎に含まれる変数の入力画面(マークアップテキスト生成)を構成する。このとき各変数には別名が自動的に、あるいは入力画面からの入力によって付加される。この別名はテストを記述するときに変数を特定するために使うものである。また、変数の説明などもオペレータによって入力され、別名とともに変数情報81の一部としてテストデータベース80に格納される。ただし、変数情報は、解析によって得られる情報のみで十分な場合もあり、常に入力によって得る必要はない。   From the information obtained by analyzing the program, it is possible to know the attributes of the variables used in each module, and accordingly, the variable input screen (markup text generation) included in each module is configured. At this time, an alias is added to each variable automatically or by input from the input screen. This alias is used to identify variables when writing tests. In addition, a description of the variable is also input by the operator, and stored in the test database 80 as a part of the variable information 81 together with the alias. However, the variable information may be sufficient only by information obtained by analysis, and does not always need to be obtained by input.

プログラムの解析がすべて完了すると、テスト入力画面生成部71によりテストデータやテストロジックを入力する画面が生成される。入力画面はHTML(Hyper Text Markup Language)などのマークアップ言語を生成することで実現してもよい。
テストデータの入力画面とテストロジックの入力画面は合成されてテスト入力画面として生成され、生成されたテスト入力画面がデータ形式でテスト入力画面情報88としてテストデータベース80に格納される。
When all the program analysis is completed, a screen for inputting test data and test logic is generated by the test input screen generation unit 71. The input screen may be realized by generating a markup language such as HTML (Hyper Text Markup Language).
The test data input screen and the test logic input screen are combined and generated as a test input screen, and the generated test input screen is stored in the test database 80 as test input screen information 88 in a data format.

以上で試験対象プログラム92をテストする準備が整った。次に、どのようなテストを行うのかを、生成されたテスト入力画面情報88により実際にテスト入力画面を表示部2に表示させ、オペレータが入力部4から必要な情報を入力する。すなわち、テスト編集部73では、生成されたテスト入力画面を使ってテストごとに編集するテストデータと実行するテストのロジックを入力部4からオペレータが入力する。   The preparation for testing the test target program 92 is now complete. Next, a test input screen is actually displayed on the display unit 2 based on the generated test input screen information 88 as to what kind of test is performed, and the operator inputs necessary information from the input unit 4. That is, in the test editing unit 73, an operator inputs test data to be edited for each test and a test logic to be executed from the input unit 4 using the generated test input screen.

入力画面から入力されるテストロジックはマークアップ言語とは別にECMAのJavaScript(登録商標)やMicrosoft 社のVBScriptやAdobe社のActionScriptのようなマークアップ
内に記述可能なスクリプトとして入力される。このようなスクリプトはコンパイル不要な言語で、軽量言語と呼ばれている。上記した変数の別名を使って制御構文などを使ってテストの検証ロジックを記述する。このように、テストロジックを、制御構造を有する軽量言語で記述できるので、機械語に近い低度な表現力しか有さないラダープログラムでは記述し難かった検証ロジックを簡単に記述することができる。テスト編集部73は入力されたロジックと、別名でプログラムの変数にアクセスするためのプログラムを結合してテストプログラム83を生成してテストデータ84とともにテストデータベース80に記録する。
テストプログラム実行部74はテストデータベース80に記録されたテストデータ84を用いてテストプログラム83を実行することによりテストを実行しテスト実行結果85をテストデータベース80に記録する。
In addition to the markup language, the test logic input from the input screen is input as a script that can be written in markup such as JavaScript (registered trademark) of ECMA, VBScript of Microsoft, or ActionScript of Adobe. Such a script is a language that does not require compilation and is called a lightweight language. Write test validation logic using control syntax, etc., using the above variable aliases. As described above, since the test logic can be described in a lightweight language having a control structure, it is possible to easily describe the verification logic that is difficult to describe in a ladder program having only a low level of expressive power similar to a machine language. The test editing unit 73 combines the input logic and a program for accessing a program variable by another name to generate a test program 83 and records it in the test database 80 together with the test data 84.
The test program execution unit 74 executes the test by executing the test program 83 using the test data 84 recorded in the test database 80 and records the test execution result 85 in the test database 80.

以上のステップのうち、テストを準備するまでのステップでは、例えば変数の説明や機能などの入力は試験対象プログラムのプログラム知識を有するオペレータが行う必要があるが、どのようなテストを行うのかを入力したり、テストを実行したりするステップ、すなわち実際にプログラム試験を行う段階では、試験対象プログラムのプログラム知識を有しないオペレータでも、軽量言語など最低限の知識を有していれば実施することができる。   Of the above steps, until the test is prepared, for example, it is necessary for an operator having program knowledge of the test target program to input explanations and functions of variables, but input what kind of test is to be performed. Or in the step of executing a test, that is, in the stage of actually performing a program test, even an operator who does not have the program knowledge of the test target program can perform it if it has a minimum knowledge such as a lightweight language. it can.

図2に、テストデータベースの具体的な構成を示す。図2に示すように、テストデータベース80はプログラムごとにモジュール情報82を格納するモジュール情報領域820と、モジュール毎に変数情報81を格納する変数情報領域810とをもち、モジュールの識別情報である要素IDを格納する要素ID領域87を有している。またモジュールごとにテスト情報を格納するテスト情報領域86をもち、テスト情報領域86にはモジュール
で使われるすべてのテストデータ84とテストプログラム83が格納されている。モジュール情報領域820にはプログラムの解析単位であるプログラムの部分(行番号のどこからどこまで)や直接関連する機能などが記憶されており、各モジュールのモジュール情報領域に変数情報領域810、テスト情報領域86を有している。変数情報領域810には各モジュールで使われている変数に関する属性(名称、型名、別名など)や、変数の使用状況(入力変数、出力変数、値の参照)が記憶されている。このように、各情報は、モジュール毎に関連付けて格納されており、モジュール情報にはそのモジュールが実現する機能の情報も含まれているため、結局各情報は機能ごとに管理されることになる。
FIG. 2 shows a specific configuration of the test database. As shown in FIG. 2, the test database 80 has a module information area 820 for storing module information 82 for each program and a variable information area 810 for storing variable information 81 for each module, and is an element that is module identification information. It has an element ID area 87 for storing the ID. Each module has a test information area 86 for storing test information. The test information area 86 stores all test data 84 and test programs 83 used in the module. The module information area 820 stores a program part (from where to where in the line number) that is a program analysis unit, a directly related function, and the like. have. The variable information area 810 stores attributes (names, type names, aliases, etc.) related to variables used in each module, and variable usage conditions (input variables, output variables, value references). In this way, each piece of information is stored in association with each module, and the module information includes information on the functions realized by the module, so that each piece of information is eventually managed for each function. .

図1のプログラム試験装置を、CPUなどを用いて実現した場合のハードウエア構成を図3に示す。図3において、CPU1には、メモリ3、ディスプレイ21などの表示部2、キーボード41やマウス42などの入力部4、ハードティスク8が接続される。ハードディスク8には、図1の制御部70の機能を果たすプログラム試験プログラムとテストデータベース80、オペレーティングシステム(OS)90が記録されている。プログラム試験プログラム(制御部)70は、例えば記憶媒体からハードディスク8にインストールされる。図3では、CD−ROMドライブ5を介してCD−ROMからインストールされる例を示している。   FIG. 3 shows a hardware configuration when the program test apparatus of FIG. 1 is realized using a CPU or the like. In FIG. 3, a memory 3, a display unit 2 such as a display 21, an input unit 4 such as a keyboard 41 and a mouse 42, and a hard disk 8 are connected to the CPU 1. The hard disk 8 stores a program test program, a test database 80, and an operating system (OS) 90 that perform the functions of the control unit 70 shown in FIG. The program test program (control unit) 70 is installed in the hard disk 8 from a storage medium, for example. FIG. 3 shows an example of installation from a CD-ROM via the CD-ROM drive 5.

図4に、制御部(プログラム試験プログラム)70のプログラム解析部75の動作の概要をフローチャートにして示す。プログラム試験プログラム70は、オペレーティングシステム90と協働して処理を行う。まず、キーボードから、試験対象となる試験対象プログラム92を入力する(ST01)。プログラムの入力は、入力部4のキーボードから入力したり、CD−ROMなどの記憶媒体からファイル形式で読み込むなどして行われる。CPU1は入力された試験対象プログラム92をディスプレイ上に表示する。表示された試験対象プログラムの一例を図5に示す。図5に示すように、試験対象プログラムとともに、プログラムIDや後述する要素ID、また機能名などオペレータが入力するための入力ボックス、あるいは変数情報なども表示される。   FIG. 4 is a flowchart showing an outline of the operation of the program analysis unit 75 of the control unit (program test program) 70. The program test program 70 performs processing in cooperation with the operating system 90. First, a test target program 92 to be tested is input from the keyboard (ST01). The program is input by inputting it from the keyboard of the input unit 4 or reading it in a file format from a storage medium such as a CD-ROM. The CPU 1 displays the input test target program 92 on the display. An example of the displayed test target program is shown in FIG. As shown in FIG. 5, along with the test target program, an input box for operator input such as a program ID, an element ID described later, a function name, or variable information is also displayed.

解析するプログラムがそこで終了すれば処理を終了し、そうでなければ次の処理を行う(ST02)。試験対象プログラムは、一般に用いられているプログラム解析ツールなどと同様の方法でモジュールと呼ばれる部分に分割され、モジュールに付加する要素IDが生成される(ST03)。図5の例では、モジュールに対して137222という要素IDが生成されたことを示している。要素IDは、分割した各モジュールに対してテストデータベースがシステム内で識別するために設ける識別子である。例えば、機能やモジュール番号、プログラム番号などにIDをつけ、それを数ビット単位で割りつけるといった形にすると検索効率がよくなる。   If the program to be analyzed ends there, the process ends. If not, the next process is performed (ST02). The test target program is divided into portions called modules by a method similar to a commonly used program analysis tool, and an element ID added to the module is generated (ST03). The example of FIG. 5 shows that an element ID of 137222 has been generated for the module. The element ID is an identifier provided for the test database to identify each divided module in the system. For example, if an ID is assigned to a function, module number, program number, etc., and assigned in units of several bits, search efficiency is improved.

入力したプログラムの解析範囲や関連する機能名をオペレータが入力する(ST04)。これら解析範囲や機能名などは、オペレータが決定するものであってプログラム試験プログラム自体では判断や生成ができないため、オペレータが入力する。解析範囲の入力は、試験対象プログラムがラダープログラムであれば、プログラムソースやラダー命令の開始行と終了行を指定することで行われる。また、機能名は文字列を使って入力する。図5の例では「ポンプ運転」を機能名として入力している。   The operator inputs the analysis range of the input program and the related function name (ST04). These analysis ranges and function names are determined by the operator and cannot be determined or generated by the program test program itself, so the operator inputs them. When the test target program is a ladder program, the analysis range is input by designating the start line and end line of the program source or ladder instruction. The function name is entered using a character string. In the example of FIG. 5, “pump operation” is input as the function name.

図6はテストデータベースにおける要素IDを記憶させた領域である要素ID領域87に格納されている情報の一例を示したもので、最上段の要素IDはプログラムのIDが01で機能ID(機能の識別情報)は10、このプログラム01におけるモジュールのシリアル番号は01であることを示している。この値を16進として 0x011001と処理すると10進で69633の値が算出できる。このように、各モジュールは機能と関連付けて管理されている。   FIG. 6 shows an example of information stored in an element ID area 87, which is an area where element IDs are stored in the test database. The uppermost element ID is a program ID 01 and a function ID (function ID). (Identification information) is 10, indicating that the serial number of the module in this program 01 is 01. If this value is converted to hexadecimal and processed as 0x011001, a value of 63633 can be calculated in decimal. Thus, each module is managed in association with the function.

また、プログラムIDが01のプログラムは、IDが01、02、13、64、45のモジュールで構成されており、01、02、13のモジュールによって機能IDが10の機能を、64、45のモジュールによって機能IDが11の機能を実現するプログラムであることを示している。同様に、プログラムIDが02のプログラムは、IDが05、11、23のモジュールから構成されており、これらのモジュールで機能IDが20の機能を実現するプログラムであることを示している。プログラムIDが03のプログラムはIDが08、09、18のモジュールから構成されており、08のモジュールで機能IDが01の機能を、09のモジュールで02の機能を、18のモジュールで03の機能を実現するプログラムであることを示している。   The program with the program ID 01 is composed of modules with IDs 01, 02, 13, 64, and 45. The functions with the function ID 10 by the modules 01, 02, 13 and the modules with 64 and 45 are provided. Indicates that the program realizes the function having the function ID of 11. Similarly, a program with a program ID of 02 is composed of modules with IDs of 05, 11, and 23, and indicates that these modules realize a function with a function ID of 20. The program with the program ID 03 is composed of modules with IDs 08, 09, and 18. The function with the function ID 01 with the module 08, the function 02 with the module 09, and the function 03 with the 18 module. It shows that it is a program that realizes.

以上のように、プログラム解析部75により、試験対象プログラムはモジュールに分割されるが、機能名はオペレータが名づけるものであり、オペレータが名づけた機能がどのモジュールで実行されるのかはプログラム解析部75が自動で判断することはできない。従って、上記したように、オペレータがモジュール毎に機能名を入力することで、図6のような情報が得られる、すなわち、試験対象プログラムの解析にオペレータが関与することで、例えば機能ごとのプログラム試験が行えるようになるなど、効率的でより実際の動作に近い状況でプログラム試験が実行できるようになる。   As described above, the program to be tested is divided into modules by the program analysis unit 75, but the function name is what the operator names, and the program analysis unit 75 determines which module the function named by the operator is executed. Cannot be judged automatically. Therefore, as described above, when the operator inputs the function name for each module, information as shown in FIG. 6 is obtained. That is, the operator is involved in the analysis of the test target program, for example, the program for each function. Program tests can be executed in a situation that is more efficient and closer to actual operation, such as being able to perform tests.

次にモジュールにおける変数の解析を行い、変数情報81を変数情報領域810に格納する。図7に示す変数情報領域810に記述されている変数情報がテストデータベース80における変数情報の例であり、ここではこのモジュールには変数M02、M24、B02、B36が検出されている。変数M02などはラダープログラムにおけるメモリアドレスの識別子であり、プログラムを記述するときによくアドレスが変わることがある。そこでA1などの別名を付けておき、テストを記述する際に使用する。また、この変数M02の型はWORD型16ビット長さの変数で、モジュールの入力変数として使われていることがわかる。なお、使用状況の欄におけるINが入力変数として使用されていることを示し、OUTは出力変数、REFは参照変数として使用されていることを示す。   Next, the variable in the module is analyzed, and the variable information 81 is stored in the variable information area 810. The variable information described in the variable information area 810 shown in FIG. 7 is an example of variable information in the test database 80. Here, variables M02, M24, B02, and B36 are detected in this module. The variable M02 and the like are memory address identifiers in the ladder program, and the address often changes when the program is written. Therefore, an alias such as A1 is given and used when writing a test. Also, it can be seen that the type of the variable M02 is a WORD type 16-bit variable and is used as an input variable of the module. In the usage status column, IN indicates that it is used as an input variable, OUT indicates that it is used as an output variable, and REF indicates that it is used as a reference variable.

以上の解析により得られた変数情報81からは各モジュールで使われる変数の属性を知ることができるので、それに合わせてモジュール毎に含まれる変数の入力画面(マークアップテキスト生成)を構成する(ST06)。モジュール毎に入力画面を構成するのは、解析により得ることができない変数の情報をオペレータにより入力させるためである。図8は変数情報からマークアップ言語を使って画面を生成した例である。既成のテンプレートのような画面を用意することで簡単に画面を生成することができる。このとき各変数には別名が自動的に、あるいはオペレータの入力により作成される。この別名はテストを記述するときに変数を特定するために使うものである。図8の入力画面の例では、オペレータによって変数の説明を入力させるようにしている。ただし、前述のように、変数情報は解析によって得られる情報のみで十分な場合もあり、必ずしも入力画面を構成して入力によって得る必要はない。   Since the variable information 81 obtained by the above analysis can know the attribute of the variable used in each module, the variable input screen (markup text generation) included in each module is configured accordingly (ST06). ). The reason why the input screen is configured for each module is to allow the operator to input information on variables that cannot be obtained by analysis. FIG. 8 shows an example in which a screen is generated from variable information using a markup language. A screen can be easily generated by preparing a screen like a ready-made template. At this time, an alias is created for each variable automatically or by operator input. This alias is used to identify variables when writing tests. In the example of the input screen shown in FIG. 8, an explanation of the variable is input by the operator. However, as described above, the variable information may be sufficient only by the information obtained by the analysis, and it is not always necessary to configure the input screen and input it.

図5の例では、この変数に関する入力画面を、モジュールの機能名などを入力する画面と同時に表示している。図5の太線枠がオペレータによって入力する情報であり、ここでは、変数の別名もオペレータにより入力するようになっている。これら入力された変数の情報は、解析により得られた変数情報とともに変数情報領域810に格納される。   In the example of FIG. 5, the input screen regarding this variable is displayed simultaneously with the screen for inputting the function name of the module. The thick line frame in FIG. 5 is information input by the operator. Here, the alias of the variable is also input by the operator. Information on these input variables is stored in the variable information area 810 together with the variable information obtained by the analysis.

以上で、試験対象プログラム92の解析が完了し、テストに必要なプログラムの情報が得られた。次に、テストに必要なテストの情報、すなわちどのようなテストを行うのかをオペレータが入力するためのテスト入力画面を生成する。図9に、テスト入力画面生成部71の動作をフローチャートにして示す。まず、キーボードから対象となるプログラムを
入力する(ST10)。対象となるプログラムにテスト入力画面を生成するための解析を行うモジュールがなければ終了し、そうでない場合は次の処理を行う(ST11)。
次に、プログラムのもつモジュールの解析されていない最初の要素IDを取得してモジュールを読み込む(ST12)。次に作成するテスト入力画面を識別するテスト番号を入力する(ST13)。
Thus, the analysis of the test target program 92 is completed, and information on the program necessary for the test is obtained. Next, a test input screen for the operator to input test information necessary for the test, that is, what kind of test is to be performed, is generated. FIG. 9 is a flowchart showing the operation of the test input screen generation unit 71. First, the target program is input from the keyboard (ST10). If the target program does not have a module that performs analysis for generating a test input screen, the process ends. If not, the following process is performed (ST11).
Next, the first element ID that is not analyzed of the module of the program is acquired and the module is read (ST12). Next, a test number for identifying a test input screen to be created is input (ST13).

ステップ14(ST14)では変数を解析してテストに必要な変数の値などを入力させるためのテストデータの入力画面を生成する。変数の入力画面が生成されると、次に各モジュールのテストロジックの入力画面が生成される(ST15)。このテストロジックの入力画面は、例えばマークアップ言語を使って生成する。上記した変数の別名を使って制御構文などを用いてテストのロジックを記述する。テストデータの入力画面とテストロジックの入力画面は合成されてテスト入力画面として生成され(ST16)、その画面を構成するのに必要なデータがテスト入力画面情報88としてテストデータベース80に格納される。   In step 14 (ST14), a variable is analyzed and a test data input screen for generating a variable value necessary for the test is generated. When the variable input screen is generated, the test logic input screen of each module is then generated (ST15). The test logic input screen is generated using, for example, a markup language. Describe the logic of the test using the control syntax etc. using the above aliases of variables. The test data input screen and the test logic input screen are combined and generated as a test input screen (ST16), and data necessary to configure the screen is stored in the test database 80 as test input screen information 88.

図10はモジュール情報82から生成されたテスト入力画面におけるテストロジックの入力画面部分を示したものである。ここでは変数情報81で定義された別名を用いて、簡易言語のような軽量言語を使ってロジック if( A3&A4 == true) { assert( A2 == A1+100
); } を記述している。これはビット型変数であるA3とA4のいずれかがtrueであるとき、WORD型の変数A2がWORD型の変数A1より100大きい数でない場合が異常であること
を検出するロジックである。このようなテストロジックは、試験毎にオペレータが決める必要があり、テスト入力画面生成部71によって自動で生成することはできないため、入力画面によってオペレータが入力するように構成している。このようにプログラマブルな条件を指定できるように構成することで、複雑な条件など、種々の状態を模擬した試験が行えるようになる。
FIG. 10 shows the input screen portion of the test logic in the test input screen generated from the module information 82. Here, using the alias defined in the variable information 81, the logic if (A3 & A4 == true) {assert (A2 == A1 + 100) using a lightweight language such as a simple language.
);} Is described. This is logic for detecting that when either of the bit type variables A3 and A4 is true, it is abnormal if the WORD type variable A2 is not a number 100 larger than the WORD type variable A1. Such a test logic needs to be determined by the operator for each test and cannot be automatically generated by the test input screen generation unit 71. Therefore, the test logic is configured to be input by the operator on the input screen. By configuring so that programmable conditions can be specified in this way, tests simulating various states such as complicated conditions can be performed.

図11は生成されたテスト入力画面の例である。ここでは、このモジュールに関連するプログラム名は”A水処理場“、機能名は”水処理“であり、モジュールで使用されている変数へのテストデータ入力画面部などが表示されている。テストデータやロジックは画面にある編集ボタンを押すことで編集モードに切り替わり編集が行えるようになる。   FIG. 11 shows an example of the generated test input screen. Here, the program name related to this module is “A water treatment plant”, the function name is “water treatment”, and a test data input screen section for variables used in the module is displayed. Test data and logic can be edited by switching to the edit mode by pressing the edit button on the screen.

次に、実際にテストを行う場合、テスト編集部73が、テスト入力画面情報88を用いて、表示部2に図11の例で示すようなテスト入力画面を表示させ、オペレータにテストロジックや必要なテストデータを入力させる。入力されたテストロジックと、別名でプログラムの変数にアクセスするためのプログラムを結合してテストプログラム83を生成して、入力された変数データなどのテストデータ84とともにテストデータベース80に記録する。   Next, when the test is actually performed, the test editing unit 73 displays the test input screen as shown in the example of FIG. 11 on the display unit 2 using the test input screen information 88, and the test logic and necessary are displayed to the operator. To input correct test data. A test program 83 is generated by combining the input test logic and a program for accessing a program variable by another name, and recorded in the test database 80 together with the test data 84 such as the input variable data.

このようにしてテストプログラム83およびテストデータ84が整った後、オペレータにより実行ボタンが押されると、テストプログラム実行部74がテストデータベース80に記録されたテストデータ84と軽量言語のような簡易言語で記述されたテストプログラム83を読み込んで、ローダ93にテストプログラム83とテストデータ84を送り、ローダ93がPLC94で実行可能な形式に変換してPLC94上でテストが実行される。テストが実行されると、テストプログラム実行部74がPLC94のメモリーにある実行結果のデータを受け取り、テスト実行結果85をテストデータベース80に記録する。また、テスト結果は表示部2に表示させることもできる。このようにして、テストプログラム実行部74では、PLC94上でテストプログラムを実行させるとともに、テストの実行結果を機能ごと、テスト実行単位で管理することができる。   After the test program 83 and the test data 84 are prepared in this way, when the execution button is pressed by the operator, the test program execution unit 74 uses the test data 84 recorded in the test database 80 and a simple language such as a lightweight language. The described test program 83 is read, the test program 83 and test data 84 are sent to the loader 93, and the loader 93 converts it into a format that can be executed by the PLC 94, and the test is executed on the PLC 94. When the test is executed, the test program execution unit 74 receives the execution result data in the memory of the PLC 94 and records the test execution result 85 in the test database 80. In addition, the test result can be displayed on the display unit 2. In this way, the test program execution unit 74 can execute the test program on the PLC 94 and manage the test execution result for each function in units of test execution.

図12はテストデータベース80にあるテスト実行結果85の例である。これによればA水処理場に関するテストが1日単位で実行され、9月9日のテストではモジュール34
と56についてはテストが成功していないが、次の日の9月10日のテストでは各モジュールのバージョンがともに0.8から1.0、1.1から2.0に更新されることでテストがクリアされていることがわかる。このようにテスト結果を一元的に管理することで機能単位、モジュール単位、日時単位といった側面で多角的に分析を行えるため試験の効率化をはかることが可能になる。
FIG. 12 shows an example of the test execution result 85 in the test database 80. According to this, the test for the A water treatment plant is executed in units of one day, and in the test on September 9, module 34
Tests for 56 and 56 have not been successful, but in the next day's test on September 10, the version of each module has been updated from 0.8 to 1.0 and 1.1 to 2.0. Recognize. By managing the test results centrally in this way, analysis can be performed in a multifaceted manner in terms of functional units, module units, and date / time units, so that the efficiency of the test can be improved.

以上説明したように、本実施の形態1によれば、プログラム解析部が自動で解析により得ることができないモジュール情報や変数情報の一部を、オペレータに入力させることで得ることができ、さらに、オペレータにテストロジックとテストデータを入力させることにより、複数の条件を組み合せたり、時間や状態変化を考慮したり、ある条件での試験結果を他の条件の入力データとして使ったりするなどプログラマブルな条件でプログラム試験が行える効果がある。   As described above, according to the first embodiment, it is possible to obtain a part of module information or variable information that cannot be obtained by analysis by the program analysis unit automatically by an operator, Programmable conditions such as combining multiple conditions by taking the test logic and test data into the operator, taking into account time and state changes, and using test results under certain conditions as input data for other conditions Has the effect of being able to perform a program test.

実施の形態2.
図13は、本発明の実施の形態2によるプログラム試験装置のプログラム解析部75の動作の概要を説明するフローチャート図である。各機能は、機能同士で関連する場合がある。例えばある機能の出力値が別の機能の入力になったり、ある機能の出力値により別の機能の判断が変化したり、といった様に、相互に他の機能に依存することが多い。このような依存関係は、プログラムの解析によるだけでは抽出できない場合が多い。このため、オペレータに依存関係を入力させて、依存関係を明確にしておくことで、プログラム試験が、より効率的に実行できることになる。
Embodiment 2. FIG.
FIG. 13 is a flowchart for explaining the outline of the operation of the program analysis unit 75 of the program test apparatus according to Embodiment 2 of the present invention. Each function may be related between functions. For example, an output value of a certain function is an input to another function, or a judgment of another function is changed depending on an output value of a certain function. In many cases, such dependency cannot be extracted only by analyzing a program. For this reason, the program test can be executed more efficiently by allowing the operator to input the dependency relationship and clarifying the dependency relationship.

図13において、ステップ08(ST08)、09(ST09)以外は実施の形態1の図4と同様である。これらステップ08、09が、プログラム解析部75において依存関係を入力するステップである。依存するモジュールがなければ次の処理に移る(ST08)が、このモジュールが依存する他のモジュールがあればその要素IDを入力する(ST09)。実際には、図14に示すように、依存するモジュールを入力させるボックスを用意することで行われる。図14の例では、依存するモジュールとして要素ID69634のモジュールを指定して
いる。つまり要素ID69634のモジュールは要素ID137222のモジュールから呼び出され
るモジュールとなる。この情報は、モジュール情報に格納される。なお、依存関係は、モジュールではなく、依存する機能を入力させるようにしても良い。依存する機能がわかれば依存するモジュールが抽出できるからである。この場合、機能のIDまたは機能名を入力させることになる。
13 is the same as FIG. 4 of the first embodiment except for steps 08 (ST08) and 09 (ST09). These steps 08 and 09 are steps for inputting dependency relations in the program analysis unit 75. If there is no dependent module, the process proceeds to the next process (ST08). If there is another module on which this module depends, the element ID is input (ST09). Actually, as shown in FIG. 14, it is performed by preparing a box for inputting a dependent module. In the example of FIG. 14, the module of element ID 69634 is specified as the dependent module. That is, the module with the element ID 69634 is a module called from the module with the element ID 137222. This information is stored in module information. Note that the dependency relationship may be input not by the module but by the dependent function. This is because the dependent module can be extracted if the dependent function is known. In this case, the function ID or function name is input.

図15は、本発明の実施の形態2によるプログラム試験装置のテスト入力画面生成部の動作の概要を説明するフローチャート図である。図15において、ステップ17(ST17)、18(ST18)以外は実施の形態1の図9と同様である。これらステップ17、18が、テスト入力画面生成部において、依存関係を判断して対応する入力画面を生成するステップである。入力画面を生成するモジュールのモジュール情報に、他のモジュールに依存する情報があるかどうか判断し(ST17)ある場合は、関連するモジュール(あるいはそのモジュールが実行する機能)の入力画面へのハイパーリンクを生成する(ST18)。ステップ14で生成されたテストデータの入力画面とステップ15で生成されたテストロジックの入力画面、およびステップ18で生成された関連するモジュールの入力画面は合成されてテスト入力画面として生成され、その画面を構成するためのデータがテスト入力画面情報88としてテストデータベース80に格納される。   FIG. 15 is a flowchart illustrating an outline of the operation of the test input screen generation unit of the program test apparatus according to the second embodiment of the present invention. 15 is the same as FIG. 9 of the first embodiment except for steps 17 (ST17) and 18 (ST18). These steps 17 and 18 are steps in which the test input screen generation unit determines the dependency and generates a corresponding input screen. If the module information of the module that generates the input screen contains information that depends on other modules (ST17), if there is a hyperlink to the input screen of the related module (or the function that the module executes) Is generated (ST18). The test data input screen generated in step 14, the test logic input screen generated in step 15, and the related module input screen generated in step 18 are synthesized and generated as a test input screen. Is stored in the test database 80 as test input screen information 88.

図16に生成されたテスト入力画面の例を示す。ここでは、実施の形態1の図11と同様、このモジュールに関連するプログラム名は”A水処理場“、機能名は”水処理“であり、モジュールで使用されている変数へのテストデータ入力画面部などが表示されている。テストデータやロジックは画面にある編集ボタンを押すことで編集モードに切り替わり編集が行えるようになる。加えて、「依存関係にある機能」の欄が設けられ、この欄に関連する機能の入力画面へのハイパーリンクが表示されている。   FIG. 16 shows an example of the test input screen generated. Here, as in FIG. 11 of the first embodiment, the program name related to this module is “A water treatment plant”, the function name is “water treatment”, and test data is input to variables used in the module. The screen section is displayed. Test data and logic can be edited by switching to the edit mode by pressing the edit button on the screen. In addition, a “depending function” column is provided, and a hyperlink to an input screen for a function related to this column is displayed.

次に、実際にテストを行う場合、実施の形態1と同様、テスト編集部73が、テスト入力画面情報88を用いて、表示部2に図16の例で示すようなテスト入力画面を表示させ、オペレータにテストロジックや必要なテストデータを入力させる。入力されたテストロジックと、別名でプログラムの変数にアクセスするためのプログラムを結合してテストプログラム83を生成して、入力された変数データなどのテストデータ84とともにテストデータベース80に記録する。   Next, when the test is actually performed, the test editing unit 73 displays the test input screen as shown in the example of FIG. 16 on the display unit 2 using the test input screen information 88 as in the first embodiment. , Let the operator input test logic and necessary test data. A test program 83 is generated by combining the input test logic and a program for accessing a program variable by another name, and recorded in the test database 80 together with the test data 84 such as the input variable data.

このようにしてテストプログラム83およびテストデータ84が整った後、オペレータにより実行ボタンが押されると、テストプログラム実行部74がテストデータベース80に記録されたテストデータ84と軽量言語のような簡易言語で記述されたテストプログラム83を読み込んで、ローダ93にテストプログラム83とテストデータ84を送り、ローダ93がPLC94で実行可能な形式に変換してPLC94上でテストが実行される。テストが実行されるとテストプログラム実行部74がPLC94のメモリーにある実行の結果のデータを受け取り、テスト実行結果85をテストデータベース80に記録する。また、テスト結果は表示部2に表示させることもできる。このようにして、テストプログラム実行部74では、PLC94上でテストプログラムを実行させるとともに、テストの実行結果を機能ごと、テスト実行単位で管理することができる。   After the test program 83 and the test data 84 are prepared in this way, when the execution button is pressed by the operator, the test program execution unit 74 uses the test data 84 recorded in the test database 80 and a simple language such as a lightweight language. The described test program 83 is read, the test program 83 and test data 84 are sent to the loader 93, and the loader 93 converts it into a format that can be executed by the PLC 94, and the test is executed on the PLC 94. When the test is executed, the test program execution unit 74 receives the execution result data in the memory of the PLC 94 and records the test execution result 85 in the test database 80. In addition, the test result can be displayed on the display unit 2. In this way, the test program execution unit 74 can execute the test program on the PLC 94 and manage the test execution result for each function in units of test execution.

以上説明したように、本実施の形態2によれば、実施の形態1と同様、プログラム解析部が自動で解析できないモジュール情報や変数情報の一部を、オペレータに入力させることで得ることができ、さらに、オペレータによりテストロジックを入力させることにより、複数の条件を組み合せたり、時間や状態変化を考慮したり、ある条件での試験結果を他の条件の入力データとして使ったりするなどプログラマブルな条件でプログラム試験が行える。本実施の形態2では、これに加えて、依存関係にある機能をテストすることができるため、テスト結果に異常があり、試験対象プログラムにバグがある可能性があると判断された場合など、依存関係にある機能のテストも行うことで、効率的にバグ検索を行うことができる。   As described above, according to the second embodiment, as in the first embodiment, it is possible to obtain a part of module information or variable information that cannot be analyzed automatically by the program analysis unit by causing the operator to input it. In addition, by inputting test logic by the operator, programmable conditions such as combining multiple conditions, considering time and state changes, and using test results under certain conditions as input data for other conditions A program test can be performed at. In the second embodiment, in addition to this, since it is possible to test the function in the dependency relationship, when it is determined that there is an abnormality in the test result and there is a possibility that the test target program has a bug, etc. You can search for bugs efficiently by testing the functions that have dependencies.

2:表示部 4:入力部
70:制御部 71:テスト入力画面生成部
73;テスト編集部 74:テストプログラム実行部
80:テストデータベース 81:変数情報
82:モジュール情報 83テストプログラム
84:テストデータ 92:試験対象プログラム
2: Display unit 4: Input unit 70: Control unit 71: Test input screen generation unit 73; Test editing unit 74: Test program execution unit 80: Test database 81: Variable information 82: Module information 83 Test program 84: Test data 92 : Test target program

Claims (11)

入力部と表示部と制御部とテストデータベースとを備えたプログラム試験装置において、
上記制御部は、上記入力部から入力された試験対象プログラムを複数のモジュールに分割し、この分割されたモジュール毎に当該モジュールを解析して、モジュールの情報と、上記モジュール毎に用いられている変数情報とを取得し、上記モジュール毎に当該モジュールが実現する機能の情報を上記入力部から取得して上記モジュールの情報に加えてモジュール情報とし、このモジュール情報と上記変数情報とを上記テストデータベースに格納するプログラム解析部と、
上記テストデータベースに格納された上記モジュール情報と上記変数情報とを用いて、上記モジュール毎にプログラム試験を行うために必要なテストロジックとテストデータとを上記入力部から入力するためのテスト入力画面を生成してこのテスト入力画面を構成するためのテスト入力画面情報を上記テストデータベースに格納するテスト入力画面生成部と、
上記テスト入力画面情報を用いて上記表示部に上記テスト入力画面を表示させるとともに、上記テスト入力画面を用いて入力されたテストロジックからテストプログラムを生成し、生成したテストプログラムと入力されたテストデータを上記テストデータベースに格納するテスト編集部と、
上記テストデータベースに格納された上記テストデータを用いて上記テストプログラムを実行し、テスト結果を上記テストデータベースに格納するテストプログラム実行部と
を備えたことを特徴とするプログラム試験装置。
In a program testing apparatus comprising an input unit, a display unit, a control unit, and a test database,
The control unit divides the test target program input from the input unit into a plurality of modules, analyzes the module for each of the divided modules, and uses module information and the modules. Variable information is acquired, information on the function realized by the module for each module is acquired from the input unit and added to the module information as module information, and the module information and the variable information are converted to the test database. A program analysis unit to be stored in
Using the module information and the variable information stored in the test database, a test input screen for inputting test logic and test data necessary for performing a program test for each module from the input unit. A test input screen generator for storing test input screen information for generating and configuring the test input screen in the test database;
The test input screen is displayed on the display unit using the test input screen information, a test program is generated from the test logic input using the test input screen, the generated test program and the input test data A test editing section for storing in the test database,
A program test apparatus comprising: a test program execution unit that executes the test program using the test data stored in the test database and stores a test result in the test database.
プログラム解析部が、モジュールを解析する際に、当該モジュールに依存する他のモジュールの識別情報を入力部から取得し、上記他のモジュールの識別情報を当該モジュールのモジュール情報に加えてテストデータベースに格納することを特徴とする請求項1に記載のプログラム試験装置。   When the program analysis unit analyzes a module, it acquires identification information of another module depending on the module from the input unit, and stores the identification information of the other module in the test database in addition to the module information of the module. The program test apparatus according to claim 1, wherein: プログラム解析部が、モジュールを解析する際に、当該モジュールに依存する他の機能の識別情報を入力部から取得し、上記他の機能の識別情報を当該モジュールのモジュール情報に加えてテストデータベースに格納することを特徴とする請求項1に記載のプログラム試験装置。   When the program analysis unit analyzes a module, it acquires identification information of another function depending on the module from the input unit, and stores the identification information of the other function in the test database in addition to the module information of the module. The program test apparatus according to claim 1, wherein: 入力されるテストロジックは軽量言語で記述されることを特徴とする請求項1に記載の
プログラム試験装置。
2. The program test apparatus according to claim 1, wherein the input test logic is described in a lightweight language.
入力された試験対象プログラムを複数のモジュールに分割するステップと、
この分割されたモジュール毎のモジュールの情報と、これらモジュール毎に用いられている変数情報とを解析して取得するステップと、
上記モジュール毎に当該モジュールが実現する機能の情報を入力部から取得して上記モジュールの情報に加えてモジュール情報とし、このモジュール情報と上記変数情報とをテストデータベースに格納するステップと、
上記テストデータベースに格納された上記モジュール情報と上記変数情報とを用いて、上記モジュール毎にプログラム試験を行うために必要なテストロジックとテストデータとを入力するためのテスト入力画面を生成するステップと、
生成された上記テスト入力画面を表示部に表示させて、上記入力部から入力されたテストロジックからテストプログラムを生成し、この生成されたテストプログラムと上記入力部から入力されたテストデータとを上記テストデータベースに格納するステップと、
上記テストデータベースに格納された上記テストデータを用いて上記テストプログラムを実行し、テスト結果を上記テストデータベースに格納するステップと
を備えたことを特徴とするプログラム試験方法。
Dividing the input program to be tested into a plurality of modules;
Analyzing and obtaining module information for each of the divided modules and variable information used for each module;
Acquiring information on the function realized by the module for each module from the input unit and adding the module information to module information, and storing the module information and the variable information in a test database;
Generating a test input screen for inputting test logic and test data necessary for performing a program test for each module, using the module information and the variable information stored in the test database; ,
The generated test input screen is displayed on the display unit, a test program is generated from the test logic input from the input unit, and the generated test program and the test data input from the input unit are Storing in a test database;
A program test method comprising: executing the test program using the test data stored in the test database and storing a test result in the test database.
当該モジュールに依存する他のモジュールの識別情報を入力部から取得し、上記他のモジュールの識別情報を当該モジュールのモジュール情報に加えてテストデータベースに格納するステップをさらに備えたことを特徴とする請求項5に記載のプログラム試験方法。   The method further comprises the step of acquiring identification information of another module depending on the module from the input unit, and storing the identification information of the other module in a test database in addition to the module information of the module. Item 6. The program test method according to Item 5. 当該モジュールに依存する他の機能の識別情報を入力部から取得し、上記他の機能の識別情報を当該モジュールのモジュール情報に加えてテストデータベースに格納するステップをさらに備えたことを特徴とする請求項5に記載のプログラム試験装置。   The method further comprises the step of acquiring identification information of another function depending on the module from the input unit, and storing the identification information of the other function in a test database in addition to the module information of the module. Item 6. The program test apparatus according to Item 5. 入力されるテストロジックは軽量言語で記述されることを特徴とする請求項5に記載のプログラム試験方法。   6. The program test method according to claim 5, wherein the input test logic is described in a lightweight language. 入力された試験対象プログラムを複数のモジュールに分割する手順と、
この分割されたモジュール毎のモジュールの情報と、これらモジュール毎に用いられている変数情報とを解析して取得する手順と、
上記モジュール毎に当該モジュールが実現する機能の情報を入力部から取得して上記モジュールの情報に加えてモジュール情報とし、このモジュール情報と上記変数情報とをテストデータベースに格納する手順と、
上記テストデータベースに格納された上記モジュール情報と上記変数情報とを用いて、上記モジュール毎にプログラム試験を行うために必要なテストロジックとテストデータとを入力するためのテスト入力画面を生成する手順と、
生成された上記テスト入力画面を表示部に表示させ、テストロジックとテストデータとを入力させる手順と、
入力された上記テストロジックからテストプログラムを生成する手順と、
入力された上記テストデータを用いて上記テストプログラムを実行し、テスト結果を上記テストデータベースに格納する手順と、
をコンピュータに実行させることを特徴とするプログラム試験用プログラム。
A procedure for dividing the inputted program to be tested into a plurality of modules;
A procedure for analyzing and obtaining information on the modules for each of the divided modules and variable information used for each module;
For each module, information on the function realized by the module is obtained from the input unit and added to the module information as module information, and the module information and the variable information are stored in a test database.
A procedure for generating a test input screen for inputting test logic and test data necessary for performing a program test for each module using the module information and the variable information stored in the test database; ,
A procedure for displaying the generated test input screen on the display unit and inputting test logic and test data,
A procedure for generating a test program from the input test logic,
A procedure for executing the test program using the input test data and storing test results in the test database;
A program test program for causing a computer to execute.
当該モジュールに依存する他のモジュールの識別情報を入力部から取得し、上記他のモジュールの識別情報を当該モジュールのモジュール情報に加えてテストデータベースに格納する手順をさらにコンピュータに実行させることを特徴とする請求項9に記載のプログラム試験用プログラム。   Acquiring identification information of another module depending on the module from the input unit, and causing the computer to further execute a procedure of storing the identification information of the other module in the test database in addition to the module information of the module. The program test program according to claim 9. 当該モジュールに依存する他の機能の識別情報を入力部から取得し、上記他の機能の識別情報を当該モジュールのモジュール情報に加えてテストデータベースに格納する手順をさらにコンピュータに実行させることを特徴とする請求項9に記載のプログラム試験用プログラム。   Acquiring identification information of another function depending on the module from the input unit, and causing the computer to further execute a procedure of storing the identification information of the other function in the test database in addition to the module information of the module. The program test program according to claim 9.
JP2009268772A 2009-11-26 2009-11-26 Ladder program program test apparatus, ladder program test method, and ladder program test program Expired - Fee Related JP5230587B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009268772A JP5230587B2 (en) 2009-11-26 2009-11-26 Ladder program program test apparatus, ladder program test method, and ladder program test program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009268772A JP5230587B2 (en) 2009-11-26 2009-11-26 Ladder program program test apparatus, ladder program test method, and ladder program test program

Publications (2)

Publication Number Publication Date
JP2011113277A true JP2011113277A (en) 2011-06-09
JP5230587B2 JP5230587B2 (en) 2013-07-10

Family

ID=44235567

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009268772A Expired - Fee Related JP5230587B2 (en) 2009-11-26 2009-11-26 Ladder program program test apparatus, ladder program test method, and ladder program test program

Country Status (1)

Country Link
JP (1) JP5230587B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014199603A (en) * 2013-03-29 2014-10-23 富士通株式会社 Test support program, test support device, and test support method
JP2018180711A (en) * 2017-04-06 2018-11-15 株式会社日立製作所 Calculator selecting test case and selection method of test case
WO2020209098A1 (en) * 2019-04-10 2020-10-15 日本電信電話株式会社 Input value setting support device, input value setting support method, and program
JPWO2020261325A1 (en) * 2019-06-24 2020-12-30
JP2021125020A (en) * 2020-02-06 2021-08-30 三菱電機株式会社 Controller test data restoration system
JP7208441B1 (en) * 2021-12-22 2023-01-18 三菱電機株式会社 FA control test support program, FA control test support device, FA control test support method and FA control test support system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0728521A (en) * 1993-07-09 1995-01-31 Yaskawa Electric Corp Automatic generating method for simulation program
JPH07191880A (en) * 1993-12-27 1995-07-28 Nec Corp Test supporting device
JPH08305609A (en) * 1995-04-28 1996-11-22 Oki Electric Ind Co Ltd Program test method and device
JP2005044316A (en) * 2003-07-25 2005-02-17 Omron Corp Simulation support tool, verification system for ladder program, and program product

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0728521A (en) * 1993-07-09 1995-01-31 Yaskawa Electric Corp Automatic generating method for simulation program
JPH07191880A (en) * 1993-12-27 1995-07-28 Nec Corp Test supporting device
JPH08305609A (en) * 1995-04-28 1996-11-22 Oki Electric Ind Co Ltd Program test method and device
JP2005044316A (en) * 2003-07-25 2005-02-17 Omron Corp Simulation support tool, verification system for ladder program, and program product

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014199603A (en) * 2013-03-29 2014-10-23 富士通株式会社 Test support program, test support device, and test support method
JP2018180711A (en) * 2017-04-06 2018-11-15 株式会社日立製作所 Calculator selecting test case and selection method of test case
WO2020209098A1 (en) * 2019-04-10 2020-10-15 日本電信電話株式会社 Input value setting support device, input value setting support method, and program
JP2020173592A (en) * 2019-04-10 2020-10-22 日本電信電話株式会社 Input value setting assisting apparatus, input value setting assisting method and program
JP7211229B2 (en) 2019-04-10 2023-01-24 日本電信電話株式会社 Input value setting assistance device, input value setting assistance method and program
JPWO2020261325A1 (en) * 2019-06-24 2020-12-30
WO2020261325A1 (en) * 2019-06-24 2020-12-30 日本電気株式会社 Fault isolation system, method and program
JP7215578B2 (en) 2019-06-24 2023-01-31 日本電気株式会社 Fault isolation system, method and program
JP2021125020A (en) * 2020-02-06 2021-08-30 三菱電機株式会社 Controller test data restoration system
JP7208441B1 (en) * 2021-12-22 2023-01-18 三菱電機株式会社 FA control test support program, FA control test support device, FA control test support method and FA control test support system

Also Published As

Publication number Publication date
JP5230587B2 (en) 2013-07-10

Similar Documents

Publication Publication Date Title
US20120116561A1 (en) Program testing apparatus, method of testing a program, and program testing program
JP5649748B1 (en) Programmable controller peripheral device and debugging support program
JP5230587B2 (en) Ladder program program test apparatus, ladder program test method, and ladder program test program
US9389849B2 (en) Test case pattern matching
US8356282B1 (en) Integrated development environment for the development of electronic signal testing strategies
JP2017142800A (en) Rule Builder for Process Control Network
CN101996131A (en) Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word
Aho et al. Automated Java GUI modeling for model-based testing purposes
EP3361398B1 (en) Engineering apparatus, engineering method, and program
US20120239374A1 (en) System and method of simulating input/output modules in a control system
JP2015026129A (en) Process controller and system; and soundness determination method
CN112346987A (en) Test case generation and conversion method and system based on Xmind
US8874598B2 (en) Method and system for an executable specification
US7451358B2 (en) Test executive system with automatic expression logging and parameter logging
US10579761B1 (en) Method and system for reconstructing a graph presentation of a previously executed verification test
JP2008305079A (en) Requirement specification automatic verification method
JP2013171350A (en) Device for measuring test coverage of diagram type program, and method therefor, and program
JP5726776B2 (en) Simulator software replacement apparatus, method, and program
JP5907857B2 (en) Logic drawing and test table creation device
JP5539921B2 (en) Program development tools
JPH11224211A (en) Software inspection support device
JP2020021109A (en) Verification program, storage medium, verification device and verification method
WO2017149737A1 (en) High-level synthesis device, high-level synthesis method, and high-level synthesis program
JP6139389B2 (en) Plant control logic design support system, plant control logic design support method, and program
JP2005316710A (en) Software test support device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20111025

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120926

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121009

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121120

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130312

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130319

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160329

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 5230587

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees