JP5448907B2 - Program verification apparatus, program verification method, and program - Google Patents

Program verification apparatus, program verification method, and program Download PDF

Info

Publication number
JP5448907B2
JP5448907B2 JP2010031925A JP2010031925A JP5448907B2 JP 5448907 B2 JP5448907 B2 JP 5448907B2 JP 2010031925 A JP2010031925 A JP 2010031925A JP 2010031925 A JP2010031925 A JP 2010031925A JP 5448907 B2 JP5448907 B2 JP 5448907B2
Authority
JP
Japan
Prior art keywords
executed
source code
program
source
conversion
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.)
Active
Application number
JP2010031925A
Other languages
Japanese (ja)
Other versions
JP2011170473A (en
Inventor
隆史 小河原
Original Assignee
株式会社システムズ
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 株式会社システムズ filed Critical 株式会社システムズ
Priority to JP2010031925A priority Critical patent/JP5448907B2/en
Publication of JP2011170473A publication Critical patent/JP2011170473A/en
Application granted granted Critical
Publication of JP5448907B2 publication Critical patent/JP5448907B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、命令パターンを用いて自動変換されたソースプログラムの検証等を行う装置等に関するものである。   The present invention relates to an apparatus for verifying a source program automatically converted using an instruction pattern.

従来、ソースプログラムを命令パターン等を用いて変換する装置等が知られていた。例えば、一の環境で動作していたプログラムである旧ソースプログラムを、他の環境で動作させるための新ソースプログラムに変換するプログラム自動変換装置であって、旧ソースプログラムの命令パターンを示す情報である第一命令パターン情報と新ソースプログラムの命令パターンを示す情報である第二命令パターン情報の対を1以上、格納している命令パターン対応情報格納部と、旧ソースプログラムを格納しているプログラム格納部と、前記旧ソースプログラムにおいて、前記1以上の第一命令パターン情報が何回出現するかを解析する解析部と、前記解析部において第一命令パターン情報の出現回数が、所定回数(所定回数は2以上である)以上であると解析された第一命令パターン情報に対応する旧ソースプログラムの記述箇所をコメントアウトした情報を含むように、当該旧ソースプログラムの記述箇所を当該第一命令パターン情報と対になる第二命令パターン情報に対応するように変換する命令パターン変換部と、前記命令パターン変換部において前記変換する処理が行われた後、前記命令パターン変換部でコメントアウトされた情報を含む手作業前の新ソースプログラムであり、前記命令パターン変換部で前記旧ソースプログラムを変換した結果である手作業前の新ソースプログラムを出力する新プログラム出力部と、前記新プログラム出力部において、前記手作業前の新ソースプログラムが出力された後、前記解析部において第一命令パターン情報の出現回数が前記所定回数未満であると解析された第一命令パターン情報に対応する、前記手作業前の新ソースプログラムの記述箇所に対して、ユーザの手作業による変更の入力を行う入力手段とを具備するプログラム自動変換装置等が知られていた(例えば、特許文献1参照)。   Conventionally, a device for converting a source program using an instruction pattern or the like has been known. For example, an automatic program conversion device that converts an old source program, which is a program that was operating in one environment, into a new source program that is to be operated in another environment, with information indicating the instruction pattern of the old source program An instruction pattern correspondence information storage unit storing one or more pairs of certain first instruction pattern information and second instruction pattern information which is information indicating an instruction pattern of a new source program, and a program storing an old source program In the storage unit, an analysis unit that analyzes how many times the one or more first command pattern information appears in the old source program, and the number of appearances of the first command pattern information in the analysis unit is a predetermined number of times (predetermined (The number of times is 2 or more) The description location of the old source program corresponding to the first command pattern information analyzed as being above In the instruction pattern conversion unit, the instruction pattern conversion unit converts the description location of the old source program so as to correspond to the second instruction pattern information paired with the first instruction pattern information so as to include the commented out information. The new source program before the manual operation including the information commented out by the instruction pattern conversion unit after the conversion process is performed, and the manual operation as a result of converting the old source program by the instruction pattern conversion unit In the new program output unit that outputs the previous new source program, and in the new program output unit, after the new source program before the manual operation is output, the number of appearances of the first command pattern information in the analysis unit is the predetermined number The new source before the manual operation corresponding to the first command pattern information analyzed to be less than the number of times Against program description locations, automatic program conversion apparatus that includes an input means for inputting manual changes users have been known (e.g., see Patent Document 1).

特許第4354514号公報(第1頁、第1図等)Japanese Patent No. 4354514 (first page, FIG. 1 etc.)

しかしながら、従来においては、ソースプログラムの自動変換された箇所が正常に変換されたか否か等を、適切に確認することが困難であるという課題があった。   However, conventionally, there has been a problem that it is difficult to properly confirm whether or not the automatically converted portion of the source program has been normally converted.

例えば、自動変換されたソースプログラムを実行させ、予め用意されたテストデータ等を処理させたり、シミュレーションを行うことで、ソースプログラムが正常に実行されるか否かをテストすることは可能であるが、このテストの際にソースプログラム内の自動変換された箇所が全て利用されたか否かを判断することが困難である。つまり、テストにおいて利用されなかった部分にも自動変換されたソースコードが存在する場合があり、このような部分については、自動変換されたソースコードが正常であるか否かの判断ができなかった。したがって、例えば、自動変換されたソースプログラム内に、テストされていない箇所がどの程度存在しているか判断できず、自動変換が正常に行われたか否かの適切な判断を行うことができない、という問題があった。   For example, it is possible to test whether or not the source program is normally executed by executing the automatically converted source program, processing test data prepared in advance, or performing simulation. In this test, it is difficult to determine whether or not all automatically converted portions in the source program have been used. In other words, there are cases in which the source code that was automatically converted exists even in the part that was not used in the test, and it was not possible to determine whether or not the automatically converted source code was normal for such a part. . Therefore, for example, it is impossible to determine how many untested parts exist in the automatically converted source program, and it is not possible to make an appropriate determination as to whether or not automatic conversion has been performed normally. There was a problem.

また、自動変換したソースコードに対して行うテストが、自動変換された部分を十分にテストできるテストであるか否かを判断することが困難であるため、ソースプログラムを十分に検証するためには、冗長なテストを行う必要があった。   In addition, since it is difficult to determine whether the test to be performed on the automatically converted source code is a test that can sufficiently test the automatically converted part, in order to fully verify the source program Needed to do a redundant test.

本発明のプログラム検証装置は、第一命令パターンに対応するソースコードを、第一命令パターンに対応する1以上の第二命令パターンに対応するソースコードに変換して得られたソースプログラムが格納され得るソースプログラム格納部と、ソースプログラム格納部に格納されているソースプログラムに基づくプログラムを実行させた場合に使用されるソースコードである実行済ソースコードをソースプログラムから検出する実行済ソースコード検出部と、検出された実行済ソースコードのうちの、第二命令パターンに対応するソースコードに変換された部分に関する情報である変換関連情報を取得する変換関連情報取得部と、変換関連情報取得部が取得した変換関連情報を出力する出力部とを備えたプログラム検証装置である。   The program verification apparatus of the present invention stores a source program obtained by converting source code corresponding to a first instruction pattern into source code corresponding to one or more second instruction patterns corresponding to the first instruction pattern. Source program storage unit to be obtained and an executed source code detection unit for detecting an executed source code, which is a source code used when a program based on the source program stored in the source program storage unit is executed, from the source program A conversion related information acquisition unit that acquires conversion related information that is information related to a portion of the detected executed source code that has been converted into the source code corresponding to the second instruction pattern, and a conversion related information acquisition unit It is a program verification apparatus provided with the output part which outputs the acquired conversion relevant information.

かかる構成により、命令パターンを用いて行われた変換の検証が十分にできたか否かを示すことができる。これにより、命令パターンを用いた変換が正常に行われたか否かの検証や、変換を検証するために行われるテストの妥当性等の検証等を行うことができる。   With this configuration, it is possible to indicate whether or not the conversion performed using the instruction pattern has been sufficiently verified. As a result, it is possible to verify whether or not the conversion using the instruction pattern has been performed normally, verify the validity of a test performed to verify the conversion, and the like.

また、本発明のプログラム検証装置は、前記プログラム検証装置において、変換関連情報取得部は、実行済ソースコードに含まれるソースコードと対応する第二命令パターンである実行済命令パターンを検出する実行済命令パターン検出手段と、実行済命令パターン検出手段が検出した第二命令パターンに関する情報を含む変換関連情報を取得する第一変換関連情報取得手段とを備えたプログラム検証装置である。   The program verification apparatus according to the present invention is the program verification apparatus, wherein the conversion related information acquisition unit detects an executed instruction pattern that is a second instruction pattern corresponding to the source code included in the executed source code. A program verification apparatus comprising: an instruction pattern detection unit; and a first conversion related information acquisition unit that acquires conversion related information including information related to a second command pattern detected by an executed instruction pattern detection unit.

かかる構成により、例えば、ソースプログラムの変換に用いられた第二命令パターンのうちの、ソースプログラムに対応したプログラムの実行時に使用されたソースプログラムに対応した第二命令パターンに関する情報、例えばパターン数等についての情報を知ることができる。   With this configuration, for example, information on the second instruction pattern corresponding to the source program used when executing the program corresponding to the source program among the second instruction patterns used for conversion of the source program, such as the number of patterns You can know information about.

また、本発明のプログラム検証装置は、前記プログラム検証装置において、変換関連情報は、実行済命令パターン検出手段が検出した第二命令パターンの出現量に関する情報であるプログラム検証装置である。   The program verification apparatus according to the present invention is the program verification apparatus according to the above-described program verification apparatus, wherein the conversion-related information is information related to the appearance amount of the second instruction pattern detected by the executed instruction pattern detection unit.

かかる構成により、例えば、ソースプログラムの変換に用いられた第二命令パターンのうちの、ソースプログラムに対応したプログラムの実行時に使用されたソースプログラムに対応した第二命令パターンの出現量についての情報を知ることができる。   With such a configuration, for example, information on the appearance amount of the second instruction pattern corresponding to the source program used when executing the program corresponding to the source program among the second instruction patterns used for conversion of the source program is obtained. I can know.

また、本発明のプログラム検証装置は、前記プログラム検証装置において、変換関連情報取得部は、ソースプログラムに含まれるソースコードと対応する第二命令パターンである変換命令パターンを検出する変換命令パターン検出手段を更に備え、第一変換関連情報取得手段は、変換命令パターン検出手段が検出した異なる変換命令パターンの数に対する、実行済命令パターン検出手段が検出した異なる実行済命令パターンの数の比率を示す情報を含む変換関連情報を取得するプログラム検証装置である。   Further, the program verification apparatus of the present invention is the conversion instruction pattern detection means for detecting a conversion instruction pattern which is a second instruction pattern corresponding to the source code included in the source program. And the first conversion related information acquisition means is information indicating the ratio of the number of different executed instruction patterns detected by the executed instruction pattern detection means to the number of different conversion instruction patterns detected by the conversion instruction pattern detection means This is a program verification device that acquires conversion-related information including.

かかる構成により、ソースプログラムの変換に用いられた第二命令パターン数に対する、ソースプログラムに対応したプログラムの実行時に使用されたソースコードの変換に用いられた第二命令パターン数の比率を知ることができる。これにより、例えば、変換に用いられた第二命令パターンにおける、テスト等によって検証されたと考えられる第二命令パターンの比率を知ることができる。   With this configuration, it is possible to know the ratio of the number of second instruction patterns used for converting the source code used when executing the program corresponding to the source program to the number of second instruction patterns used for converting the source program. it can. Thereby, for example, it is possible to know the ratio of the second command pattern considered to be verified by the test or the like in the second command pattern used for the conversion.

また、本発明のプログラム検証装置は、前記プログラム検証装置において、変換関連情報取得部は、ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードであって、実行済ソースコードに含まれるとともに、第二命令パターンに対応するソースコードを含むソースコードであるステップ対応実行済コードを検出するステップ対応実行済コード検出手段と、ステップ対応実行済コード検出手段が検出したステップ対応実行済コードに関する情報を含む変換関連情報を取得する第二変換関連情報取得手段とを備えたプログラム検証装置である。   In the program verification apparatus of the present invention, in the program verification apparatus, the conversion related information acquisition unit is source code in a source program corresponding to each step that can be executed when a program based on the source program is executed. A step-corresponding executed code detecting means for detecting a step-corresponding executed code that is a source code including a source code corresponding to the second instruction pattern, and a step-corresponding executed code detecting means Is a program verification device comprising second conversion related information acquisition means for acquiring conversion related information including information related to the step-corresponding executed code detected by.

かかる構成により、例えば、ソースプログラムに対応したプログラムを実行させた場合に実行されうるステップのうちの、第二命令パターンに対応するよう変更されたソースコードに対応したステップに関する情報、例えば処理されたステップに対応するソースコードの情報等を取得することができる。   With such a configuration, for example, information relating to a step corresponding to the source code changed to correspond to the second instruction pattern among steps that can be executed when a program corresponding to the source program is executed, for example, processed Information on the source code corresponding to the step can be acquired.

また、本発明のプログラム検証装置は、前記プログラム検証装置において、変換関連情報は、ステップ対応実行済コード検出手段が検出したステップ対応実行済コードの出現量に関する情報であるプログラム検証装置である。   The program verification apparatus according to the present invention is the program verification apparatus according to the program verification apparatus, wherein the conversion related information is information related to an appearance amount of the step-corresponding executed code detected by the step-corresponding executed code detecting means.

かかる構成により、例えば、ソースプログラムに対応したプログラムを実行させた場合に実行されうるステップのうちの、第二命令パターンに対応するよう変更されたソースコードに対応したステップの出現量の情報を取得することができる。   With such a configuration, for example, information on the amount of appearance of a step corresponding to the source code changed to correspond to the second instruction pattern among the steps that can be executed when the program corresponding to the source program is executed is acquired. can do.

また、本発明のプログラム検証装置は、前記プログラム検証装置において、変換関連情報取得部は、ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードであって、第二命令パターンと対応するソースコードを含むソースコードであるステップ対応変換コードを検出するステップ対応変換コード検出手段を更に備え、第二変換関連情報取得手段は、ステップ対応変換コード検出手段が検出したステップ対応変換コードの数に対する、ステップ対応実行済コード検出手段が検出したステップ対応実行済コードの数の比率を示す情報を含む変換関連情報を取得するプログラム検証装置である。   In the program verification apparatus of the present invention, in the program verification apparatus, the conversion related information acquisition unit is source code in a source program corresponding to each step that can be executed when a program based on the source program is executed. And a step corresponding conversion code detecting means for detecting a step corresponding conversion code which is a source code including a source code corresponding to the second instruction pattern. It is a program verification device that acquires conversion related information including information indicating the ratio of the number of step-corresponding executed codes detected by the step-corresponding executed code detection means to the number of detected step-corresponding conversion codes.

かかる構成により、例えば、ソースプログラムに対応したプログラムを実行させた場合に実行されうるステップのうちの、第二命令パターンに対応するよう変更されたソースコードに対応したステップが、テスト等のためにソースプログラムに対応したプログラムを実行する時にどの程度使用されたかを知ることができる。   With such a configuration, for example, the step corresponding to the source code changed to correspond to the second instruction pattern among the steps that can be executed when the program corresponding to the source program is executed is for testing or the like. It is possible to know how much is used when executing a program corresponding to the source program.

また、本発明のプログラム検証装置は、前記プログラム検証装置において、ソースプログラム格納部には、ソースプログラムの変換に用いられた第二命令パターンを示す情報と、第二命令パターンにより変換されたソースプログラム内のソースコードとが対応付けて格納されており、実行済命令パターン検出手段は、ソースプログラム格納部に格納されている第二命令パターンを示す情報から、実行済ソースコード検出部が検出した実行済ソースコード内に含まれるソースコードと対応付けられた第二命令パターンを示す情報を検出して、実行済命令パターンである第二命令パターンを検出するプログラム検証装置である。   In the program verification device of the present invention, in the program verification device, the source program storage unit includes information indicating the second instruction pattern used for conversion of the source program and the source program converted by the second instruction pattern. The executed instruction pattern detecting means detects the execution detected by the executed source code detecting section from the information indicating the second instruction pattern stored in the source program storing section. A program verification device that detects information indicating a second instruction pattern associated with a source code included in a completed source code and detects a second instruction pattern that is an executed instruction pattern.

かかる構成により、実行済命令パターンを検出する際に、ソースプログラムに対して、第二命令パターンに対応するソースコードを検出する必要がなくなり、処理の高速化を図ることができる。   With this configuration, when the executed instruction pattern is detected, it is not necessary to detect the source code corresponding to the second instruction pattern for the source program, and the processing speed can be increased.

また、本発明のプログラム検証装置は、前記プログラム検証装置において、ソースプログラムの変換に用いられた第二命令パターンを含む第二命令パターンが格納され得る第二命令パターン格納部を更に備え、実行済命令パターン検出手段は、実行済ソースコード検出部が検出した実行済ソースコードと第二命令パターン格納部に格納されている第二命令パターンとのパターンマッチングを行って、実行済ソースコードに含まれるソースコードに対応する第二命令パターンを検出するプログラム検証装置実行済ソースコードに含まれるソースコードと対応する第二命令パターンを検出するプログラム検証装置である。   The program verification apparatus of the present invention further includes a second instruction pattern storage unit that can store a second instruction pattern including a second instruction pattern used for conversion of the source program in the program verification apparatus, and has been executed. The instruction pattern detection means performs pattern matching between the executed source code detected by the executed source code detection unit and the second instruction pattern stored in the second instruction pattern storage unit, and is included in the executed source code A program verification apparatus for detecting a second instruction pattern corresponding to a source code is a program verification apparatus for detecting a second instruction pattern corresponding to a source code included in an executed source code.

かかる構成により、ソースプログラムと、変換に用いられた第二命令パターンとの対応関係が分からなくても、実行済命令パターンを検出することができ、汎用性を高くすることができる。   With such a configuration, the executed instruction pattern can be detected and the versatility can be enhanced without knowing the correspondence between the source program and the second instruction pattern used for the conversion.

本発明によるプログラム検証装置等によれば、命令パターンを用いて行われた変換の検証が十分にできたか否かを示すことができる。   According to the program verifying apparatus and the like according to the present invention, it is possible to indicate whether or not the conversion performed using the instruction pattern has been sufficiently verified.

本発明の実施の形態1におけるプログラム検証装置のブロック図Block diagram of a program verification apparatus in Embodiment 1 of the present invention 同プログラム検証装置の動作を示すフローチャートFlow chart showing operation of the program verification device 同プログラム検証装置の動作の変形例について示すフローチャートA flowchart showing a modification of the operation of the program verification device 同プログラム検証装置の動作を説明するためのパターン管理表を示す図The figure which shows the pattern management table for demonstrating operation | movement of the program verification apparatus 同プログラム検証装置の動作を説明するための、ソースプログラム格納部に格納されているソースプログラムの一例を示す図The figure which shows an example of the source program stored in the source program storage part for demonstrating operation | movement of the program verification apparatus 同プログラム検証装置の動作を説明するための、実行済ソースコード検出部が検出した実行済ソースコードの行番号を示す図The figure which shows the line number of the executed source code which the executed source code detection part detected for demonstrating operation | movement of the program verification apparatus 同プログラム検証装置の動作を説明するための、蓄積された実行済命令パターンIDを示す図The figure which shows the accumulated executed command pattern ID for demonstrating operation | movement of the program verification apparatus 同プログラム検証装置の動作を説明するための、重複をなくした実行済命令パターンIDを示す図The figure which shows the executed instruction pattern ID which eliminated the duplication for demonstrating operation | movement of the program verification apparatus 同プログラム検証装置の動作を説明するための、重複を削除して得られた変換命令パターンIDを示す図The figure which shows conversion command pattern ID obtained by deleting duplication for demonstrating operation | movement of the program verification apparatus 同プログラム検証装置の動作を説明するための、変換関連情報の出力例を示す図The figure which shows the example of an output of the conversion relevant information for demonstrating operation | movement of the program verification apparatus 本発明の実施の形態2におけるプログラム検証装置のブロック図Block diagram of a program verification apparatus in Embodiment 2 of the present invention 同プログラム検証装置の動作を示すフローチャートFlow chart showing operation of the program verification device 同プログラム検証装置の動作を説明するための、取得した実行済コードIDを示す図The figure which shows acquired executed code ID for demonstrating operation | movement of the program verification apparatus 同プログラム検証装置の動作を説明するための、取得した変換コードIDを示す図The figure which shows acquired conversion code ID for demonstrating operation | movement of the program verification apparatus 同プログラム検証装置の動作を説明するための、変換関連情報の出力例を示す図The figure which shows the example of an output of the conversion relevant information for demonstrating operation | movement of the program verification apparatus 本発明の各実施の形態におけるコンピュータシステムの外観の一例を示す図The figure which shows an example of the external appearance of the computer system in each embodiment of this invention 本発明の各実施の形態におけるコンピュータシステムの構成の一例を示す図The figure which shows an example of a structure of the computer system in each embodiment of this invention

以下、プログラム検証装置等の実施形態について図面を参照して説明する。なお、実施の形態において同じ符号を付した構成要素は同様の動作を行うので、再度の説明を省略する場合がある。   Hereinafter, embodiments of a program verification device and the like will be described with reference to the drawings. In addition, since the component which attached | subjected the same code | symbol in embodiment performs the same operation | movement, description may be abbreviate | omitted again.

(実施の形態1)
図1は、本実施の形態におけるプログラム検証装置1のブロック図である。
プログラム検証装置1は、ソースプログラム格納部101、実行済ソースコード検出部102、変換関連情報取得部103、出力部104、および第二命令パターン格納部105を備える。
(Embodiment 1)
FIG. 1 is a block diagram of a program verification apparatus 1 in the present embodiment.
The program verification apparatus 1 includes a source program storage unit 101, an executed source code detection unit 102, a conversion related information acquisition unit 103, an output unit 104, and a second instruction pattern storage unit 105.

変換関連情報取得部103は、実行済命令パターン検出手段1031、変換命令パターン検出手段1032、および第一変換関連情報取得手段1033を備える。   The conversion related information acquisition unit 103 includes an executed command pattern detection unit 1031, a conversion command pattern detection unit 1032, and a first conversion related information acquisition unit 1033.

ソースプログラム格納部101には、第一命令パターンに対応するソースコードを、第一命令パターンに対応する1以上の第二命令パターンに対応するソースコードに変換して得られたソースプログラムが1以上格納され得る。ソースコードは、例えば、プログラミング言語の言語仕様等に従って記述されたコンピュータに対する一連の指示であり、文字列等で構成される。ソースプログラムは1以上のソースコードにより構成される。ソースプログラムは、例えば、1以上のソースコードにより構成される1以上のソースファイルであっても良い。ここで述べるソースプログラムは、マイグレーションされたソースプログラムであると考えても良い。ソースプログラムは、COBOL言語や、C言語、perl言語等、どのような言語のソースプログラムであっても良い。また、スクリプト等であっても良い。ソースプログラム格納部101に格納されているソースプログラムに対する第一命令パターンと第二命令パターンとを用いたソースプログラムの変換がどのように行われたものであるかは問わない。例えば、ソースプログラムの変換の一例については、特許文献1等に開示されている。ここで述べるプログラムとは、例えば、コンピュータの行う処理(演算・動作・通信など)の手順を指示したもののことである。ソースプログラム格納部101に格納されているソースプログラムは、例えば、第二命令パターンを用いて旧ソースプログラムを変換して得られた、変換後の新ソースプログラムである。   The source program storage unit 101 has one or more source programs obtained by converting source code corresponding to the first instruction pattern into source code corresponding to one or more second instruction patterns corresponding to the first instruction pattern. Can be stored. The source code is, for example, a series of instructions for a computer described in accordance with a language specification of a programming language, and includes a character string or the like. A source program is composed of one or more source codes. The source program may be one or more source files composed of one or more source codes, for example. The source program described here may be considered as a migrated source program. The source program may be a source program in any language such as COBOL language, C language, and Perl language. Moreover, a script etc. may be sufficient. It does not matter how the source program is converted using the first instruction pattern and the second instruction pattern for the source program stored in the source program storage unit 101. For example, an example of source program conversion is disclosed in Patent Document 1 and the like. The program described here is, for example, an instruction for a procedure of processing (calculation / operation / communication) performed by a computer. The source program stored in the source program storage unit 101 is, for example, a new source program after conversion obtained by converting the old source program using the second instruction pattern.

第二命令パターンとは、例えば、変換後(例えばマイグレーション後)のソースプログラムに含まれるソースコードで構成される命令のパターンを示す情報である。第二命令パターンは、変換後のソースプログラムの言語や、変換後のソースプログラムが利用される環境等に対応した命令のパターンでも良い。第二命令パターンに対応するソースコードとは、第二命令パターンに沿って記載されたソースコードである。   The second instruction pattern is information indicating an instruction pattern composed of source code included in a source program after conversion (for example, after migration), for example. The second instruction pattern may be an instruction pattern corresponding to the language of the converted source program, the environment in which the converted source program is used, or the like. The source code corresponding to the second command pattern is source code written along the second command pattern.

第二命令パターンは、ソースプログラムにおいて出現するソースコードのうちの一部、例えば、変数やリテラル文字や関数名等を、固定されていない文字列であることを示すための、予め指定されている字句要素(例えば単語)で置き換えた情報であっても良い。この置き換える情報を、ここでは、例えば変換語と呼ぶ。また、変数やリテラル文字や関数名やこれらを含む文字列等の固定されていない文字列をここでは非固定語と呼ぶ。逆に、これ以外の固定されている文字列を固定語と呼ぶ。変換語は、非固定語を正規表現化したものと考えても良い。変換語は、当該変換語が配置されている位置に配置される情報のデータタイプやデータサイズや属性等が判断可能な情報であることが好ましい。変換語は、ソースプログラムの少なくとも一部を構成する文字列が、変数、関数名、またはリテラル文字の少なくとも一つを含む非固定語のタイプのうちの、いずれのタイプの非固定語であるかを示す文字列と考えても良い。例えば、ソースプログラムの少なくとも一部を構成する文字列が、どのような属性を有する非固定語であるかを示す文字列と考えても良い。すなわち、変換語を、ソースプログラムの少なくとも一部に含まれる、変数、関数名、またはリテラル文字の少なくとも一つを含む文字列(例えば単語)が、どのような属性の文字列であるかを示す文字列と考えても良い。この属性は、ソースプログラムの文字列が、変数、関数名、またはリテラル文字のいずれであるかを示す属性であっても良いし、ソースプログラムの文字列の用途等や、文字列が指定するものの種別等を示す属性であっても良い。また、この属性は、ソースプログラムの文字列の文字数や、文字の種類等を示す属性であっても良い。変換語は、例えば、変数やリテラル文字や関数名等の非予約語を置き換える情報と考えてもよく、この場合、変換語は、いずれのタイプの非予約語であるか、例えば属性の非予約語であるかを示す文字列と考えても良い。第二命令パターンは、例えば、命令語と、ユーザ指定語と、変換語と、その他の文字列とのうちの1以上の組み合わせで構成される。命令語、ユーザ指定語、変換語等の詳細については後述する。第二命令パターンは、ソースプログラムにおける命令語等の固定語の出現するパターン、非固定語(例えば、変数やリテラル文字や関数名等)の出現するパターン、または固定語および非固定語の出現するパターンと考えても良い。また、第二命令パターンを、ソースプログラムにおける予約語(例えば命令語等)の出現するパターン、非予約語(例えば、変数やリテラル文字や関数名等)の出現するパターン、または予約語および非予約語の出現するパターンと考えても良く、この場合、第二命令パターンは、例えば、ソースプログラムにおける予約語の出現するパターン、非予約語の出現するパターン、または予約語および非予約語の出現するパターンの少なくとも一つを示す情報であってもよい。具体例を挙げると、第二命令パターンは、「命令語 <引数1> <引数2>」という予約語と非予約語の配列パターンを示す情報である。ただし、この場合、「命令語」は、「OPEN」や「MOVE」、「CALL」等の予約語であり、「<引数1>」、「<引数2>」は変数文字列である非予約語である。また、第二命令パターン情報は、固定語や非固定語がどのような順番で配列されているかを示す情報等であっても良い。また、第二命令パターン情報は、特定の予約語、例えば命令語や不特定の予約語がどのような順番で配列されているかを示す情報等であっても良い。なお、予約語とは、プログラミング言語の仕様等で定められた、変数名や関数名、クラス名等の識別子名として使用できない字句要素である。また、ここでは、命令語でない予約語を非予約語と呼ぶようにしても良い。   The second instruction pattern is specified in advance to indicate that a part of the source code appearing in the source program, for example, a variable, a literal character, a function name, or the like is an unfixed character string. Information replaced with a lexical element (for example, a word) may be used. Here, this replacement information is called a conversion word, for example. Further, non-fixed character strings such as variables, literal characters, function names, and character strings including these are referred to as non-fixed words here. Conversely, other fixed character strings are called fixed words. The conversion word may be considered as a regular expression of a non-fixed word. The conversion word is preferably information from which the data type, data size, attribute, and the like of the information arranged at the position where the conversion word is arranged can be determined. The conversion word is any type of non-fixed word among non-fixed word types including at least one of a variable, a function name, or a literal character as a character string that forms at least a part of the source program. May be considered as a character string indicating. For example, it may be considered as a character string indicating what kind of attribute a character string that forms at least a part of the source program is. That is, it indicates what kind of attribute a character string (for example, word) including at least one of a variable, a function name, or a literal character included in at least a part of the source program is a conversion word. You can think of it as a string. This attribute may be an attribute indicating whether the character string of the source program is a variable, a function name, or a literal character, and the purpose of the character string of the source program, etc. It may be an attribute indicating a type or the like. Further, this attribute may be an attribute indicating the number of characters in the character string of the source program, the type of character, and the like. A conversion word may be considered as information that replaces a non-reserved word such as a variable, a literal character, or a function name. In this case, the conversion word is any type of non-reserved word, for example, a non-reserved attribute. It may be considered as a character string indicating whether it is a word. The second command pattern is composed of, for example, one or more combinations of command words, user-specified words, conversion words, and other character strings. Details of command words, user-specified words, conversion words, etc. will be described later. The second instruction pattern is a pattern in which a fixed word such as an instruction word in the source program appears, a pattern in which a non-fixed word (for example, a variable, a literal character, or a function name) appears, or a fixed word and a non-fixed word appear. You may think of it as a pattern. In addition, the second instruction pattern is a pattern in which a reserved word (for example, an instruction word) appears in the source program, a pattern in which a non-reserved word (for example, a variable, a literal character, or a function name) appears, or a reserved word and a non-reserved word In this case, the second command pattern may be a pattern in which a reserved word appears in a source program, a pattern in which a non-reserved word appears, or a reserved word and a non-reserved word appear, for example. It may be information indicating at least one of the patterns. As a specific example, the second command pattern is information indicating an array pattern of reserved words and non-reserved words “command word <argument 1> <argument 2>”. In this case, however, “instruction word” is a reserved word such as “OPEN”, “MOVE”, “CALL”, etc., and “<argument 1>” and “<argument 2>” are non-reserved characters that are variable character strings. Is a word. Further, the second command pattern information may be information indicating the order in which fixed words and non-fixed words are arranged. Further, the second command pattern information may be information indicating a specific reserved word, for example, the order in which command words and unspecified reserved words are arranged. Note that a reserved word is a lexical element that cannot be used as an identifier name, such as a variable name, function name, or class name, defined in a programming language specification or the like. Here, a reserved word that is not an instruction word may be called a non-reserved word.

第一命令パターンとは、例えば、変換前(例えばマイグレーション前)のソースプログラムに現れる命令のパターンである。第一命令パターンは、変換前のソースプログラムの言語や、変換後のソースプログラムが利用される環境等に対応した命令のパターンでも良い。第一命令パターンは、変換前のソースプログラムに対応したものである点を除けば、上述した第二命令パターンと同様の命令パターンである。第一命令パターンに対応するソースコードとは、第一命令パターンに沿って記載されたソースコードである。あるいは、変換前のソースプログラムにあらわれるソースコードから取得された命令パターンである。   The first instruction pattern is, for example, a pattern of instructions that appear in the source program before conversion (for example, before migration). The first command pattern may be a command pattern corresponding to the language of the source program before conversion, the environment in which the source program after conversion is used, or the like. The first command pattern is the same as the second command pattern described above except that it corresponds to the source program before conversion. The source code corresponding to the first command pattern is source code written along the first command pattern. Or it is the command pattern acquired from the source code which appears in the source program before conversion.

第一命令パターンに対応するソースコードとは、例えば、第一命令パターンを用いたパターンマッチングにより検出されるソースコードや、第一命令パターンを正規表現化された検索キーとして検索した場合に一致すると判断されるソースコードである。   The source code corresponding to the first instruction pattern matches, for example, the source code detected by pattern matching using the first instruction pattern, or when the first instruction pattern is searched as a regular expression search key. Source code to be determined.

マイグレーション等のソースプログラムの変換は、例えば、予め用意された第一命令パターンと対応付けられた第二命令パターンを用いて、変換前のソースプログラムの一の第一命令パターンに対応するソースコードを、この一の第一命令パターンに対応する第二命令パターンに対応するソースコードに変換することで行われる。   The source program conversion such as migration is performed by, for example, using the second instruction pattern associated with the first instruction pattern prepared in advance, and using the source code corresponding to the first instruction pattern of the source program before conversion. This is performed by converting the source code corresponding to the second instruction pattern corresponding to the first instruction pattern.

ソースプログラム格納部101には、ソースプログラムの変換に用いられた第二命令パターンを示す情報と、第二命令パターンにより変換されたソースプログラム内のソースコードとが対応付けて格納されていてもよい。第二命令パターンを示す情報は、変換に用いられた第二命令パターンそのものであっても良いし、変換に用いられた第二命令パターンと対応付けられた第一命令パターンであっても良い。あるいは、変換に用いられた第二命令パターンあるいはこれと対応付けられた第一命令パターンを識別するための識別情報であってもよい。また、第二命令パターンで変更されたソースコードと、変更が行われた部分であることを示す情報、例えばフラグ等とが対応付けられていても良い。このような変換に用いられた第二命令パターンを示す情報と、変換されたソースコードとの対応付けは、どのように管理されていても良い。例えば、ソースプログラム内の第二命令パターンで変換された部分の近傍、例えばコメント欄やコメント領域等に、第二命令パターンを示す情報が配置されていても良い。あるいは、変換されたソースコードの位置を示す情報(例えば行番号等)と、変換に用いられた第二命令パターンを示す情報とが、一のレコードの2つの項目として図示しない格納部等に格納されている管理テーブル等で管理されていても良い。なお、ソースプログラム格納部101は、物理的に複数の記憶媒体等で実現されても良く、この場合、ソースプログラムと、ソースプログラム内のソースコードに対応する第二命令パターンとが、異なる記憶媒体に格納されていても良い。   The source program storage unit 101 may store information indicating the second instruction pattern used for conversion of the source program and source code in the source program converted by the second instruction pattern in association with each other. . The information indicating the second command pattern may be the second command pattern itself used for the conversion, or may be a first command pattern associated with the second command pattern used for the conversion. Alternatively, it may be identification information for identifying the second command pattern used for conversion or the first command pattern associated with the second command pattern. Further, the source code changed in the second instruction pattern may be associated with information indicating that the change has been made, for example, a flag or the like. The association between the information indicating the second command pattern used for such conversion and the converted source code may be managed in any way. For example, information indicating the second command pattern may be arranged in the vicinity of a portion converted by the second command pattern in the source program, for example, in a comment field or a comment area. Alternatively, information indicating the position of the converted source code (for example, a line number) and information indicating the second command pattern used for the conversion are stored in a storage unit (not shown) as two items of one record. It may be managed with a management table or the like. Note that the source program storage unit 101 may be physically realized by a plurality of storage media or the like. In this case, the source program and the second instruction pattern corresponding to the source code in the source program are different storage media. May be stored.

ソースプログラム格納部101にソースプログラムが蓄積される過程は問わない。ソースプログラム格納部101は、不揮発性の記録媒体が好適であるが、揮発性の記録媒体でも実現可能である。   The process of accumulating the source program in the source program storage unit 101 does not matter. The source program storage unit 101 is preferably a nonvolatile recording medium, but can also be realized by a volatile recording medium.

実行済ソースコード検出部102は、ソースプログラム格納部101に格納されているソースプログラムに基づくプログラムを実行させた場合に使用されるソースコードである実行済ソースコードを検出する。   The executed source code detection unit 102 detects an executed source code that is a source code used when a program based on the source program stored in the source program storage unit 101 is executed.

ソースプログラムに基づくプログラムとは、ソースプログラムに対応した実行用のコードで構成されるプログラムである。ここでのソースプログラムは、例えば、旧ソースプログラムを、第二命令パターンを用いて変換後して得られた、変換後の新ソースプログラムである。例えば、ソースプログラムに基づくプログラムは、ソースプログラムそのものであっても良いし、ソースプログラムに対してコンパイル等の変換を行って得られたプログラムであっても良い。例えば、ソースプログラム格納部101に格納されたソースプログラムがインタプリタ型のソースプログラムである場合、ソースプログラムに基づくプログラムは、ソースプログラムそのものであり、ソースプログラムは、予め指定された単位、例えば行単位で読み出されて、解釈実行される。また、ソースプログラム格納部101に格納されたソースプログラムがインタプリタ型でない場合、ソースプログラムに基づくプログラムは、ソースプログラムがコンパイルされて得られたプログラムである。   A program based on a source program is a program composed of code for execution corresponding to the source program. The source program here is, for example, a new source program after conversion obtained by converting the old source program using the second instruction pattern. For example, the program based on the source program may be the source program itself, or may be a program obtained by performing conversion such as compilation on the source program. For example, when the source program stored in the source program storage unit 101 is an interpreter type source program, the program based on the source program is the source program itself, and the source program is in a unit designated in advance, for example, in line units. It is read and interpreted. When the source program stored in the source program storage unit 101 is not an interpreter type, the program based on the source program is a program obtained by compiling the source program.

ソースプログラムに基づくプログラムを実行させた場合とは、ソースプログラムに基づくプログラムを実行させ、例えばソースプログラムのテスト用に用意された1以上のテストデータを用いて、予め指定された処理のテストを行うことであっても良いし、ソースプログラムに基づくプログラムに対して、予め指定された処理のテストのシミュレーションを行うことであってもよい。このシミュレーションは、例えばソースプログラムに基づくプログラムに予め指定された処理を実行させた場合に使用されるソースコードを検出するためのシミュレーションと考えてもよい。ここでのテストは、例えばソースプログラムの変換が正常に行われたか否かを判断するためのテスト等である。使用されたソースコードとは、例えば、インタプリタ型のソースプログラムのように、ソースプログラムの少なくとも一部がそのまま読み出されて実行されるソースプログラムである場合、読み出されたソースコードと考えても良い。またインタプリタ型以外のソースプログラムのようにソースプログラムが一旦コンパイルされ、コンパイルされて得られたプログラムが実行される場合、使用されたソースコードとは、コンパイルされたプログラムの実行された部分に対応する、コンパイル前のソースプログラム内のソースコードと考えても良い。なお、テストデータや、どのようなテストを行うかを指定する情報等は、図示しない記憶媒体等に予め蓄積しておくようにすればよい。ソースプログラムに基づくプログラムを実行させた場合に使用されるソースコードとは、ここでは、ソースプログラムに基づくプログラムのうちの、実行される部分に対応したソースコードを意味する。具体的には、ソースプログラムに基づくプログラムのうちの、実行されているオブジェクトコードや命令セットに対応するソースコードである。ここでのソースコードの使用とは、間接的な使用も含む概念と考えても良い。   When the program based on the source program is executed, the program based on the source program is executed, and for example, one or more test data prepared for the test of the source program is used to test a process designated in advance. Alternatively, a simulation of a test of a process designated in advance may be performed on a program based on the source program. This simulation may be considered as a simulation for detecting a source code used when, for example, a program based on the source program executes a process designated in advance. The test here is, for example, a test for determining whether or not the source program has been successfully converted. The used source code is, for example, a source program that is read and executed as it is at least a part of the source program, such as an interpreter type source program. good. In addition, when a source program is compiled once and the program obtained by compiling is executed like a non-interpreter type source program, the used source code corresponds to the executed part of the compiled program. It may be considered as source code in a source program before compilation. Note that test data, information specifying what kind of test is to be performed, and the like may be stored in advance in a storage medium (not shown). The source code used when the program based on the source program is executed means a source code corresponding to a portion to be executed in the program based on the source program. Specifically, it is a source code corresponding to an object code or an instruction set being executed in a program based on the source program. The use of the source code here may be considered as a concept including indirect use.

ソースプログラムに基づくプログラムを実行させた場合に使用されるソースコードを検出するための構成やその処理については、検証対象となるソースプログラムに予め指定された処理を実行させた場合に、検証対象のソースプログラム内のソースコードをどれだけ網羅したかを測定するいわゆるコードカバレッジの技術や、デバッガの技術として公知であるので、ここでは説明を省略する。   Regarding the configuration for detecting the source code used when the program based on the source program is executed and its processing, if the processing specified in advance is executed in the source program to be verified, the verification target Since it is known as a so-called code coverage technique for measuring how much source code is covered in a source program or a debugger technique, description thereof is omitted here.

実行済ソースコード検出部102は、使用されるソースコードを検出する毎に、検出したソースコードを順次取得してもよいし、ソースプログラムに基づくプログラムの実行が終了した時点で、使用されたソースコードを取得しても良い。取得したソースコードは、例えば、図示しない記憶媒体等に蓄積する。また、ソースプログラム内の実行済ソースコードの存在する部分に、実行済ソースコードであることを示す情報、例えばフラグ等を対応付けても良いし、属性等を示す情報を付与しても良い。例えば、ソースプログラム内の実行済ソースコードが含まれる部分を示す情報、例えば、実行済ソースコードが含まれる行の行番号等を取得して、図示しない記憶媒体等に蓄積しても良い。   The executed source code detection unit 102 may sequentially acquire the detected source code every time the used source code is detected, or the source used when the execution of the program based on the source program is finished. You may get the code. The acquired source code is stored in, for example, a storage medium (not shown). In addition, information indicating that the source code has been executed, for example, a flag or the like may be associated with a portion of the source program where the executed source code exists, or information indicating an attribute or the like may be provided. For example, information indicating a portion including the executed source code in the source program, for example, the line number of the line including the executed source code may be acquired and stored in a storage medium (not shown).

実行済ソースコード検出部102は、通常、MPUやメモリ等から実現され得る。実行済ソースコード検出部102の処理手順は、通常、ソフトウェアで実現され、当該ソフトウェアはROM等の記録媒体に記録されている。但し、ハードウェア(専用回路)で実現しても良い。   The executed source code detection unit 102 can usually be realized by an MPU, a memory, or the like. The processing procedure of the executed source code detection unit 102 is usually realized by software, and the software is recorded on a recording medium such as a ROM. However, it may be realized by hardware (dedicated circuit).

なお、実行済ソースコード検出部102は、ソースプログラムに基づくプログラムを実行させて、例えば予め指定された1以上のテスト等を行うための実行部(図示せず)を備えていると考えても良い。また、このテストに用いられるデータやテスト手順等を示すデータ等が格納されているテストデータ格納部(図示せず)等を備えていると考えても良い。ただし、実行部やテストデータ格納部を実行済ソースコード検出部102の外部に備えていても良い。このような実行部は、例えば、MPUやメモリ等から実現され、処理手順は、通常、ソフトウェアで実現される。また、テストデータ格納部は、不揮発性または揮発性の記憶媒体等において実現される。   The executed source code detection unit 102 may be considered to include an execution unit (not shown) for executing a program based on the source program and performing, for example, one or more tests specified in advance. good. Further, it may be considered that a test data storage unit (not shown) or the like that stores data used for the test, data indicating a test procedure, and the like are stored. However, the execution unit and the test data storage unit may be provided outside the executed source code detection unit 102. Such an execution part is implement | achieved from MPU, memory, etc., for example, and a process sequence is normally implement | achieved by software. Further, the test data storage unit is realized in a nonvolatile or volatile storage medium or the like.

変換関連情報取得部103は、実行済ソースコード検出部102で検出された実行済ソースコードのうちの、第二命令パターンに対応するソースコードに変換された部分に関する情報である変換関連情報を取得する。第二命令パターンに対応するソースコードに変換された部分とは、具体的には、ソースプログラム内の第二命令パターンが示すパターンとなるように変換されたソースコードであり、第二命令パターンを用いて変換されたソースコードと考えても良い。   The conversion related information acquisition unit 103 acquires conversion related information that is information about a portion of the executed source code detected by the executed source code detection unit 102 that has been converted into a source code corresponding to the second instruction pattern. To do. Specifically, the portion converted to the source code corresponding to the second instruction pattern is the source code converted so as to be the pattern indicated by the second instruction pattern in the source program, and the second instruction pattern is It may be considered as source code converted by using.

変換関連情報取得部103は、例えば、実行済ソースコード検出部102で検出された実行済ソースコードのうちの、第二命令パターンに対応するソースコードに変換された部分を検出し、この検出した情報を用いて変換関連情報を取得する。変換関連情報は、第二命令パターンに対応するソースコードに変換された部分に関する情報であれば、変換されたソースコードについての情報や、このソースコードを含む情報であっても良いし、変換に用いられた第二命令パターンに関する情報であっても良い。   The conversion related information acquisition unit 103 detects, for example, a portion of the executed source code detected by the executed source code detection unit 102 that has been converted into a source code corresponding to the second instruction pattern. The conversion related information is acquired using the information. The conversion related information may be information about the converted source code or information including the source code as long as it is information related to the portion converted into the source code corresponding to the second instruction pattern. Information on the second command pattern used may be used.

変換関連情報取得部103は、例えば、実行済ソースコードのうちの、第二命令パターンに対応するソースコードに変換された部分の変換に用いられた異なる第二命令パターンを示す情報である変換関連情報を取得しても良い。言い換えれば実行済ソースコードの変換に用いられた第二命令パターンのパターン(パターンの種類)を示す情報、例えば第二命令パターンを示すリスト等の情報である変換関連情報を取得しても良い。第二命令パターンを示す情報とは、第二命令パターンそのものであっても良いし、第二命令パターンの識別情報であっても良い。   The conversion related information acquisition unit 103 is, for example, conversion related information that is information indicating a different second instruction pattern used for conversion of a portion of the executed source code that has been converted into a source code corresponding to the second instruction pattern. Information may be acquired. In other words, information related to the second instruction pattern (pattern type) used for conversion of the executed source code, for example, conversion related information that is information such as a list indicating the second instruction pattern may be acquired. The information indicating the second command pattern may be the second command pattern itself or identification information of the second command pattern.

また、変換関連情報取得部103は、例えば、実行済ソースコードのうちの、第二命令パターンに対応するソースコードに変換された部分の変換に用いられた異なる第二命令パターンの出現量に関する情報を変換関連情報として取得しても良い。即ち、実行済ソースコードを構成するソースコードの変換に用いられた第二命令パターンの出現量に関する情報を取得してもよい。異なる第二命令パターンの出現量は、出現する、即ち変換に用いられた第二命令パターンの種類の数と考えても良いし、変換に用いられた第二命令パターンの総数、即ち第二命令パターンのいずれかで変換された部分の数であっても良い。出現量に関する変換関連情報とは、例えば、出現する第二命令パターンの数を示す情報であっても良いし、出現する異なる第二命令パターンの数を示す情報であっても良い。また、例えば、ソースプログラムの第二命令パターンに対応するソースコードに変換された部分の変換に用いられた異なる第二命令パターンの数に対する、実行済ソースコードのうちの、第二命令パターンに対応するソースコードに変換された部分の変換に用いられた異なる第二命令パターンの数の比率を示す情報でもよい。つまり、変換されたソースプログラム内のソースコードに対応する異なる全てあるいは一部の第二命令パターン数に対する、実行済ソースコードに含まれるソースコードに対応する異なる全てあるいは一部の第二命令パターン数の比率を示す情報であってもよい。   In addition, the conversion related information acquisition unit 103 is, for example, information on the appearance amount of different second instruction patterns used for conversion of the portion of the executed source code converted into the source code corresponding to the second instruction pattern. May be acquired as conversion related information. That is, information regarding the appearance amount of the second instruction pattern used for conversion of the source code constituting the executed source code may be acquired. The appearance amount of different second command patterns may be considered as the number of types of second command patterns that appear, that is, used for conversion, or the total number of second command patterns used for conversion, that is, second commands. It may be the number of parts converted in any of the patterns. The conversion related information related to the appearance amount may be information indicating the number of second command patterns that appear, or information indicating the number of different second command patterns that appear. Also, for example, corresponding to the second instruction pattern in the executed source code with respect to the number of different second instruction patterns used for conversion of the part converted into the source code corresponding to the second instruction pattern of the source program It may be information indicating the ratio of the number of different second instruction patterns used for the conversion of the portion converted into the source code. That is, the number of different all or part of second instruction patterns corresponding to the source code included in the executed source code with respect to the number of all different or part of second instruction patterns corresponding to the source code in the converted source program. It may be information indicating the ratio.

この実施の形態においては、変換関連情報取得部103が、後述する実行済命令パターン検出手段1031、変換命令パターン検出手段1032、および第一変換関連情報取得手段1033を用いて変換関連情報を取得する場合を例に挙げて説明する。   In this embodiment, the conversion related information acquisition unit 103 acquires conversion related information using an executed command pattern detection unit 1031, a conversion command pattern detection unit 1032 and a first conversion related information acquisition unit 1033 described later. A case will be described as an example.

変換関連情報取得部103は、通常、MPUやメモリ等の記憶媒体等から実現され得る。変換関連情報取得部103の処理手順は、通常、ソフトウェアで実現され、当該ソフトウェアはROM等の記録媒体に記録されている。但し、ハードウェア(専用回路)で実現しても良い。   The conversion related information acquisition unit 103 can be usually realized by a storage medium such as an MPU or a memory. The processing procedure of the conversion related information acquisition unit 103 is usually realized by software, and the software is recorded on a recording medium such as a ROM. However, it may be realized by hardware (dedicated circuit).

実行済命令パターン検出手段1031は、実行済ソースコード検出部102は、実行済ソースコードに含まれるソースコードと対応する第二命令パターンである実行済命令パターンを検出する。なお、ここでの第二命令パターンの検出とは、第二命令パターンそのものを検出することと考えても良いし、第二命令パターンを示す情報、具体的には第二命令パターンの識別情報を検出することと考えても良い。   In the executed instruction pattern detection unit 1031, the executed source code detection unit 102 detects an executed instruction pattern which is a second instruction pattern corresponding to the source code included in the executed source code. The detection of the second command pattern here may be considered as detecting the second command pattern itself, or information indicating the second command pattern, specifically, identification information of the second command pattern. You may think that it detects.

実行済命令パターン検出手段1031は、例えば、上述したように、ソースプログラム内のソースコードと、当該ソースコードに対応する第二命令パターンを示す情報とが対応付けてソースプログラム格納部101に格納されている場合、ソースプログラム格納部101にソースコードと対応付けて格納されている第二命令パターンを示す情報の中から、実行済ソースコード検出部102が検出した実行済ソースコード内に含まれるソースコードと対応付けられた第二命令パターンを示す情報を検出することにより実行済命令パターンである第二命令パターンを検出する。なお、第二命令パターンを示す情報が第二命令パターンそのものではない場合において、第二命令パターンそのものの検出が必要な場合、検出した第二命令パターンを示す情報から、この情報が示す第二命令パターンを検出すればよい。   For example, as described above, the executed instruction pattern detection unit 1031 stores the source code in the source program and the information indicating the second instruction pattern corresponding to the source code in the source program storage unit 101 in association with each other. The source included in the executed source code detected by the executed source code detection unit 102 from the information indicating the second instruction pattern stored in the source program storage unit 101 in association with the source code. A second instruction pattern which is an executed instruction pattern is detected by detecting information indicating a second instruction pattern associated with the code. If the information indicating the second command pattern is not the second command pattern itself, and the second command pattern itself needs to be detected, the second command indicated by this information is detected from the detected information indicating the second command pattern. What is necessary is just to detect a pattern.

また、実行済命令パターン検出手段1031は、実行済ソースコード検出部102が検出した実行済ソースコードと、後述する第二命令パターン格納部105に格納されている第二命令パターンとのパターンマッチングを順次行って、実行済ソースコードに含まれるソースコードに対応する第二命令パターンを検出してもよい。ここでのパターンマッチングは、正規表現を用いた検索処理と同様の処理と考えても良い。例えば、実行済命令パターン検出手段1031は、パターンマッチングにより第二命令パターンの固定語や変換語等の出現パターンと対応する固定語や非固定語等の出現パターンを有するソースコードを、実行済ソースコード内において検出する。ここでの対応とは、パターンマッチングや正規表現を用いた検索における一致と考えても良い。このとき、第二命令パターン内の変換語の部分については、この変換語に対応した属性の文字列の非固定語がソースコード内に検出された場合に、対応する、あるいは一致すると判断する。例えば、識別情報が「C0001」である第二命令パターンが「move * to *」であり、「move」と「to」が固定語であり、「*」がアルファベットまたは数字のいずれかを示す変換語であったとすると、第二命令パターン「C0001」が、実行済ソースコード内の「move A001 to *B001」というソースコードに対応している第二命令パターンであるとして検出される。   The executed instruction pattern detection means 1031 performs pattern matching between the executed source code detected by the executed source code detection unit 102 and a second instruction pattern stored in a second instruction pattern storage unit 105 described later. The second instruction pattern corresponding to the source code included in the executed source code may be detected sequentially. Pattern matching here may be considered as processing similar to search processing using regular expressions. For example, the executed instruction pattern detection unit 1031 uses the source code having the occurrence pattern of the fixed word or the non-fixed word corresponding to the appearance pattern of the fixed word or conversion word of the second instruction pattern by the pattern matching. Detect in code. The correspondence here may be considered as matching in a search using pattern matching or regular expressions. At this time, the conversion word portion in the second instruction pattern is determined to correspond or match when a non-fixed word of an attribute character string corresponding to the conversion word is detected in the source code. For example, the second command pattern whose identification information is “C0001” is “move * to *”, “move” and “to” are fixed words, and “*” indicates either alphabet or number. If it is a word, the second instruction pattern “C0001” is detected as a second instruction pattern corresponding to the source code “move A001 to * B001” in the executed source code.

なお、パターンマッチングを行う際には、実行済ソースコードから、予め指定されたルールに従って、ソースコードが命令パターンに変換される単位と同じ単位ごとに、ソースコードを切り出し、この切り出したソースコードと,第二命令パターンとのパターンマッチングを行うようにしても良い。特に、ソースプログラムに対応したプログラムの実行時にソースプログラムから読み出すソースコードの単位と、第二命令パターンを用いて変換されるソースコードの単位とが同じ単位である場合、この単位で実行済ソースコードからソースコードを取り出し、取り出したソースコードと第二命令パターンとの比較を行うようにしてもよい。例えば、改行コードや行番号等の予め指定された区切りのための予め指定された指定情報等で区切られたソースコードを単位として実行済ソースコードから切り出したソースコードと第二命令パターンとを比較しても良い。指定情報については後述する。   When performing pattern matching, the source code is cut out from the executed source code for each unit that is the same as the unit in which the source code is converted into the instruction pattern in accordance with a predetermined rule. , Pattern matching with the second command pattern may be performed. In particular, if the source code unit read from the source program when the program corresponding to the source program is executed and the source code unit converted using the second instruction pattern are the same unit, the source code already executed in this unit The source code may be extracted from the source code, and the extracted source code may be compared with the second instruction pattern. For example, compare the source code cut from the executed source code with the second instruction pattern in units of source code delimited by predesignated specification information for predesignated delimiters such as line feed code and line number You may do it. The designation information will be described later.

実行済命令パターン検出手段1031は、検出した実行済命令パターン、もしくは実行済命令パターンを示す情報(例えば識別情報等)を取得して、図示しない記憶媒体等の格納部等に蓄積しても良いし、実行済ソースコードについて検出された第二命令パターンであることを示す情報、例えばフラグ等を、後述する第二命令パターン格納部105に格納されている第二命令パターンのうちの、検出された第二命令パターンに付与するようにしても良い。   The executed instruction pattern detection unit 1031 may acquire the detected executed instruction pattern or information indicating the executed instruction pattern (for example, identification information) and store it in a storage unit or the like (not shown). Information indicating that the second instruction pattern is detected for the executed source code, such as a flag, is detected from the second instruction patterns stored in the second instruction pattern storage unit 105 described later. The second command pattern may be given.

実行済命令パターン検出手段1031は、通常、MPUやメモリ等から実現され得る。実行済命令パターン検出手段1031の処理手順は、通常、ソフトウェアで実現され、当該ソフトウェアはROM等の記録媒体に記録されている。但し、ハードウェア(専用回路)で実現しても良い。   The executed instruction pattern detection unit 1031 can be usually realized by an MPU, a memory, or the like. The processing procedure of the executed instruction pattern detection unit 1031 is usually realized by software, and the software is recorded on a recording medium such as a ROM. However, it may be realized by hardware (dedicated circuit).

変換命令パターン検出手段1032は、ソースプログラムに含まれるソースコードと対応する第二命令パターンである変換命令パターンを検出する。ここで述べるソースプログラムは、実行済ソースコードの検出対象となったソースプログラムである。なお、ここでの第二命令パターンの検出とは、第二命令パターンそのものを検出することと考えても良いし、第二命令パターンを示す情報、具体的には第二命令パターンの識別情報を検出することと考えても良い。   The conversion command pattern detection unit 1032 detects a conversion command pattern that is a second command pattern corresponding to the source code included in the source program. The source program described here is a source program that is a detection target of the executed source code. The detection of the second command pattern here may be considered as detecting the second command pattern itself, or information indicating the second command pattern, specifically, identification information of the second command pattern. You may think that it detects.

変換命令パターン検出手段1032が、ソースプログラムから変換命令パターンを検出する処理は、上述した実行済命令パターン検出手段1031が、実行済ソースプログラムから実行済命令パターンを検出する処理と同様であるので詳細な説明は省略する。   The process in which the conversion instruction pattern detection unit 1032 detects the conversion instruction pattern from the source program is the same as the process in which the executed instruction pattern detection unit 1031 described above detects the executed instruction pattern from the executed source program. Detailed explanation is omitted.

変換命令パターン検出手段1032は、検出した変換命令パターン、もしくは変換命令パターンを示す情報(例えば識別情報等)を取得して、図示しない記憶媒体等の格納部等に蓄積しても良いし、ソースプログラムについて検出された第二命令パターンであることを示す情報、例えばフラグ等を、後述する第二命令パターン格納部105に格納されている第二命令パターンのうちの、検出された第二命令パターンに付与するようにしても良い。   The conversion command pattern detection unit 1032 may acquire the detected conversion command pattern or information indicating the conversion command pattern (for example, identification information) and store it in a storage unit such as a storage medium (not shown). Information indicating that it is the second instruction pattern detected for the program, for example, a flag, etc., among the second instruction patterns stored in the second instruction pattern storage unit 105 described later, the detected second instruction pattern You may make it give to.

変換命令パターン検出手段1032は、通常、MPUやメモリ等から実現され得る。変換命令パターン検出手段1032の処理手順は、通常、ソフトウェアで実現され、当該ソフトウェアはROM等の記録媒体に記録されている。但し、ハードウェア(専用回路)で実現しても良い。   The conversion command pattern detection unit 1032 can be usually realized by an MPU, a memory, or the like. The processing procedure of the conversion command pattern detection means 1032 is usually realized by software, and the software is recorded on a recording medium such as a ROM. However, it may be realized by hardware (dedicated circuit).

第一変換関連情報取得手段1033は、実行済命令パターン検出手段1031が検出した第二命令パターンに関する変換関連情報を取得する。   The first conversion related information acquisition unit 1033 acquires conversion related information related to the second command pattern detected by the executed command pattern detection unit 1031.

例えば、実行済命令パターン検出手段1031が検出した第二命令パターンに関する情報を含む変換関連情報を取得する。具体的には、実行済命令パターン検出手段1031が検出した異なる第二命令パターンを変換関連情報として取得する。異なる第二命令パターンとは、ここでは、ユニークな第二命令パターンを意味する。第一変換関連情報取得手段1033は、例えば、実行済命令パターン検出手段1031が検出した1以上の第二命令パターン群から、重複するものを一つだけ残して削除して得られた第二命令パターン群を変換関連情報として取得する。この場合、例えば、第二命令パターン群のリスト化したものを変換関連情報としてもよい。あるいは、この第二命令パターン群を構成する第二命令パターンの数をカウントして得られた値を、第二命令パターンの出現量に関する変換関連情報として取得してもよい。   For example, the conversion related information including the information related to the second command pattern detected by the executed command pattern detection unit 1031 is acquired. Specifically, a different second command pattern detected by the executed command pattern detection unit 1031 is acquired as conversion related information. Here, the different second command pattern means a unique second command pattern. The first conversion related information acquisition unit 1033 is, for example, a second command obtained by deleting one or more second command pattern groups detected by the executed command pattern detection unit 1031 while leaving only one duplicate. A pattern group is acquired as conversion related information. In this case, for example, a list of the second command pattern group may be used as the conversion related information. Or you may acquire the value obtained by counting the number of the 2nd command patterns which comprise this 2nd command pattern group as the conversion relevant information regarding the appearance amount of a 2nd command pattern.

また、第一変換関連情報取得手段1033は、変換命令パターン検出手段1032が検出した異なる変換命令パターンの数に対する、実行済命令パターン検出手段1031が検出した異なる実行済命令パターンの数の比率を示す情報を含む変換関連情報を取得しても良い。異なる変換命令パターンおよび異なる実行済命令パターンは、上記と同様に、ユニークな変換命令パターンおよび実行済命令パターンを意味する。即ち、第一変換関連情報取得手段1033は、実行済命令パターン検出手段1031が検出した1以上の第二命令パターン群から、重複するものを一つだけ残して削除して得られた第二命令パターン群を変換関連情報として取得する。この場合、例えば、第二命令パターン群のリスト化したものを変換関連情報としてもよい。あるいは、この第二命令パターン群を構成する第二命令パターンの数をカウントして得られた値を、異なる第二命令パターンの出現量に関する変換関連情報として取得してもよい。   The first conversion related information acquisition unit 1033 indicates the ratio of the number of different executed instruction patterns detected by the executed instruction pattern detection unit 1031 to the number of different conversion instruction patterns detected by the conversion instruction pattern detection unit 1032. Conversion related information including information may be acquired. Different conversion instruction patterns and different executed instruction patterns mean unique conversion instruction patterns and executed instruction patterns as described above. That is, the first conversion related information acquisition unit 1033 is a second command obtained by deleting one or more second command pattern groups detected by the executed command pattern detection unit 1031 while leaving only one duplicate. A pattern group is acquired as conversion related information. In this case, for example, a list of the second command pattern group may be used as the conversion related information. Or you may acquire the value obtained by counting the number of the 2nd command patterns which comprise this 2nd command pattern group as the conversion relevant information regarding the appearance amount of a different 2nd command pattern.

また、第一変換関連情報取得手段1033は、以下のように第二命令パターンの出現量に関する変換関連情報を取得してもよい。まず、第一変換関連情報取得手段1033は、例えば、実行済命令パターン検出手段1031が検出した1以上の第二命令パターン群から、重複するものを一つだけ残して削除して得られた実行済命令パターン群を取得し、この実行済命令パターン群を構成する第二命令パターンの数をカウントする。また、変換命令パターン検出手段1032が検出した1以上の第二命令パターン群から、重複するものを一つだけ残して削除して得られた変換命令パターン群を取得し、この変換命令パターン群を構成する第二命令パターンの数をカウントする。そして、変換命令パターン群を構成する第二命令パターンの数に対する実行済命令パターン群を構成する第二命令パターンの数の比率を算出して、算出した比率を第二命令パターンの出現量に関する変換関連情報として取得する。   Further, the first conversion related information acquisition unit 1033 may acquire conversion related information related to the appearance amount of the second command pattern as follows. First, the first conversion related information obtaining unit 1033 executes, for example, an execution obtained by deleting only one duplicated one from one or more second command pattern groups detected by the executed command pattern detecting unit 1031. A completed instruction pattern group is acquired, and the number of second instruction patterns constituting the executed instruction pattern group is counted. Further, a conversion instruction pattern group obtained by deleting only one duplicated object is obtained from one or more second instruction pattern groups detected by the conversion instruction pattern detection unit 1032, and the conversion instruction pattern group is The number of second instruction patterns to be configured is counted. Then, the ratio of the number of second instruction patterns constituting the executed instruction pattern group to the number of second instruction patterns constituting the conversion instruction pattern group is calculated, and the calculated ratio is converted with respect to the appearance amount of the second instruction pattern. Obtained as related information.

第一変換関連情報取得手段1033は、通常、MPUやメモリ等から実現され得る。第一変換関連情報取得手段1033の処理手順は、通常、ソフトウェアで実現され、当該ソフトウェアはROM等の記録媒体に記録されている。但し、ハードウェア(専用回路)で実現しても良い。   The first conversion related information acquisition unit 1033 can be usually realized by an MPU, a memory, or the like. The processing procedure of the first conversion related information acquisition unit 1033 is usually realized by software, and the software is recorded in a recording medium such as a ROM. However, it may be realized by hardware (dedicated circuit).

出力部104は、変換関連情報取得部103が取得した変換関連情報を出力する。ここで述べる出力とは、ディスプレイへの表示、プロジェクターを用いた投影、プリンタへの印字、音出力、外部の装置への送信、記録媒体への蓄積、他の処理装置や他のプログラムなどへの処理結果の引渡しなどを含む概念である。   The output unit 104 outputs the conversion related information acquired by the conversion related information acquisition unit 103. The output described here refers to display on a display, projection using a projector, printing on a printer, sound output, transmission to an external device, storage in a recording medium, output to another processing device or other program, etc. It is a concept that includes delivery of processing results.

出力部104は、ディスプレイやスピーカー等の出力デバイスを含むと考えても含まないと考えても良い。出力部104は、出力デバイスのドライバーソフトまたは、出力デバイスのドライバーソフトと出力デバイス等で実現され得る。   The output unit 104 may or may not include an output device such as a display or a speaker. The output unit 104 can be implemented by output device driver software, or output device driver software and an output device.

第二命令パターン格納部105には、ソースプログラムの変換に用いられた第二命令パターンを含む第二命令パターンが格納され得る。このソースプログラムは、具体的には、実行済ソースコードの検出対象となったソースプログラムである。第二命令パターン格納部105には、ソースプログラムの変換に用いられた第二命令パターンが少なくとも格納されていればよい。また、第二命令パターン格納部105には、第二命令パターンと、この第二命令パターンに対応する第一命令パターンとが対応付けられて格納されていても良い。   The second command pattern storage unit 105 can store a second command pattern including the second command pattern used for the source program conversion. Specifically, this source program is a source program that is a target of detection of executed source code. The second command pattern storage unit 105 only needs to store at least the second command pattern used for source program conversion. The second command pattern storage unit 105 may store a second command pattern and a first command pattern corresponding to the second command pattern in association with each other.

第二命令パターン格納部105に第二命令パターンが記憶される過程は問わない。例えば、ソースプログラムの変換に用いられた第二命令パターンがユーザ等により蓄積されても良い。あるいは、ソースプログラムの変換に用いられる第二命令パターンが格納されている格納部をそのまま第二命令パターン格納部105として用いても良い。   The process of storing the second command pattern in the second command pattern storage unit 105 does not matter. For example, a second command pattern used for source program conversion may be accumulated by a user or the like. Alternatively, a storage unit storing a second instruction pattern used for source program conversion may be used as the second instruction pattern storage unit 105 as it is.

第二命令パターン格納部105は、不揮発性の記録媒体が好適であるが、揮発性の記録媒体でも実現可能である。なお、変換関連情報取得部103、具体的には実行済命令パターン検出手段1031が、パターンマッチングにより実行済命令パターンを検出しない場合、第二命令パターン格納部105は、省略可能である。   The second command pattern storage unit 105 is preferably a non-volatile recording medium, but can also be realized by a volatile recording medium. When the conversion related information acquisition unit 103, specifically, the executed command pattern detection unit 1031 does not detect the executed command pattern by pattern matching, the second command pattern storage unit 105 can be omitted.

次に、プログラム検証装置1の動作について図2のフローチャートを用いて説明する。ここでは、ソースプログラム格納部101に格納されているソースプログラムの、第二命令パターンにより変換された部分(ソースコード群)には、変換に用いられた第二命令パターンを示す情報が対応付けられている場合を例に挙げて説明する。   Next, the operation of the program verification apparatus 1 will be described using the flowchart of FIG. Here, the part (source code group) of the source program stored in the source program storage unit 101 converted by the second instruction pattern is associated with information indicating the second instruction pattern used for the conversion. An example will be described.

(ステップS201)実行済ソースコード検出部102は、ソースプログラム格納部101からソースプログラムを読み出す。   (Step S <b> 201) The executed source code detection unit 102 reads a source program from the source program storage unit 101.

(ステップS202)実行済ソースコード検出部102は、ステップS201で読み出したソースプログラムから実行済ソースコードを検出する。例えば、ステップS201で読み出したソースプログラムに基づくプログラムを実行させて、予め指定された1以上のテスト用のデータ等を用いて1以上のテストを行い、そのテストで使用されたソースコードである実行済ソースコード、即ちソースプログラムに基づくプログラムのうちの、テストで使用された部分に対応するソースコードを検出する。ソースプログラムのコンパイルが必要な場合には、適宜コンパイルを行うようにしても良い。テスト用のデータやテストを指示する情報等は、例えば図示しない記憶媒体等により構成されるテスト関連情報格納部(図示せず)等に予め格納しておくようにすればよい。検出した実行済ソースコードについては、例えば、その実行済ソースコードが含まれる部分に対して、実行済ソースコードが含まれる部分であることを示す情報、例えばフラグ等を、ソースプログラム等に付与する。例えば、ソースプログラムが行単位でソースコードが記述されたものである場合、実行済ソースコードの行に、フラグ等の情報を付与してもよい。あるいは、実行済ソースコードをソースプログラムから読み出して、図示しない記憶媒体等の格納部に蓄積しても良い。また、例えば、ソースプログラムが行単位でソースコードが記述されたものである場合、実行済ソースコードが含まれる行番号を取得して、図示しない記憶媒体等の格納部に蓄積しても良い。   (Step S202) The executed source code detector 102 detects the executed source code from the source program read in step S201. For example, by executing a program based on the source program read in step S201, performing one or more tests using one or more test data specified in advance, and executing the source code used in the test The source code corresponding to the portion used in the test of the completed source code, that is, the program based on the source program is detected. When the source program needs to be compiled, it may be appropriately compiled. The test data, information for instructing the test, and the like may be stored in advance in a test related information storage unit (not shown) configured by a storage medium (not shown), for example. For the detected executed source code, for example, information indicating that the executed source code is a part including the executed source code, for example, a flag or the like is given to the source program or the like. . For example, if the source program is one in which the source code is described in units of lines, information such as a flag may be added to the line of the executed source code. Alternatively, the executed source code may be read from the source program and accumulated in a storage unit such as a storage medium (not shown). Further, for example, when the source program is one in which the source code is described in line units, the line number including the executed source code may be acquired and accumulated in a storage unit such as a storage medium (not shown).

(ステップS203)実行済命令パターン検出手段1031は、ステップS202で検出した実行済ソースコードに含まれる、第二命令パターンに対応するソースコード、具体的には,第二命令パターンで変換されたソースコードを検出する。具体的には、ここでは、上述したように、ソースプログラムの第二命令パターンで変換された部分については、変換に用いられた第二命令パターンを示す情報と対応付けられていることから、ステップS202で検出した実行済ソースコードのうちの、第二命令パターンを示す情報と対応付けられたソースコードを検出する。   (Step S203) The executed instruction pattern detection unit 1031 includes the source code corresponding to the second instruction pattern included in the executed source code detected in step S202, specifically, the source converted by the second instruction pattern. Detect code. Specifically, here, as described above, since the portion converted by the second instruction pattern of the source program is associated with the information indicating the second instruction pattern used for the conversion, the step Of the executed source code detected in S202, the source code associated with the information indicating the second instruction pattern is detected.

(ステップS204)実行済命令パターン検出手段1031は、ステップS203で検出したソースコードに対応付けられた第二命令パターンを示す情報を取得する。取得した第二命令パターンを示す情報は、図示しない記憶媒体等に蓄積する。   (Step S204) The executed instruction pattern detection unit 1031 acquires information indicating the second instruction pattern associated with the source code detected in Step S203. Information indicating the acquired second command pattern is stored in a storage medium (not shown).

(ステップS205)実行済命令パターン検出手段1031は、ステップS204において取得した第二命令パターンを示す情報に対してユニーク処理を行う。即ち同じ第二命令パターンを示す情報を一つだけ残して削除することで重複をなくす処理を行う。これにより実施済命令パターンが得られる。   (Step S205) The executed instruction pattern detection unit 1031 performs a unique process on the information indicating the second instruction pattern acquired in step S204. That is, a process for eliminating duplication is performed by deleting only one piece of information indicating the same second command pattern. As a result, an executed instruction pattern is obtained.

(ステップS206)変換命令パターン検出手段1032は、ステップS201において読み出したソースプログラムに含まれる第二命令パターンに対応するソースコードを検出する。具体的には、ソースプログラムから、第二命令パターンを示す情報と対応付けられたソースコードを検出する。   (Step S206) The conversion command pattern detection unit 1032 detects the source code corresponding to the second command pattern included in the source program read in Step S201. Specifically, the source code associated with the information indicating the second instruction pattern is detected from the source program.

(ステップS207)変換命令パターン検出手段1032は、ステップS206で検出したソースコードに対応付けられた第二命令パターンを示す情報を取得する。取得した第二命令パターンを示す情報は、図示しない記憶媒体等に蓄積する。   (Step S207) The conversion command pattern detection unit 1032 acquires information indicating the second command pattern associated with the source code detected in Step S206. Information indicating the acquired second command pattern is stored in a storage medium (not shown).

(ステップS208)第一変換関連情報取得手段1033は、ステップS207において取得した第二命令パターンを示す情報に対してユニーク処理を行う。即ち同じ第二命令パターンを示す情報を一つだけ残して削除することで重複をなくす処理を行う。これにより変換命令パターンが得られる。   (Step S208) The first conversion related information acquisition unit 1033 performs a unique process on the information indicating the second command pattern acquired in Step S207. That is, a process for eliminating duplication is performed by deleting only one piece of information indicating the same second command pattern. Thereby, a conversion command pattern is obtained.

(ステップS209)第一変換関連情報取得手段1033は、ステップS205において取得した実施済命令パターンの数をカウントする。また、ステップS208において取得した変換命令パターンの数をカウントする。そして、実施済命令パターンの数を変換命令パターンの数で除算して、変換命令パターンの数に対する実施済命令パターン数の比率である変換関連情報を求める。   (Step S209) The first conversion related information acquisition unit 1033 counts the number of executed command patterns acquired in step S205. In addition, the number of conversion command patterns acquired in step S208 is counted. Then, the number of executed instruction patterns is divided by the number of conversion instruction patterns to obtain conversion-related information that is the ratio of the number of executed instruction patterns to the number of conversion instruction patterns.

(ステップS210)出力部104は、ステップS209で取得した変換関連情報を出力する。なお、ステップS205において取得した実施済命令パターンのリスト等の情報も出力しても良い。そして、処理を終了する。   (Step S210) The output unit 104 outputs the conversion related information acquired in step S209. Information such as a list of executed command patterns acquired in step S205 may also be output. Then, the process ends.

図3は、プログラム検証装置1の動作の変形例について示すフローチャートである。ここでは、上記とは異なり、ソースプログラム格納部101に格納されているソースプログラムおよび実行済ソースコードから、第二命令パターン格納部105に格納されている第二命令パターンを用いて、パターンマッチングにより第二命令パターンにより変換された部分(ソースコード群)を検出する場合の動作の例を説明する。   FIG. 3 is a flowchart showing a modified example of the operation of the program verification apparatus 1. Here, unlike the above, pattern matching is performed using the second instruction pattern stored in the second instruction pattern storage unit 105 from the source program and the executed source code stored in the source program storage unit 101. An example of the operation when detecting a portion (source code group) converted by the second command pattern will be described.

(ステップS301)実行済ソースコード検出部102は、ソースプログラム格納部101からソースプログラムを読み出す。   (Step S301) The executed source code detection unit 102 reads the source program from the source program storage unit 101.

(ステップS302)実行済ソースコード検出部102は、ステップS301で読み出したソースプログラムから、実行済ソースコードを検出する。例えば、ステップS202と同様に、ステップS301で読み出したソースプログラムに対応したプログラムを実行して、予め指定された1以上のテスト用のデータ等を用いて1以上のテストを行い、ソースプログラムに対応したプログラムのうちの、そのテストで使用された部分に対応するソースコードである実行済ソースコードをソースプログラムから検出する。   (Step S302) The executed source code detection unit 102 detects the executed source code from the source program read in step S301. For example, as in step S202, the program corresponding to the source program read in step S301 is executed, and one or more tests are performed using one or more test data specified in advance, and the source program is supported. The executed source code, which is the source code corresponding to the part used in the test, is detected from the source program.

(ステップS303)実行済命令パターン検出手段1031は、カウンターnに1を代入する。   (Step S303) The executed instruction pattern detection means 1031 substitutes 1 for the counter n.

(ステップS304)変換関連情報取得部103は、n番目の第二命令パターンを、第二命令パターン格納部105から読み出す。   (Step S <b> 304) The conversion related information acquisition unit 103 reads the nth second command pattern from the second command pattern storage unit 105.

(ステップS305)実行済命令パターン検出手段1031は、ステップS302で検出した実行済ソースコード内に、n番目の第二命令パターンと一致するソースコードがあるか否かを検出する。例えば、実行済ソースコードの先頭から、順番にn番目の第二命令パターンに対応するソースコードがあるか否かを、パターンマッチングにより判断していく。一致するものが検出された時点で、ステップS306に進み、検出されなかった場合、ステップS307に進む。   (Step S305) The executed instruction pattern detection unit 1031 detects whether or not there is a source code that matches the nth second instruction pattern in the executed source code detected in step S302. For example, it is determined by pattern matching whether there is a source code corresponding to the nth second instruction pattern in order from the top of the executed source code. If a match is detected, the process proceeds to step S306. If not, the process proceeds to step S307.

(ステップS306)実行済命令パターン検出手段1031は、ステップS305で検出された第二命令パターンを実行済命令パターンとして、図示しない記憶媒体等の格納部に蓄積する。   (Step S306) The executed instruction pattern detection means 1031 accumulates the second instruction pattern detected in step S305 as an executed instruction pattern in a storage unit such as a storage medium (not shown).

(ステップS307)変換命令パターン検出手段1032は、ステップS301で読み出したソースプログラム内に、n番目の第二命令パターンと一致するソースコードがあるか否かを検出する。例えば、ソースプログラムの先頭から、順番にn番目の第二命令パターンに対応するソースコードがあるか否かを、パターンマッチングにより判断していく。一致するものが検出された時点で、ステップS308に進み、検出されなかった場合、ステップS309に進む。   (Step S307) The conversion instruction pattern detection unit 1032 detects whether or not there is a source code matching the nth second instruction pattern in the source program read in Step S301. For example, it is determined by pattern matching whether there is source code corresponding to the nth second instruction pattern in order from the top of the source program. When a match is detected, the process proceeds to step S308. If not, the process proceeds to step S309.

(ステップS308)変換命令パターン検出手段1032は、ステップS307で検出された第二命令パターンを変換命令パターンとして、図示しない記憶媒体等の格納部に蓄積する。   (Step S308) The conversion command pattern detection unit 1032 accumulates the second command pattern detected in Step S307 as a conversion command pattern in a storage unit such as a storage medium (not shown).

(ステップS309)変換関連情報取得部103は、カウンターnの値を1インクリメントする。   (Step S309) The conversion related information acquisition unit 103 increments the value of the counter n by 1.

(ステップS310)変換関連情報取得部103は、n番目の第二命令パターンが第二命令パターン格納部105に格納されているか否かを判断する。格納されている場合、ステップS304に戻り、格納されていない場合、ステップS311に進む。   (Step S <b> 310) The conversion related information acquisition unit 103 determines whether or not the nth second command pattern is stored in the second command pattern storage unit 105. If stored, the process returns to step S304, and if not stored, the process proceeds to step S311.

(ステップS311)第一変換関連情報取得手段1033は、ステップS306で蓄積した実行済命令パターンの数をカウントする。また、ステップS308で蓄積した変換命令パターンの数をカウントする。そして、実施済命令パターンの数を変換命令パターンの数で除算して、変換命令パターンの数に対する実施済命令パターン数の比率である変換関連情報を求める。   (Step S311) The first conversion related information acquisition unit 1033 counts the number of executed instruction patterns accumulated in Step S306. In addition, the number of conversion command patterns accumulated in step S308 is counted. Then, the number of executed instruction patterns is divided by the number of conversion instruction patterns to obtain conversion-related information that is the ratio of the number of executed instruction patterns to the number of conversion instruction patterns.

(ステップS312)出力部104は、ステップS311で取得した変換関連情報を出力する。なお、ステップS306で蓄積した実行済命令パターン等の情報も出力しても良い。そして、処理を終了する。   (Step S312) The output unit 104 outputs the conversion related information acquired in step S311. Note that information such as the executed instruction pattern accumulated in step S306 may also be output. Then, the process ends.

以下、本実施の形態におけるプログラム検証装置1の具体的な動作について説明する。   Hereinafter, a specific operation of the program verification apparatus 1 in the present embodiment will be described.

図4は、ソースプログラムの変換に用いられた第一命令パターンと第二命令パターンと、パターンIDとの対応関係を管理するパターン管理表である。このパターン管理表で管理される第一命令パターンや第二命令パターンやパターンIDは、例えば、第二命令パターン格納部105等に格納されている。パターン管理表は、「パターンID」、「第一命令パターン」および「第二命令パターン」という項目を有している。「パターンID」は、第一命令パターンおよび第二命令パターンの組に対応付けられた命令パターンの識別情報である。なお、このパターンIDは、第二命令パターンの識別情報と考えても良いし、第一命令パターンの識別情報と考えても良い。「第一命令パターン」は第一命令パターン、「第二命令パターン」は第二命令パターンである。ここでの第一命令パターンおよび第二命令パターンは、行単位でソースコードの変換を行うために用意された命令パターンであるとする。この管理表においては、対応する「第一命令パターン」と「第二命令パターン」と「パターンID」とが一のレコードで管理されている。なお、「パターンID」の末尾が「S」の行から、次に現れる末尾が「E」である「パターンID」の行までのレコードの「第一命令パターン」は、一の第一命令パターンであることを示す。第二命令パターンにおける「#DEL#」は、第一命令パターンに対応した置き換え用の第二命令パターン情報がなく、第一命令パターン情報に対応する第一ソースプログラムの記述箇所を、削除する処理が行われることを示す文字列であるとする。また、第二命令パターンが空欄であるレコードについては、当該レコードの第一命令パターンに対応するソースコードについては変換が行われないことを示す。   FIG. 4 is a pattern management table for managing the correspondence between the first instruction pattern, the second instruction pattern, and the pattern ID used for the source program conversion. The first command pattern, the second command pattern, and the pattern ID managed by this pattern management table are stored in the second command pattern storage unit 105, for example. The pattern management table has items of “pattern ID”, “first command pattern”, and “second command pattern”. The “pattern ID” is identification information of an instruction pattern associated with a set of the first instruction pattern and the second instruction pattern. The pattern ID may be considered as identification information of the second command pattern or may be considered as identification information of the first command pattern. The “first command pattern” is a first command pattern, and the “second command pattern” is a second command pattern. Here, it is assumed that the first instruction pattern and the second instruction pattern are instruction patterns prepared for performing source code conversion in units of lines. In this management table, the corresponding “first command pattern”, “second command pattern”, and “pattern ID” are managed in one record. Note that the “first command pattern” of the record from the “pattern ID” end line “S” to the next “pattern ID” line end “E” is one first command pattern. Indicates that “# DEL #” in the second instruction pattern is a process of deleting the description portion of the first source program corresponding to the first instruction pattern information without the replacement second instruction pattern information corresponding to the first instruction pattern. Is a character string indicating that is performed. For a record in which the second command pattern is blank, it indicates that conversion is not performed for the source code corresponding to the first command pattern of the record.

図5は、ソースプログラム格納部101に格納されているソースプログラムの一例を示す図である。このソースプログラムは、図4に示したようなパターン管理表で管理される第一命令パターンと第二命令パターンとを用いて、予め用意された変換前のソースプログラム(図示せず)の第一の命令パターンに対応するソースコードを、この第一命令パターンに対応する第二命令パターンに対応するソースコードに変換して得られた、パターン変換済のソースプログラムであるとする。パターン変換の処理については、ここでは説明を省略する。この変換においては、ソースプログラムの行単位でソースコードの変換が行われたものとする。このソースプログラムにおいては、各行の1から6カラムまでが行番号等を記述する領域であり、各行の81カラム以降がコメントを記述するコメント領域であるとする。また、「*」で始まる文字列(例えば「*」からピリオドや改行コードまでの文字列)は、コメント行であるとする。このソースプログラムのコメント行には、ソースプログラムの変換に用いられた第一命令パターンと第二命令パターンの組みの識別情報であるパターンIDが配置されているものとする。なお、複数行にわたるソースコードが一の第二命令パターンを用いて変換された部分については、変換に用いられた第二命令パターンのパターンIDが、複数行のそれぞれの行のコメント領域に記述されるとともに、その先頭行のパターンIDの末尾には、「S」が、また、最終行のパターンIDの末尾には、「E」が記述されるものとする。なお、ここでは、第二命令パターンによる変換が行われなかった行のコメント領域にも、この行に対応する第一命令パターンに対応付けられたパターンIDが記述されるものとする。   FIG. 5 is a diagram illustrating an example of a source program stored in the source program storage unit 101. This source program uses the first command pattern and the second command pattern managed by the pattern management table as shown in FIG. It is assumed that the source program is a pattern-converted source program obtained by converting the source code corresponding to this instruction pattern into the source code corresponding to the second instruction pattern corresponding to the first instruction pattern. The description of the pattern conversion process is omitted here. In this conversion, it is assumed that the source code is converted line by line in the source program. In this source program, it is assumed that the first to sixth columns of each line are areas for describing line numbers and the like, and the 81st and subsequent columns of each line are comment areas for describing comments. A character string starting with “*” (for example, a character string from “*” to a period or a line feed code) is a comment line. It is assumed that a pattern ID which is identification information of a combination of the first instruction pattern and the second instruction pattern used for conversion of the source program is arranged in the comment line of the source program. In addition, for the part in which the source code over a plurality of lines is converted using one second instruction pattern, the pattern ID of the second instruction pattern used for the conversion is described in the comment area of each of the plurality of lines. In addition, “S” is described at the end of the pattern ID of the first row, and “E” is described at the end of the pattern ID of the last row. Here, it is assumed that the pattern ID associated with the first command pattern corresponding to this line is also described in the comment area of the line that has not been converted by the second command pattern.

まず、ユーザが図5に示したソースプログラムを検証する指示を、メニュー等を操作してプログラム検証装置1に与えると、実行済ソースコード検出部102は、ソースプログラム格納部101に格納されている図5に示したソースプログラムを読み出し、ソースプログラムに対応したプログラムを実行させ、ソースプログラムに対して予め用意された1以上のテストを行う。プログラムの実行は、実行済ソースコード検出部102が行っても良いし、外部に設けられた実行部(図示せず)等により実行させても良い。ここでは、例えばソースプログラムが行単位でソースコードを実行するインタプリタ型のソースプログラムであったとすると、ソースプログラムに対応したプログラムは、ソースプログラム自身であり、ソースプログラムが行単位で実行される。ここでの実行は、ソースプログラムを実際に実行させることであっても良いし、ソースプログラムの動作のシミュレーションの実行であっても良い。なお、ここでのソースプログラムに対応したプログラムの実行は、ソースプログラムに対応したプログラムの、プログラム実行時に使用された部分に対応するソースコードを検出できるようにするために、予め指定された文字列等を付加したソースプログラムに対応したプログラムの実行であっても良い。そして、実行済ソースコード検出部102は、ソースプログラムに対応したプログラムに対して予め用意されたテストを行った場合に使用される部分に対応したソースコードを実行済ソースコードとしてソースプログラムから検出する。ここでは、テストを行った場合に使用されるソースコードを、ソースプログラムの行単位で検出する。この実行済ソースコード検出部102の処理については、いわゆるコードカバレッジツールやデバッガ等の処理と同様であるので、ここでは説明を省略する。実行済ソースコード検出部102は、テストにおいて使用された実行済ソースコードの行を検出し、検出した行の行番号を、実行済ソースコードを示す情報として取得する。取得した行番号を、図示しない記憶媒体等に一時記憶する。   First, when the user gives an instruction to verify the source program shown in FIG. 5 to the program verification apparatus 1 by operating a menu or the like, the executed source code detection unit 102 is stored in the source program storage unit 101. The source program shown in FIG. 5 is read, the program corresponding to the source program is executed, and one or more tests prepared in advance are performed on the source program. The execution of the program may be performed by the executed source code detection unit 102 or may be executed by an execution unit (not shown) provided outside. Here, for example, if the source program is an interpreter type source program that executes source code line by line, the program corresponding to the source program is the source program itself, and the source program is executed line by line. The execution here may be actual execution of the source program, or may be execution of simulation of the operation of the source program. The execution of the program corresponding to the source program here is a character string specified in advance so that the source code corresponding to the portion used at the time of program execution of the program corresponding to the source program can be detected. Execution of a program corresponding to a source program to which etc. are added may be possible. The executed source code detection unit 102 detects, from the source program, a source code corresponding to a portion used when a test prepared in advance is performed on a program corresponding to the source program as an executed source code. . Here, the source code used when the test is performed is detected for each line of the source program. Since the processing of the executed source code detection unit 102 is the same as the processing of a so-called code coverage tool, debugger, etc., description thereof is omitted here. The executed source code detection unit 102 detects the line of the executed source code used in the test, and acquires the line number of the detected line as information indicating the executed source code. The acquired line number is temporarily stored in a storage medium (not shown).

図6は、実行済ソースコード検出部102が検出した実行済ソースコードの行番号を示す図である。   FIG. 6 is a diagram showing the line numbers of the executed source code detected by the executed source code detection unit 102.

次に、実行済命令パターン検出手段1031は、実行済命令パターンを検出する処理を行う。具体的には、まず、図6に示した実行済ソースコードの行番号の値を一つ取得し、図5に示したソースプログラムのこの行のコメント領域から、パターンIDを取得する。そして、取得したパターンIDに対応する第二命令パターンがあるか否かを、図4に示した命令パターン管理表を用いて判断する。そして、対応する第二命令パターンがある場合は、このパターンIDを、実行済命令パターンを示すパターンIDとして検出する。そして検出したパターンIDを、図示しない記憶媒体等に一時記憶する。実行済命令パターンを示すパターンIDを、ここでは、実行済命令パターンIDと呼ぶ。また、対応する第二命令パターンがない場合は、パターンIDを実行済命令パターンIDとして検出しない。そして、この処理を図6に示した実行済ソースコードの行番号の全てについて行う。   Next, the executed instruction pattern detection unit 1031 performs processing for detecting an executed instruction pattern. Specifically, first, one value of the line number of the executed source code shown in FIG. 6 is acquired, and the pattern ID is acquired from the comment area of this line of the source program shown in FIG. Then, it is determined using the command pattern management table shown in FIG. 4 whether there is a second command pattern corresponding to the acquired pattern ID. If there is a corresponding second command pattern, this pattern ID is detected as a pattern ID indicating the executed command pattern. The detected pattern ID is temporarily stored in a storage medium (not shown). Here, the pattern ID indicating the executed instruction pattern is referred to as an executed instruction pattern ID. When there is no corresponding second command pattern, the pattern ID is not detected as the executed command pattern ID. Then, this process is performed for all the line numbers of the executed source code shown in FIG.

例えば、実行済命令パターン検出手段1031は、まず、図6に示した実行済ソースコードの行番号のうちの、1番目の行番号「009600」を取得し、この行番号を有する行のコメント領域内のパターンID「010999000010」を、図5に示した変換後のソースプログラムから取得する。そして、取得したパターンID「010999000010」に対応付けられた第二命令パターンがあるか否かを、図4に示したパターン管理表において判断する。図4に示したパターン管理表においては、パターンID「010999000010」に対応する第二命令パターンはないため、このパターンIDを実行済命令パターンIDとして検出しない。   For example, the executed instruction pattern detection unit 1031 first obtains the first line number “009600” among the line numbers of the executed source code shown in FIG. 6, and the comment area of the line having this line number The pattern ID “010999000010” is acquired from the converted source program shown in FIG. Then, it is determined in the pattern management table shown in FIG. 4 whether there is a second command pattern associated with the acquired pattern ID “010999000010”. In the pattern management table shown in FIG. 4, since there is no second command pattern corresponding to the pattern ID “010999000010”, this pattern ID is not detected as the executed command pattern ID.

一方、図6に示した実行済ソースコードの行番号のうちの、6行目の行番号「010200」を取得した場合、この行番号を有する行のコメント領域内のパターンID「010999000040」を、図5に示した変換後のソースプログラムから取得する。そして取得したパターンID「010999000040」に対応付けられた第二命令パターンがあるか否かを、図4に示したパターン管理表において判断する。図4に示したパターン管理表においては、パターンID「010999000040」に対応する第二命令パターンがあるため、このパターンID「010999000040」を実行済命令パターンIDとして検出する。そして、実行済命令パターン検出手段1031は、このパターンIDを実行済命令パターンIDとして取得し、取得した実行済命令パターンIDを、図示しない記憶媒体等に蓄積する。   On the other hand, when the line number “010200” of the sixth line among the line numbers of the executed source code shown in FIG. 6 is acquired, the pattern ID “010999000040” in the comment area of the line having this line number is Obtained from the converted source program shown in FIG. Then, it is determined in the pattern management table shown in FIG. 4 whether there is a second command pattern associated with the acquired pattern ID “010999000040”. In the pattern management table shown in FIG. 4, since there is a second command pattern corresponding to the pattern ID “010999000040”, this pattern ID “010999000040” is detected as the executed command pattern ID. Then, the executed instruction pattern detection unit 1031 acquires this pattern ID as an executed instruction pattern ID, and accumulates the acquired executed instruction pattern ID in a storage medium (not shown) or the like.

図7は、図6に示した実行済ソースコードの行番号の全てについて処理を行った結果蓄積された実行済命令パターンIDを示す図である。   FIG. 7 is a diagram showing executed instruction pattern IDs accumulated as a result of performing processing on all the line numbers of the executed source code shown in FIG.

そして、第一変換関連情報取得手段1033は、実行済命令パターンIDに対して、重複をなくす処理、いわゆるユニーク処理を行う。例えば、実行済命令パターンIDをソートして並べ、隣り合う実行済命令パターンID同士を比較して、完全一致する場合に一方を削除する処理を繰り返すことで、実行済命令パターンIDの重複をなくすことができる。   Then, the first conversion related information acquisition unit 1033 performs a process of eliminating duplication, that is, a so-called unique process, on the executed instruction pattern ID. For example, the executed instruction pattern IDs are sorted and arranged, the adjacent executed instruction pattern IDs are compared with each other, and the process of deleting one is repeated when there is a complete match, thereby eliminating the duplicate of the executed instruction pattern IDs. be able to.

図8は、重複をなくした実行済命令パターンIDを示す図である。   FIG. 8 is a diagram showing executed instruction pattern IDs without duplication.

つぎに、変換命令パターン検出手段1032は、図5に示したソースプログラムに含まれるソースコードと対応する第二命令パターンである変換命令パターンを検出する処理を行う。ここでは、例として、ソースプログラムに含まれる全てのソースコードと対応する第二命令パターンを検出する。ただし、予め指定されたソースコードは、検出対象から除外するようにしてもよい。   Next, the conversion command pattern detection unit 1032 performs a process of detecting a conversion command pattern which is a second command pattern corresponding to the source code included in the source program shown in FIG. Here, as an example, second instruction patterns corresponding to all source codes included in the source program are detected. However, the source code designated in advance may be excluded from detection targets.

具体的には、変換命令パターン検出手段1032は、図5に示したソースプログラムの各行のコメント領域内のパターンIDを取得し、上述した実行済命令パターン検出手段1031と同様に、取得したパターンIDに対応付けられた第二命令パターンがあるか否かを、図4に示したパターン管理表を用いて判断する。そして、対応する第二命令パターンがある場合は、このパターンIDを、変換命令パターンを示すパターンIDとして取得し、図示しない記憶媒体等に一時記憶する。変換命令パターンを示すパターンIDをここでは、変換命令パターンIDと呼ぶ。また、対応する第二命令パターンがない場合は、このパターンIDは取得しない。そして、この処理を、ソースプログラムの各行のコメント領域に記述されたパターンIDについて行う。   Specifically, the conversion command pattern detection unit 1032 acquires the pattern ID in the comment area of each line of the source program shown in FIG. 5, and acquires the acquired pattern ID in the same manner as the executed command pattern detection unit 1031 described above. Whether or not there is a second command pattern associated with is determined using the pattern management table shown in FIG. If there is a corresponding second command pattern, this pattern ID is acquired as a pattern ID indicating the conversion command pattern and temporarily stored in a storage medium (not shown). Here, the pattern ID indicating the conversion command pattern is referred to as a conversion command pattern ID. If there is no corresponding second command pattern, this pattern ID is not acquired. Then, this process is performed for the pattern ID described in the comment area of each line of the source program.

そして、第一変換関連情報取得手段1033は、取得して記憶媒体に蓄積した変換命令パターンIDについて、上述した実行済命令パターンIDの場合と同様に、重複を削除する処理を行う。   Then, the first conversion related information acquisition unit 1033 performs a process of deleting duplication on the conversion instruction pattern ID acquired and stored in the storage medium, as in the case of the executed instruction pattern ID described above.

図9は重複を削除して得られた変換命令パターンIDを示す図である。   FIG. 9 is a diagram showing a conversion command pattern ID obtained by deleting duplicates.

次に、第一変換関連情報取得手段1033は、図8に示した重複をなくした実行済命令パターンIDの数をカウントする。ここではカウント数が「180」であったとする。   Next, the first conversion related information acquisition unit 1033 counts the number of executed instruction pattern IDs with duplicates shown in FIG. Here, it is assumed that the count number is “180”.

同様に、第一変換関連情報取得手段1033は、図9に示した重複をなくした変換命令パターンIDの数をカウントする。ここではカウント数が「250」であったとする。   Similarly, the first conversion related information acquisition unit 1033 counts the number of conversion command pattern IDs without duplication shown in FIG. Here, it is assumed that the count number is “250”.

第一変換関連情報取得手段1033は、カウントした実行済命令パターンID数を変換命令パターンID数を除算して、変換命令パターンID数に対する実行済命令パターンID数の比率を算出する。ここでは、比率は、0.72、即ち72%となる。ここでは、第一変換関連情報取得手段1033が算出したこの比率と、第一変換関連情報取得手段1033が取得した図8に示すような重複をなくした実行済命令パターンIDをリストと、このリストを構成する実行済命令パターンIDのカウント数が、第一変換関連情報取得手段1033が取得した変換関連情報であるとする。   The first conversion related information acquisition unit 1033 calculates the ratio of the executed instruction pattern ID number to the converted instruction pattern ID number by dividing the counted executed instruction pattern ID number by the converted instruction pattern ID number. Here, the ratio is 0.72, ie 72%. Here, the ratio calculated by the first conversion related information acquisition unit 1033 and the executed instruction pattern ID without duplication as shown in FIG. 8 acquired by the first conversion related information acquisition unit 1033 are listed, and this list Is the conversion-related information acquired by the first conversion-related information acquisition unit 1033.

出力部104は、第一変換関連情報取得手段1033が取得した変換関連情報を、図示しないモニタ等に表示する。   The output unit 104 displays the conversion related information acquired by the first conversion related information acquisition unit 1033 on a monitor (not shown).

図10は、変換関連情報の出力例を示す。   FIG. 10 shows an output example of the conversion related information.

出力された変換関連情報のうち、算出された比率は、ソースプログラムにおける第二命令パターンを用いて変換された部分に用いられている異なる第二命令パターン数、言い換えれば第二命令パターンの種類の数に対する、このソースプログラムに対して予め指定された1以上のテストを行った場合に使用されるソースコードのうちの第二命令パターンを用いて変換された部分に用いられている異なる第二命令パターン数、言い換えれば第二命令パターンの種類の数の比率を示す。つまり、この比率は、ソースプログラムの変換に用いられた第二命令パターンのうちの、どれぐらいの比率の第二命令パターンが、テストによって少なくとも一回は検証されたかを示す指標として用いることができる。つまり、変換に用いられた第二命令パターンのうちのどの程度の第二命令パターンが変換に用いられたかを知ることができる。これにより、例えばテストの妥当性等を判断することができる。   Of the output conversion-related information, the calculated ratio is the number of different second instruction patterns used in the part converted using the second instruction pattern in the source program, in other words, the type of the second instruction pattern. A different second instruction used for the part converted using the second instruction pattern of the source code used when one or more predetermined tests are performed on this source program for the number It shows the ratio of the number of patterns, in other words, the number of types of second command patterns. In other words, this ratio can be used as an index indicating how much of the second instruction patterns used for source program conversion has been verified at least once by the test. . That is, it is possible to know how much of the second command pattern used for the conversion is used for the conversion. Thereby, for example, the validity of the test can be determined.

また、出力された変換関連情報のうちの、実行済命令パターンIDのリストは、テストで使用されたソースコードのうちの、実際にテストで使用されたソースコードに対応する第二命令パターンのIDである。このリストから、命令パターンによる変換がテスト済である第二命令パターンを知ることができる。   The list of executed instruction pattern IDs in the output conversion related information is the ID of the second instruction pattern corresponding to the source code actually used in the test among the source codes used in the test. It is. From this list, it is possible to know the second instruction pattern that has been tested for conversion by the instruction pattern.

なお、上記具体例においては、第二命令パターンを用いた変換が行われなかった行についても、パターンIDがコメント領域に記述されたソースプログラムを用いたため、実行済ソースコードの行番号が示す行のコメント領域からパターンIDを取得し、このパターンIDに対応する第二命令パターンがあるか否かにより、第二命令パターンに対応するソースコードの変換に用いられたパターンIDであるか否かを判断するようにした。しかし、ソースプログラムのコメント領域のうちの、第二命令パターンに対応するソースコードに変換された行のコメント領域にだけ、パターンIDが記述されている場合、実行済ソースコードの行番号が示す行のコメント領域のパターンIDを実行済命令パターンのパターンIDとして取得するようにしても良い。この場合、命令パターン管理表等は省略可能である。かかることは、他の具体例においても同様である。   In the above specific example, since the source program in which the pattern ID is described in the comment area is used for the line that has not been converted using the second instruction pattern, the line indicated by the line number of the executed source code Whether or not the pattern ID used for conversion of the source code corresponding to the second command pattern is obtained by obtaining the pattern ID from the comment area of I decided to judge. However, when the pattern ID is described only in the comment area of the line converted to the source code corresponding to the second instruction pattern in the comment area of the source program, the line indicated by the line number of the executed source code May be acquired as the pattern ID of the executed instruction pattern. In this case, the command pattern management table or the like can be omitted. The same applies to other specific examples.

また、上記具体例において、上述したように、実行済命令パターン検出手段1031が、実行済ソースコードを構成する各行について、図4に示すような第二命令パターン格納部105に格納されている各第二命令パターンとのパターンマッチングを行い、マッチングする第二命令パターンが検出された場合に、この第二命令パターンを実行済命令パターンとして検出するようにしても良い。   In the above specific example, as described above, the executed instruction pattern detection unit 1031 stores each line of the executed source code stored in the second instruction pattern storage unit 105 as shown in FIG. Pattern matching with the second command pattern is performed, and when the matching second command pattern is detected, the second command pattern may be detected as the executed command pattern.

また、同様に、変換命令パターン検出手段1032が、ソースプログラムの各行について、図4に示すような第二命令パターン格納部105に格納されている各第二命令パターンとのパターンマッチングを行い、マッチングする第二命令パターンが検出された場合に、この第二命令パターンを変換命令パターンとして検出するようにしても良い。   Similarly, the conversion command pattern detection means 1032 performs pattern matching with each second command pattern stored in the second command pattern storage unit 105 as shown in FIG. When the second command pattern to be detected is detected, this second command pattern may be detected as a conversion command pattern.

以上、本実施の形態によれば、ソースプログラムから実行済ソースコードを検出し、この検出された実行済ソースコードのうちの、第二命令パターンに対応するソースコードに変換された部分に関する情報である変換関連情報を取得し、出力するようにしたので、命令パターンを用いて行われた変換の検証が十分にできたか否かを示すことができる。例えば、変換に用いられた第二命令パターンのうちの、どの程度の第二命令パターンで変換された箇所が、テスト等を行う際のソースプログラムに対応したプログラムの実行時にどの程度使用されたかを知ることができる。これにより、例えば、ソースプログラムに対して行われたテスト等によって、変換に使用された第二命令パターンのうちの、どの程度の第二命令パターンで変換された箇所が検証されたかということや、どの第二命令パターンで変換された箇所が検証されたか等を知ることができ、テストの妥当性を検証したり、テストを終了させるか否か等の判断を行うことができる。   As described above, according to the present embodiment, the executed source code is detected from the source program, and the information on the portion of the detected executed source code that has been converted into the source code corresponding to the second instruction pattern. Since certain conversion related information is acquired and output, it is possible to indicate whether or not the conversion performed using the command pattern has been sufficiently verified. For example, how much of the second instruction pattern used for the conversion is used when executing the program corresponding to the source program when performing a test or the like. I can know. Thereby, for example, the degree of the second instruction pattern converted by the second instruction pattern used for the conversion by the test or the like performed on the source program is verified, It is possible to know which second command pattern has been used to verify the converted part, and to verify the validity of the test and determine whether or not to end the test.

(実施の形態2)
本実施の形態にかかるプログラム検証装置2は、上記実施の形態で説明したプログラム検証装置2において、ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードであって、実行済ソースコードに含まれるとともに、第二命令パターンと対応するソースコードを含むソースコードであるステップ対応実行済コードを検出し、この検出したステップ対応実行済コードに関する変換関連情報を取得し出力するようにしたものである。
(Embodiment 2)
The program verification apparatus 2 according to the present embodiment is a source code in a source program corresponding to each step that can be executed when a program based on the source program is executed in the program verification apparatus 2 described in the above embodiment. The step-corresponding executed code that is the source code including the source code corresponding to the second instruction pattern is detected in the executed source code, and the conversion-related information regarding the detected step-corresponding executed code is detected. It is obtained and output.

図11は、本実施の形態におけるプログラム検証装置2のブロック図である。
プログラム検証装置2は、ソースプログラム格納部101、実行済ソースコード検出部102、変換関連情報取得部203、出力部104、および第二命令パターン格納部105を備える。
FIG. 11 is a block diagram of the program verification apparatus 2 in the present embodiment.
The program verification apparatus 2 includes a source program storage unit 101, an executed source code detection unit 102, a conversion related information acquisition unit 203, an output unit 104, and a second instruction pattern storage unit 105.

変換関連情報取得部203は、ステップ対応実行済コード検出手段2031、ステップ対応変換コード検出手段2032、及び第二変換関連情報取得手段2033を備える。   The conversion related information acquisition unit 203 includes a step-corresponding executed code detection unit 2031, a step-corresponding conversion code detection unit 2032, and a second conversion-related information acquisition unit 2033.

ソースプログラム格納部101、実行済ソースコード検出部102、出力部104、および第二命令パターン格納部105の構成及び動作については、上記実施の形態1と同様であるのでここでは説明を省略する。   The configurations and operations of the source program storage unit 101, the executed source code detection unit 102, the output unit 104, and the second instruction pattern storage unit 105 are the same as those in the first embodiment, and thus description thereof is omitted here.

変換関連情報取得部203は、実行済ソースコード検出部102で検出された実行済ソースコードのうちの、第二命令パターンに対応するソースコードに変換された部分に関する情報である変換関連情報を取得する。変換関連情報取得部103は、例えば、実行済ソースコード検出部102で検出された実行済ソースコードのうちの、第二命令パターンに対応するソースコードに変換された部分を検出し、この検出した情報を用いて変換関連情報を取得する。   The conversion related information acquisition unit 203 acquires conversion related information that is information about a portion of the executed source code detected by the executed source code detection unit 102 that has been converted into a source code corresponding to the second instruction pattern. To do. The conversion related information acquisition unit 103 detects, for example, a portion of the executed source code detected by the executed source code detection unit 102 that has been converted into a source code corresponding to the second instruction pattern. The conversion related information is acquired using the information.

変換関連情報取得部203は、例えば、実行済ソースコード検出部102で検出された実行済ソースコードのうちの、第二命令パターンに対応するソースコードに変換された部分を検出し、この検出した情報を用いて変換関連情報を取得する。変換関連情報は、第二命令パターンに対応するソースコードに変換された部分に関する情報であれば、変換されたソースコードについての情報や、このソースコードを含む情報であっても良いし、変換に用いられた第二命令パターンに関する情報であっても良い。例えば、変換関連情報は、変換に用いられた第二命令パターンの出現量に関する情報である。   The conversion related information acquisition unit 203 detects, for example, a portion of the executed source code detected by the executed source code detection unit 102 that has been converted into a source code corresponding to the second instruction pattern. The conversion related information is acquired using the information. The conversion related information may be information about the converted source code or information including the source code as long as it is information related to the portion converted into the source code corresponding to the second instruction pattern. Information on the second command pattern used may be used. For example, the conversion related information is information regarding the appearance amount of the second command pattern used for the conversion.

変換関連情報取得部203は、例えば、ソースプログラム格納部101に格納されているソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードであって、実行済ソースコード検出部102で検出された実行済ソースコードに含まれるとともに、第二命令パターンと対応するソースコードを含むソースコードであるステップ対応実行済コードを検出し、このステップ対応実行済コードに関する情報を含む変換関連情報を取得する。この場合の変換関連情報は、ステップ対応実行済コードに関する情報であれば、ステップ対応実行済コードを示す情報であっても良いし、ステップ対応実行済コードの出現量、言い換えればステップ対応実行済コードが対応するステップの出現量に関する情報であってもよい。ここでのプログラムを実行させた場合とは、例えば、プログラムに予め指定されたテスト等を実行させた場合である。   The conversion related information acquisition unit 203 is, for example, source code in a source program corresponding to each step that can be executed when a program based on the source program stored in the source program storage unit 101 is executed. A step-corresponding executed code that is a source code that is included in the executed source code detected by the completed source code detection unit 102 and includes a source code corresponding to the second instruction pattern is detected. Get conversion related information including information. In this case, the conversion-related information may be information indicating the step-corresponding executed code as long as it is information regarding the step-corresponding executed code, or the appearance amount of the step-corresponding executed code, in other words, the step-corresponding executed code. May be information regarding the appearance amount of the corresponding step. The case where the program is executed here is, for example, a case where a test or the like designated in advance in the program is executed.

なお、ここで述べるステップとは、例えば、ソースプログラムに基づくプログラムの処理が行われる単位や、処理段階を示す単位である。例えばソースプログラムがインタプリタ型のソースプログラムである場合、ステップとは、例えば行等のソースプログラムの逐次解釈実行される各ソースコード群や、ソースコードの読み出される単位である。例えば、改行コードや行番号等の予め指定された区切りのための予め指定された指定情報等で区切られる単位の情報がステップと考えても良い。具体的には、指定情報のうちの一つが出現してから次に指定情報の一つが出現する間の範囲内の情報をステップに対応するソースコードと考えても良い。区切のための指定情報は、例えば、ユーザにより指定された文字列等の情報である。ここでは文字列に、ピリオドやセミコロン等の記号を含むと考えてもよい。指定情報は、予め指定された、改行コードやTAB等の制御コード等であっても良い。改行コードやTAB等の制御コードを文字列と考えても良い。また、指定情報は、例えば、第一ソースプログラムに用いられる命令語、すなわち、第一ソースプログラムの言語等に用いられる命令語の全部、あるいは一部等であっても良い。また、指定情報は、これらの情報の組み合わせであっても良い。なお、区切のための指定情報は、ステップに対応するソースコードを区切る以外に、パターンマッチング等を行う際のソースプログラムからソースコードを取り出す際の区切位置を示す情報として利用可能である。   Note that the steps described here are, for example, a unit in which processing of a program based on a source program is performed and a unit indicating a processing stage. For example, when the source program is an interpreter type source program, a step is, for example, each source code group that is sequentially interpreted and executed by the source program such as a line, or a unit from which the source code is read. For example, information of units delimited by predesignated designation information for a predesignated delimiter such as a line feed code or a line number may be considered as a step. Specifically, information within a range between the appearance of one of the designation information and the next appearance of the designation information may be considered as source code corresponding to the step. The designation information for separation is, for example, information such as a character string designated by the user. Here, it may be considered that the character string includes a symbol such as a period or a semicolon. The designation information may be a control code such as a line feed code or TAB designated in advance. A control code such as a line feed code or TAB may be considered as a character string. The designation information may be, for example, instruction words used for the first source program, that is, all or part of instruction words used for the language of the first source program. Further, the designation information may be a combination of these pieces of information. The designation information for delimitation can be used as information indicating the delimiter position when the source code is extracted from the source program when performing pattern matching or the like in addition to delimiting the source code corresponding to the step.

また、ソースプログラムがインタプリタ型のソースプログラムとは異なるソースプログラム、例えばコンパイルが必要なソースプログラムである場合、ステップはコンパイルされたプログラムの各命令セットや命令群である。コンパイルにより得られたオブジェクトコードの読み出される単位であっても良い。   When the source program is a source program different from the interpreted source program, for example, a source program that needs to be compiled, the steps are each instruction set and instruction group of the compiled program. It may be a unit from which the object code obtained by compiling is read.

変換関連情報取得部203は、さらに、ソースプログラム格納部101に格納されているソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードであって、第二命令パターンと対応するソースコードを含むソースコードであるステップ対応変換コードを検出し、ステップ対応実行済コードの数に対する、ステップ対応変換コードの数の比率を示す情報を含む変換関連情報を、ステップ対応実行済コードの出現量に関する変換関連情報として取得してもよい。   The conversion related information acquisition unit 203 is further source code in a source program corresponding to each step that can be executed when a program based on the source program stored in the source program storage unit 101 is executed. A step-related conversion code that is a source code including a source code corresponding to a two-instruction pattern is detected, and conversion-related information including information indicating a ratio of the number of step-corresponding conversion codes to the number of step-corresponding executed codes, You may acquire as conversion relevant information regarding the appearance amount of corresponding | compatible executed code.

この実施の形態においては、変換関連情報取得部203が、後述するステップ対応実行済コード検出手段2031、ステップ対応変換コード検出手段2032、及び第二変換関連情報取得手段2033を用いて変換関連情報を取得する場合を例に挙げて説明する。   In this embodiment, the conversion related information acquisition unit 203 uses the step-corresponding executed code detection means 2031, the step-corresponding conversion code detection means 2032, and the second conversion-related information acquisition means 2033 described later to convert the conversion-related information. The case of acquiring will be described as an example.

変換関連情報取得部203は、通常、MPUやメモリ等の記憶媒体等から実現され得る。変換関連情報取得部103の処理手順は、通常、ソフトウェアで実現され、当該ソフトウェアはROM等の記録媒体に記録されている。但し、ハードウェア(専用回路)で実現しても良い。   The conversion related information acquisition unit 203 can be usually realized by a storage medium such as an MPU or a memory. The processing procedure of the conversion related information acquisition unit 103 is usually realized by software, and the software is recorded on a recording medium such as a ROM. However, it may be realized by hardware (dedicated circuit).

ステップ対応実行済コード検出手段2031は、ソースプログラム格納部101に格納されているソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードであって、実行済ソースコードに含まれるとともに、第二命令パターンと対応するソースコードを含むソースコードであるステップ対応実行済コードを検出する。例えば、ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードの中から、実行済ソースコード検出部102が検出した実行済ソースコードに含まれるソースコードを検出し、さらに、検出したソースコードの中から、第二命令パターンと対応するソースコードを含むソースコードを検出する。あるいは、ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードの中から、第二命令パターンと対応するソースコードを含むソースコードを検出し、さらに、検出したソースコードの中から、実行済ソースコード検出部102が検出した実行済ソースコードに含まれるソースコードを検出してもよい。ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードの中から、実行済ソースコード検出部102が検出した実行済ソースコードに含まれるソースコードを検出する処理は、例えばデバッガ等の処理として公知である。また、このようなステップ単位のソースコードとコンパイルされて得られたオブジェクトコード等との対応関係を示す情報を、コンパイラが、オブジェクトコード等に付加したり、管理情報を作成したりしてもよい。このような情報を用いることで、ステップ単位のソースコードが検出可能である。なお、上述した実行済ソースコード検出部102が、ここで述べるステップと同様に、ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップ単位で実行済ソースコードを検出するようにしても良く、この場合、ステップ対応実行済コード検出手段2031は、実行済ソースコード検出部102が検出したステップ単位の実行済ソースコードの中から、第二命令パターンと対応するソースコードを含むソースコードを検出するようにしても良い。また、ソースプログラムが、ここで述べるステップと同様の、ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップ単位で、第二命令パターンに対応するソースコードに変換されたものである場合、ステップ対応実行済コード検出手段2031は、実行済ソースコード検出部102が検出したステップ単位の実行済ソースコードの中から、第二命令パターンと対応するソースコードを検出するようにしても良い。   The step-corresponding executed code detection means 2031 is a source code in a source program corresponding to each step that can be executed when a program based on the source program stored in the source program storage unit 101 is executed, The step-corresponding executed code that is a source code that is included in the completed source code and includes the source code corresponding to the second instruction pattern is detected. For example, the source code included in the executed source code detected by the executed source code detection unit 102 from the source code in the source program corresponding to each step that can be executed when a program based on the source program is executed Furthermore, the source code including the source code corresponding to the second instruction pattern is detected from the detected source code. Alternatively, the source code including the source code corresponding to the second instruction pattern is detected from the source code in the source program corresponding to each step that can be executed when the program based on the source program is executed, The source code included in the executed source code detected by the executed source code detection unit 102 may be detected from the detected source code. The source code included in the executed source code detected by the executed source code detection unit 102 is detected from the source code in the source program corresponding to each step that can be executed when the program based on the source program is executed. The processing to be performed is known as processing such as a debugger. In addition, the compiler may add information indicating the correspondence between the source code in units of steps and the object code obtained by compiling to the object code or create management information. . By using such information, the source code for each step can be detected. Note that the executed source code detection unit 102 described above may detect executed source code in units of steps that can be executed when a program based on the source program is executed, as in the steps described here. Well, in this case, the step-corresponding executed code detecting means 2031 selects the source code including the source code corresponding to the second instruction pattern from the executed source code in units of steps detected by the executed source code detecting unit 102. You may make it detect. In addition, when the source program is converted into the source code corresponding to the second instruction pattern in each step that can be executed when the program based on the source program is executed, similar to the steps described here. The step-corresponding executed code detecting means 2031 may detect the source code corresponding to the second instruction pattern from the executed source code in units of steps detected by the executed source code detecting unit 102.

具体的には、ソースプログラムが、行単位で実行されるインタプリタ型のソースプログラムであったとし、実行済ソースコード検出部102が行単位で実行済ソースコードを検出したとすると、ステップ対応実行済コード検出手段2031は、実行済ソースコード検出部102が検出した行単位の実行済ソースコードの中から、第二命令パターンと対応するソースコードを含むソースコード行を検出してもよい。   Specifically, assuming that the source program is an interpreter type source program that is executed in units of lines, and the executed source code detection unit 102 detects the executed source code in units of lines, step-by-step execution has been executed. The code detection unit 2031 may detect a source code line including a source code corresponding to the second instruction pattern from the executed source code in units of lines detected by the executed source code detection unit 102.

なお、ステップ対応実行済コード検出手段2031が、第二命令パターンと対応するソースコードを検出する処理は、上記実施の形態1の実行済命令パターン検出手段1031と同様であるので、ここでは説明を省略する。   The process of detecting the source code corresponding to the second instruction pattern by the step-corresponding executed code detection means 2031 is the same as the executed instruction pattern detection means 1031 of the first embodiment, and will be described here. Omitted.

ステップ対応実行済コード検出手段2031は、通常、MPUやメモリ等から実現され得る。ステップ対応実行済コード検出手段2031の処理手順は、通常、ソフトウェアで実現され、当該ソフトウェアはROM等の記録媒体に記録されている。但し、ハードウェア(専用回路)で実現しても良い。   The step-corresponding executed code detecting means 2031 can be usually realized by an MPU, a memory or the like. The processing procedure of the step-corresponding executed code detecting means 2031 is usually realized by software, and the software is recorded on a recording medium such as a ROM. However, it may be realized by hardware (dedicated circuit).

ステップ対応変換コード検出手段2032は、ソースプログラム格納部101に格納されているソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードであって、第二命令パターンと対応するソースコードを含むソースコードであるステップ対応変換コードを検出する。例えば、ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードの中から、第二命令パターンと対応するソースコードを含むソースコードを検出する。各ステップに対応するソースコードを検出する処理や、第二命令パターンと対応するソースコードを含むソースコードを検出する処理は、ステップ対応実行済コード検出手段2031と同様である。なお、ソースプログラムが、ここで述べるステップと同様の、ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップ単位で、第二命令パターンに対応するソースコードとなるよう変換されたものである場合、ステップ対応実行済コード検出手段2031は、ソースプログラムの中から、第二命令パターンと対応するソースコードを検出するようにしても良い。   The step corresponding conversion code detecting means 2032 is a source code in a source program corresponding to each step that can be executed when a program based on the source program stored in the source program storage unit 101 is executed, A step corresponding conversion code which is a source code including a source code corresponding to an instruction pattern is detected. For example, the source code including the source code corresponding to the second instruction pattern is detected from the source code in the source program corresponding to each step that can be executed when the program based on the source program is executed. The process of detecting the source code corresponding to each step and the process of detecting the source code including the source code corresponding to the second instruction pattern are the same as the step-corresponding executed code detecting means 2031. The source program is converted so as to be the source code corresponding to the second instruction pattern in units of steps that can be executed when a program based on the source program is executed, similar to the steps described here. In some cases, the step-corresponding executed code detection means 2031 may detect the source code corresponding to the second instruction pattern from the source program.

具体的には、ソースプログラムが、行単位で実行されるインタプリタ型のソースプログラムであったとし、ソースプログラムが、行単位で、第二命令パターンに対応するソースコードに変換されたものである場合、ステップ対応変換コード検出手段2032は、ソースプログラムの中から、第二命令パターンと対応するソースコードを含むソースコード行を検出してもよい。   Specifically, when the source program is an interpreter type source program executed in units of lines, and the source program is converted into source code corresponding to the second instruction pattern in units of lines. The step corresponding conversion code detecting means 2032 may detect a source code line including a source code corresponding to the second instruction pattern from the source program.

ステップ対応変換コード検出手段2032は、通常、MPUやメモリ等から実現され得る。ステップ対応変換コード検出手段2032の処理手順は、通常、ソフトウェアで実現され、当該ソフトウェアはROM等の記録媒体に記録されている。但し、ハードウェア(専用回路)で実現しても良い。   The step-corresponding conversion code detection means 2032 can usually be realized by an MPU, a memory, or the like. The processing procedure of the step-corresponding conversion code detecting means 2032 is usually realized by software, and the software is recorded on a recording medium such as a ROM. However, it may be realized by hardware (dedicated circuit).

第二変換関連情報取得手段2033は、ステップ対応実行済コード検出手段1031が検出したステップ対応実行済コードに関する情報を含む変換関連情報を取得する。具体的には、ステップ対応実行済コードの全てあるいは一部をリスト化した変換関連情報を取得する。あるいは、ステップ対応実行済コードに、当該ソースコードに対する第二命令パターンを示す情報を対応付けた情報を出力しても良い。   The second conversion related information acquisition unit 2033 acquires conversion related information including information on the step corresponding executed code detected by the step corresponding executed code detection unit 1031. Specifically, conversion-related information that lists all or part of the step-corresponding executed code is acquired. Or you may output the information which matched the information which shows the 2nd command pattern with respect to the said source code to the step corresponding | compatible executed code.

また、第二変換関連情報取得手段2033は、ステップ対応実行済コード検出手段1031が検出したステップ対応実行済コードの出現量に関する変換関連情報を取得する。具体的には、第二変換関連情報取得手段2033は、ステップ対応実行済コード検出手段1031が検出したステップ対応実行済コードの数をカウントし、その値を出現量に関する変換関連情報として取得する。あるいは、第二変換関連情報取得手段2033は、ステップ対応変換コード検出手段1031が検出したステップ対応変換コードの数に対する、ステップ対応実行済コード検出手段1032が検出したステップ対応実行済コードの数の比率を示す情報を出現量に関する変換関連情報として含む変換関連情報を取得しても良い。ステップ対応実行済コードの数や、ステップ対応変換コードの数は、一の第二命令パターンに対応するソースコードを一つと考えた場合の数であっても良いし、ステップ対応実行済コードや、ステップ対応変換コードを構成する文字数やスペース等で区切られた単語数等の数であっても良い。   Further, the second conversion related information acquisition unit 2033 acquires conversion related information regarding the appearance amount of the step corresponding executed code detected by the step corresponding executed code detection unit 1031. Specifically, the second conversion related information acquisition unit 2033 counts the number of step-corresponding executed codes detected by the step-corresponding executed code detection unit 1031 and acquires the value as conversion-related information regarding the appearance amount. Alternatively, the second conversion related information acquisition unit 2033 may be configured such that the ratio of the number of step-corresponding executed codes detected by the step-corresponding executed code detecting unit 1032 to the number of step-corresponding conversion codes detected by the step-corresponding conversion code detecting unit 1031. Conversion-related information that includes information indicating that as conversion-related information regarding the appearance amount may be acquired. The number of step-corresponding executed codes and the number of step-corresponding conversion codes may be the number when one source code corresponding to one second instruction pattern is considered, or the step-corresponding executed code, It may be a number such as the number of characters constituting the step-corresponding conversion code or the number of words separated by spaces.

第二変換関連情報取得手段2033は、通常、MPUやメモリ等から実現され得る。第二変換関連情報取得手段2033の処理手順は、通常、ソフトウェアで実現され、当該ソフトウェアはROM等の記録媒体に記録されている。但し、ハードウェア(専用回路)で実現しても良い。
次に、プログラム検証装置2の動作について図12のフローチャートを用いて説明する。ここでは、例として、ソースプログラム格納部101に格納されているソースプログラムの、第二命令パターンにより変換された部分(ソースコード群)には、変換に用いられた第二命令パターンを示す情報が対応付けられている場合について説明する。
The second conversion related information acquisition unit 2033 can be usually realized by an MPU, a memory, or the like. The processing procedure of the second conversion related information acquisition unit 2033 is usually realized by software, and the software is recorded on a recording medium such as a ROM. However, it may be realized by hardware (dedicated circuit).
Next, the operation of the program verification apparatus 2 will be described using the flowchart of FIG. Here, as an example, in the source program stored in the source program storage unit 101, the part (source code group) converted by the second instruction pattern contains information indicating the second instruction pattern used for the conversion. The case where it is matched will be described.

(ステップS1201)実行済ソースコード検出部102は、ソースプログラム格納部101からソースプログラムを読み出す。   (Step S1201) The executed source code detection unit 102 reads the source program from the source program storage unit 101.

(ステップS1202)実行済ソースコード検出部102は、ステップS201で読み出したソースプログラムから実行済ソースコードを検出する。例えば、ステップS201で読み出したソースプログラムに基づくプログラムを実行させて、予め指定された1以上のテスト用のデータ等を用いて1以上のテストを行い、そのテストで使用されたソースコードである実行済ソースコード、即ちソースプログラムに基づくプログラムのうちの、テストで使用された部分に対応するソースコードを検出する。テスト用のデータやテストを指示する情報等は、例えば図示しない記憶媒体等により構成されるテスト関連情報格納部(図示せず)等に予め格納しておくようにすればよい。検出した実行済ソースコードについては、実行済ソースコードが含まれる部分であることを示す情報、例えばフラグ等を、ソースプログラム等に付与する。例えば、ソースプログラムに対応するプログラムを実行した場合に実行されうる各ステップを検出し、検出した1以上のステップに対応するソースコードに対して、各ステップ単位で実行済ソースコードが含まれる部分であることを示す情報、例えばフラグ等を付与する。この情報は、ソースプログラムに記述されてもよいし、図示しない格納部等に格納される管理情報等を用いて管理されても良い。例えば、ソースプログラムが行単位でソースコードが記述されたものである場合、実行されうる各ステップは、行単位で対応付けられるため、実行済ソースコードの行に、フラグ等の情報を付与してもよい。あるいは、実行済ソースコードをソースプログラムから読み出して、図示しない記憶媒体等の格納部に蓄積しても良い。また、例えば、ソースプログラムが行単位でソースコードが記述されたものである場合、実行済ソースコードが含まれる行番号を取得して、図示しない記憶媒体等の格納部に蓄積しても良い。   (Step S1202) The executed source code detector 102 detects the executed source code from the source program read in step S201. For example, by executing a program based on the source program read in step S201, performing one or more tests using one or more test data specified in advance, and executing the source code used in the test The source code corresponding to the portion used in the test of the completed source code, that is, the program based on the source program is detected. The test data, information for instructing the test, and the like may be stored in advance in a test related information storage unit (not shown) configured by a storage medium (not shown), for example. For the detected executed source code, information indicating that the executed source code is included, for example, a flag or the like is given to the source program or the like. For example, each step that can be executed when a program corresponding to a source program is executed is detected, and for each source code corresponding to one or more detected steps, an executed source code is included for each step. Information indicating the presence, for example, a flag or the like is given. This information may be described in the source program, or may be managed using management information stored in a storage unit (not shown) or the like. For example, if the source program is one in which the source code is described in units of lines, each step that can be executed is associated in units of lines, so information such as a flag is added to the line of the executed source code. Also good. Alternatively, the executed source code may be read from the source program and accumulated in a storage unit such as a storage medium (not shown). Further, for example, when the source program is one in which the source code is described in line units, the line number including the executed source code may be acquired and accumulated in a storage unit such as a storage medium (not shown).

(ステップS1203)ステップ対応実行済コード検出手段2031は、ソースプログラムに基づくプログラムを実行させた場合に実行されうるステップに対応するソースプログラム内のソースコードの中から、第二命令パターンのいずれかに対応するソースコードを含むソースコードであって、ステップS1202で検出した実行済ソースコードに含まれるソースコードであるステップ対応実行済コードを検出する。例えば、ソースプログラムに含まれる各ステップに対応するソースコードのそれぞれについて、ステップS1202で検出した実行済ソースコードに含まれるか否かを判断し、含まれる場合、さらにこのソースコードが第二命令パターンのいずれかに対応付けられたソースコードであるか否かを判断する。そして、実行済ソースコードに含まれ、かつ第二命令パターンのいずれかに対応付けられた、ステップに対応するソースコードを検出する。ソースプログラム内のソースコードとステップとの対応関係は、例えばカバレッジツールやデバッガ等により取得可能である。なお、特に、ステップS1202において、実行済ソースコードを、プログラムの実行されうるステップ単位で検出した場合、ステップ対応実行済コード検出手段2031は、単にこの実行済ソースコードの中から、第二命令パターンと対応付けられたものを検出するだけでよい。さらに、ソースプログラムにおいて、当該ソースプログラムに基づくプログラムが実行されうるステップ単位で、ソースコードと、第二命令パターンとが対応付けられている場合、ステップ対応実行済コード検出手段2031は、ソースプログラムの中から、実行済ソースコードの中から、第二命令パターンと対応付けられたソースコードを検出するだけでよい。ステップ対応実行済コード検出手段2031は、検出したステップ対応実行済コードや、検出したステップ対応実行済コードを示す情報を、図示しない記憶媒体等の格納部に蓄積しても良いし、ソースプログラムの検出したソースコードに対応する部分に、検出されたことを示すフラグ等の情報を付与しても良い。また、例えば、ソースプログラムが行単位でソースコードが記述されたものである場合、検出したステップ対応実行済コードが含まれる行番号を取得して、図示しない記憶媒体等の格納部に蓄積しても良い。   (Step S1203) The step-corresponding executed code detecting means 2031 selects one of the second instruction patterns from the source code in the source program corresponding to the step that can be executed when the program based on the source program is executed. A step-corresponding executed code which is a source code including a corresponding source code and is a source code included in the executed source code detected in step S1202 is detected. For example, it is determined whether each of the source code corresponding to each step included in the source program is included in the executed source code detected in step S1202, and if included, this source code is further included in the second instruction pattern. It is determined whether the source code is associated with any of the above. Then, the source code corresponding to the step included in the executed source code and associated with one of the second instruction patterns is detected. The correspondence between the source code in the source program and the steps can be acquired by, for example, a coverage tool or a debugger. In particular, when the executed source code is detected in units of steps at which the program can be executed in step S1202, the step-corresponding executed code detection means 2031 simply selects the second instruction pattern from the executed source code. It is only necessary to detect those associated with. Furthermore, in the source program, when the source code and the second instruction pattern are associated with each other in units of steps in which the program based on the source program can be executed, the step-corresponding executed code detecting unit 2031 It is only necessary to detect the source code associated with the second instruction pattern from the executed source code. The step-corresponding executed code detecting means 2031 may accumulate the detected step-corresponding executed code and information indicating the detected step-corresponding executed code in a storage unit such as a storage medium (not shown) Information such as a flag indicating the detection may be added to a portion corresponding to the detected source code. Also, for example, when the source program is one in which the source code is described in units of lines, the line number including the detected step-corresponding executed code is acquired and stored in a storage unit such as a storage medium (not shown). Also good.

(ステップS1204)ステップ対応変換コード検出手段2032は、ソースプログラムに基づくプログラムを実行させた場合に実行されうるステップに対応するソースプログラム内のソースコードの中から、第二命令パターンのいずれかに対応するソースコードを含むステップ対応変換コードを検出する。例えば、ソースプログラムに含まれる各ステップに対応するソースコードのそれぞれについて、このソースコードが第二命令パターンのいずれかに対応付けられたソースコードであるか否かを判断する。そして、第二命令パターンのいずれかに対応付けられた、ステップに対応するソースコードをステップ対応変換コードとして検出する。特に、ソースプログラムにおいて、当該ソースプログラムに基づくプログラムが実行されうるステップ単位で、ソースコードと、第二命令パターンとが対応付けられている場合、ステップ対応実行済コード検出手段2031は、単にこのソースプログラムの中から、第二命令パターンと対応付けられたソースコードを検出するだけでよい。ステップ対応変換コード検出手段2032は、検出したステップ対応変換コードや、検出したステップ対応変換コードを示す情報を、図示しない記憶媒体等の格納部に蓄積しても良いし、ソースプログラムの検出したステップ対応変換コードに対応する部分に、検出されたことを示すフラグ等の情報を付与しても良い。また、例えば、ソースプログラムが行単位でソースコードが記述されたものである場合、検出したステップ対応変換コードが含まれる行番号を取得して、図示しない記憶媒体等の格納部に蓄積しても良い。   (Step S1204) The step corresponding conversion code detection means 2032 corresponds to one of the second instruction patterns from the source code in the source program corresponding to the step that can be executed when the program based on the source program is executed. The step corresponding conversion code including the source code to be detected is detected. For example, for each source code corresponding to each step included in the source program, it is determined whether this source code is a source code associated with one of the second instruction patterns. Then, the source code corresponding to the step associated with one of the second command patterns is detected as a step corresponding conversion code. In particular, in the source program, when the source code and the second instruction pattern are associated with each other in units of steps in which the program based on the source program can be executed, the step-corresponding executed code detection unit 2031 simply uses this source code. It is only necessary to detect the source code associated with the second instruction pattern from the program. The step-corresponding conversion code detection unit 2032 may accumulate the detected step-corresponding conversion code and information indicating the detected step-corresponding conversion code in a storage unit such as a storage medium (not shown), or the step detected by the source program Information such as a flag indicating that it has been detected may be assigned to the portion corresponding to the corresponding conversion code. Further, for example, when the source program is one in which the source code is described in units of lines, the line number including the detected step-corresponding conversion code is acquired and stored in a storage unit such as a storage medium (not shown). good.

(ステップS1205)第二変換関連情報取得手段2033は、ステップS1203で検出したステップ対応実行済コードの数をカウントし、さらに、ステップS1204で検出したステップ対応変換コードの数をカウントし、カウントしたステップ対応変換コード数でステップ対応実行済コード数を除算して、ステップ対応変換コード数に対するステップ対応実行済コード数の比率である変換関連情報を取得する。   (Step S1205) The second conversion related information acquisition unit 2033 counts the number of step-corresponding executed codes detected in step S1203, and further counts the number of step-corresponding conversion codes detected in step S1204. By dividing the number of step-corresponding executed codes by the number of corresponding conversion codes, conversion-related information that is the ratio of the number of step-corresponding executed codes to the number of step-corresponding conversion codes is acquired.

(ステップS1206)出力部104は、ステップS209で取得した変換関連情報を出力する。なお、ステップS205において取得した実施済命令パターンのリスト等の情報も出力しても良い。そして、処理を終了する。   (Step S1206) The output unit 104 outputs the conversion related information acquired in step S209. Information such as a list of executed command patterns acquired in step S205 may also be output. Then, the process ends.

なお、ソースプログラムにおいてソースコードと第二命令パターンとが対応付けられていない場合等には、上記のステップS1203や、ステップS1204において、ソースプログラムに基づくプログラムが実行されうるステップに対応した各ソースコードについて、第二命令パターン格納部105から順次読み出したソースコードとのパターンマッチングを行って、第二命令パターンのいずれかと対応したソースコードを検出するようにすればよい。   If the source code and the second instruction pattern are not associated with each other in the source program, each source code corresponding to the step in which the program based on the source program can be executed in step S1203 or step S1204 described above. , Pattern matching with the source code sequentially read from the second instruction pattern storage unit 105 is performed to detect a source code corresponding to one of the second instruction patterns.

以下、本実施の形態におけるプログラム検証装置2の具体的な動作について説明する。ここでは、例えば、図5と同様の、第二命令パターンとソースコードの行とが対応付けられたソースプログラムが、ソースプログラム格納部101に格納されているものとする。ソースコードは、ここでは、行単位で、対応付けられた第二命令パターンを用いて変換されているものとする。また、このソースプログラムは、インタプリタ型の言語で記述されたソースプログラムであり、行単位で、ソースコードが読み出されて解釈実行されるものとする。つまり、ソースプログラムに基づくプログラムを処理する各ステップが、ソースプログラムの行と対応付けられているものとする。但し、一のステップが複数行と対応付けられていても良い。具体的に、一のステップに対応したソースコードが複数行にわたって記述されている場合には、この複数行を一のソースコード群として読み出して実行できるように、行番号や改行コードで区切られたソースコードを取得せずに、「.」(ピリオド)等で区切られた範囲のソースコードを一のステップに対応したソースコード群として取得するようにしても良い。   Hereinafter, a specific operation of the program verification apparatus 2 in the present embodiment will be described. Here, for example, it is assumed that a source program in which a second instruction pattern and a line of source code are associated with each other is stored in the source program storage unit 101 as in FIG. Here, it is assumed that the source code is converted in units of lines using the associated second instruction pattern. The source program is a source program written in an interpreter language, and the source code is read and interpreted in line units. That is, each step for processing a program based on the source program is associated with a line of the source program. However, one step may be associated with a plurality of rows. Specifically, when the source code corresponding to one step is described in multiple lines, the source code is delimited by line numbers and line feed codes so that the multiple lines can be read and executed as one source code group. Instead of acquiring the source code, the source code in a range delimited by “.” (Period) or the like may be acquired as a source code group corresponding to one step.

まず、ユーザが図5に示したソースプログラムを検証する指示を、メニュー等を操作してプログラム検証装置1に与えると、上記実施の形態1と同様に、実行済ソースコード検出部102は、ソースプログラム格納部101に格納されている図5に示したソースプログラムを読み出し、ソースプログラムに対応したプログラムを実行させ、ソースプログラムに対して予め用意された1以上のテストを行う。ただし、この具体例では、行単位でソースプログラム内のソースコードを読み出して解釈実行を行う。そして、読み出された行を検出し、検出した行の行番号を実行済ソースコードを示す情報として取得し、図示しない記憶媒体等に蓄積する。取得した実行済ソースコードの行番号は、図6と同様であるとする。   First, when the user gives an instruction to verify the source program shown in FIG. 5 to the program verification apparatus 1 by operating a menu or the like, the executed source code detection unit 102, as in the first embodiment, The source program shown in FIG. 5 stored in the program storage unit 101 is read out, a program corresponding to the source program is executed, and one or more tests prepared in advance are performed on the source program. However, in this specific example, the source code in the source program is read and interpreted in line units. Then, the read line is detected, the line number of the detected line is acquired as information indicating the executed source code, and stored in a storage medium (not shown) or the like. It is assumed that the line numbers of the acquired executed source code are the same as those in FIG.

次に、ステップ対応実行済コード検出手段2031は、ステップ対応実行済コードを検出する処理を行う。具体的には、まず、ソースプログラムに基づくプログラムを実行させた場合の各ステップに対応する各ソースコードの中から、実行済ソースコードに含まれるソースコードを検出する。ここで、この具体例においては、実行済ソースコード検出部102は、実行済ソースコードを、ソースプログラムに基づくプログラムを実行させた場合の各ステップに対応するソースコード群単位、即ち、行単位で検出しているため、実行済ソースコード検出部102が行単位で検出した実行済ソースコードが、それぞれ、ソースプログラムに基づくプログラムを実行させた場合の各ステップに対応する各ソースコードのうちの、実行済ソースコードに含まれるソースコードとなる。さらに、ステップ対応実行済コード検出手段2031は、ソースプログラムに基づくプログラムを実行させた場合の各ステップに対応する各ソースコードのうちの、実行済ソースコードに含まれるソースコードのそれぞれから、第二命令パターンのいずれか一つと対応付けられたソースコードを検出する。ここでは、第二命令パターンは、ソースプログラムに基づくプログラムを実行させた場合の各ステップに対応する各ソースコードである、ソースプログラムの各行と対応付けられていることから、この処理は、ここでは、実行済ソースコードの行の中から、第二命令パターンと対応付けられた行を検出する処理となる。   Next, the step-corresponding executed code detection unit 2031 performs processing for detecting a step-corresponding executed code. Specifically, first, the source code included in the executed source code is detected from each source code corresponding to each step when the program based on the source program is executed. Here, in this specific example, the executed source code detector 102 executes the executed source code in units of source code groups corresponding to the respective steps when a program based on the source program is executed, that is, in units of lines. Since the detected source code detected by the executed source code detection unit 102 in units of lines is detected, among the source codes corresponding to the respective steps when the program based on the source program is executed, This is the source code included in the executed source code. Further, the step-corresponding executed code detection means 2031 includes, from each of the source codes included in the executed source code, among the source codes corresponding to the steps when the program based on the source program is executed, A source code associated with any one of the instruction patterns is detected. Here, since the second instruction pattern is associated with each line of the source program, which is each source code corresponding to each step when the program based on the source program is executed, this processing is performed here. The process is to detect a line associated with the second command pattern from the lines of the executed source code.

例えば、ステップ対応実行済コード検出手段2031は、まず、図6に示した実行済ソースコードの行番号のうちの、1番目の行番号「009600」を取得し、この行番号を有する行のコメント領域内のパターンID「010999000010」を、図5に示した変換後のソースプログラムから取得する。そして、取得したパターンID「010999000010」に対応付けられた第二命令パターンがあるか否かを、図4に示したパターン管理表において判断する。図4に示したパターン管理表においては、パターンID「010999000010」に対応する第二命令パターンはないため、この行を、ステップ対応実行済コードの行として検出しない。   For example, the step-corresponding executed code detecting means 2031 first obtains the first line number “009600” among the line numbers of the executed source code shown in FIG. 6, and comments the line having this line number. The pattern ID “010999000010” in the area is acquired from the converted source program shown in FIG. Then, it is determined in the pattern management table shown in FIG. 4 whether there is a second command pattern associated with the acquired pattern ID “010999000010”. In the pattern management table shown in FIG. 4, since there is no second command pattern corresponding to the pattern ID “010999000010”, this line is not detected as a line corresponding to the step-corresponding executed code.

一方、図6に示した実行済ソースコードの行番号のうちの、6行目の行番号「010200」を取得した場合、この行番号を有する行のコメント領域内のパターンID「010999000040」を、図5に示した変換後のソースプログラムから取得する。そして取得したパターンID「010999000040」に対応付けられた第二命令パターンがあるか否かを、図4に示したパターン管理表において判断する。図4に示したパターン管理表においては、パターンID「010999000040」に対応する第二命令パターンがあるため、この行を、ステップ対応実行済コードの行として検出する。そして、ステップ対応実行済コード検出手段2031は、この行番号「010200」をステップ対応実行済コードを示す識別情報である実行済コードIDとして取得し、取得した実行済コードID(行番号)を、図示しない記憶媒体等に蓄積する。   On the other hand, when the line number “010200” of the sixth line among the line numbers of the executed source code shown in FIG. 6 is acquired, the pattern ID “010999000040” in the comment area of the line having this line number is Obtained from the converted source program shown in FIG. Then, it is determined in the pattern management table shown in FIG. 4 whether there is a second command pattern associated with the acquired pattern ID “010999000040”. In the pattern management table shown in FIG. 4, since there is a second command pattern corresponding to the pattern ID “010999000040”, this line is detected as a line of the step-corresponding executed code. Then, the step-corresponding executed code detecting means 2031 acquires this line number “010200” as an executed code ID which is identification information indicating the step-corresponding executed code, and the acquired executed code ID (line number) is It is stored in a storage medium (not shown).

図13は、ステップ対応実行済コード検出手段2031が上記の処理を行った結果、取得した実行済コードIDを示す図である。   FIG. 13 is a diagram showing the executed code ID acquired as a result of the above-described processing performed by the step-corresponding executed code detection unit 2031.

つぎに、ステップ対応変換コード検出手段2032は、ステップ対応変換コードを検出する処理を行う。具体的には、ソースプログラムに基づくプログラムを実行させた場合の各ステップに対応する各ソースコードの中から、第二命令パターンのいずれか一つと対応付けられたソースコードを検出する。ここで、この具体例においては、各ステップに対応するソースコードは、ソースプログラムの行と対応付けられており、第二命令パターンもソースプログラムの各行と対応付けられていることから、この処理は、ここでは、第二命令パターンと対応付けられたソースコードの行を検出する処理となる。ステップ対応変換コード検出手段2032は、ソースプログラムから第二命令パターンと対応付けられた行番号を、ステップ対応変換コードの識別情報である変換コードIDとして取得し、取得した変換コードID(行番号)を、図示しない記憶媒体に蓄積する。   Next, the step correspondence conversion code detection means 2032 performs processing for detecting a step correspondence conversion code. Specifically, a source code associated with any one of the second instruction patterns is detected from each source code corresponding to each step when the program based on the source program is executed. Here, in this specific example, the source code corresponding to each step is associated with a line of the source program, and the second instruction pattern is also associated with each line of the source program. Here, the processing is to detect the line of the source code associated with the second instruction pattern. The step-corresponding conversion code detecting means 2032 acquires the line number associated with the second command pattern from the source program as the conversion code ID that is identification information of the step-corresponding conversion code, and the acquired conversion code ID (line number). Are stored in a storage medium (not shown).

図14は、ステップ対応変換コード検出手段2032が上記の処理を行った結果、取得した変換コードIDを示す図である。   FIG. 14 is a diagram showing the conversion code ID acquired as a result of the above processing performed by the step correspondence conversion code detection unit 2032.

つぎに、第二変換関連情報取得手段2033は、図13に示した実行済コードIDの数をカウントする。また、図14に示した変換コードIDの数をカウントする。そして、カウントした実行済コードID数を変換コードID数で除算して、変換コードIDの数に対する実行済コードIDの数の比率を算出する。ここでは、例えば、変換コードID数が「450」、実行済コードID数が「300」であったとすると、算出される比率は、0.667、即ち66.7%となる。この算出した比率を変換関連情報として取得する。また、ここでは、図13に示したステップ対応実行済コードIDも、実行された行を示す行番号を示す変換関連情報として取得する。   Next, the second conversion related information acquisition unit 2033 counts the number of executed code IDs shown in FIG. Further, the number of conversion code IDs shown in FIG. 14 is counted. Then, the counted number of executed code IDs is divided by the number of converted code IDs to calculate the ratio of the number of executed code IDs to the number of converted code IDs. Here, for example, if the number of conversion code IDs is “450” and the number of executed code IDs is “300”, the calculated ratio is 0.667, that is, 66.7%. The calculated ratio is acquired as conversion related information. Further, here, the step-corresponding executed code ID shown in FIG. 13 is also acquired as conversion related information indicating the line number indicating the executed line.

出力部104は、第一変換関連情報取得手段1033が取得した変換関連情報を、図示しないモニタ等に表示する。   The output unit 104 displays the conversion related information acquired by the first conversion related information acquisition unit 1033 on a monitor (not shown).

図15は、変換関連情報の出力例を示す。   FIG. 15 shows an output example of the conversion related information.

出力された変換関連情報のうち、算出された比率は、ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップのうちの、第二命令パターンを用いて変換されたソースコードに対応したステップ数に対する、このソースプログラムに対して予め指定された1以上のテストを行った場合に処理されたステップのうちの、第二命令パターンを用いて変換されたソースコードに対応したステップ数の比率を示す。つまり、この比率は、ソースプログラムに対応したプログラムを実行した場合に実行されうるステップのうちの、どれぐらいの比率のステップが、テストによって検証されたかを示す指標として用いることができる。これにより、例えばテストの妥当性等を判断することができる。   Of the output conversion-related information, the calculated ratio corresponds to the source code converted using the second instruction pattern in each step that can be executed when the program based on the source program is executed. The ratio of the number of steps corresponding to the source code converted using the second instruction pattern among the steps processed when one or more predetermined tests are performed on the source program with respect to the number of steps Indicates. That is, this ratio can be used as an index indicating how many of the steps that can be executed when the program corresponding to the source program is executed are verified by the test. Thereby, for example, the validity of the test can be determined.

また、出力された変換関連情報のうちの、実行済コードIDのリストは、テストで処理されたステップに対応したソースコードのうちの、第二命令パターンを用いて変換されたもののリストである。このリストから、どの第二命令パターンで変換されたソースコードのうちの、どのソースコードがテストされたかを知ることができる。   Also, the list of executed code IDs in the output conversion related information is a list of source codes converted using the second instruction pattern in the source code corresponding to the step processed in the test. From this list, it is possible to know which source code of the source code converted by which second instruction pattern is tested.

なお、上記具体例において、ステップ対応実行済コード検出手段2031が、実行済ソースコードを構成する各行について、図4に示すような第二命令パターン格納部105に格納されている各第二命令パターンとのパターンマッチングを行い、マッチングする第二命令パターンが検出された場合に、この行のソースコードをステップ対応実行済コードとして検出するようにしても良い。   In the above specific example, the step-corresponding executed code detection means 2031 has the second instruction pattern stored in the second instruction pattern storage unit 105 as shown in FIG. 4 for each line constituting the executed source code. When the second command pattern to be matched is detected, the source code of this line may be detected as the step-corresponding executed code.

また、同様に、ステップ対応実行済コード検出手段2032が、ソースプログラムの各行について、図4に示すような第二命令パターン格納部105に格納されている各第二命令パターンとのパターンマッチングを行い、マッチングする第二命令パターンが検出された場合に、この行のステップ対応変換コードとして検出するようにしても良い。   Similarly, the step-corresponding executed code detection means 2032 performs pattern matching with each second instruction pattern stored in the second instruction pattern storage unit 105 as shown in FIG. 4 for each line of the source program. When a matching second command pattern is detected, it may be detected as a step corresponding conversion code in this line.

以上、本実施の形態によれば、ソースプログラムから実行済ソースコードを検出し、ソースプログラムに基づくプログラムを実行させた場合に処理されるステップに対応したソースコードの中から、この検出された実行済ソースコードに含まれるソースコードを含むソースコードであって、第二命令パターンに対応するソースコードを含むソースコードであるステップ対応実行済コードを検出し、このステップ対応実行済コードに関する情報を出力するようにしたので、命令パターンを用いて行われた変換の検証が十分にできたか否かを示すことができる。例えば、ソースプログラムに対応したプログラムを実行させた場合に実行されうるステップのうちの、第二命令パターンに対応するよう変更されたソースコードに対応したステップが、テスト等のためにソースプログラムに対応したプログラムを実行させた時にどの程度使用されたかを知ることができる。これにより、例えば、ソースプログラムに対して行われたテストによって、第二命令パターンで変換されたソースコードに対応するステップがどの程度検証されたかを知ることができ、テストの妥当性を検証したり、テストを終了させるか否か等の判断を行うことができる。   As described above, according to the present embodiment, the executed source code is detected from the source program, and the detected execution is detected from the source codes corresponding to the steps processed when the program based on the source program is executed. Detects step-corresponding executed code, which is source code including source code included in the completed source code, and includes source code corresponding to the second instruction pattern, and outputs information related to the step-corresponding executed code Thus, it is possible to indicate whether or not the conversion performed using the instruction pattern has been sufficiently verified. For example, among the steps that can be executed when the program corresponding to the source program is executed, the step corresponding to the source code changed to correspond to the second instruction pattern corresponds to the source program for testing or the like. It is possible to know how much was used when the program was executed. Thus, for example, it is possible to know how much the step corresponding to the source code converted by the second instruction pattern has been verified by the test performed on the source program, and to verify the validity of the test. It is possible to determine whether or not to end the test.

なお、上記各実施の形態において、各処理(各機能)は、単一の装置(システム)によって集中処理されることによって実現されてもよく、あるいは、複数の装置によって分散処理されることによって実現されてもよい。   In each of the above embodiments, each process (each function) may be realized by centralized processing by a single device (system), or by distributed processing by a plurality of devices. May be.

また、上記各実施の形態において、一の装置に存在する2以上の通信手段(情報送信部など)は、物理的に一の媒体で実現されても良いことは言うまでもない。   Further, in each of the above embodiments, it goes without saying that two or more communication means (such as an information transmission unit) existing in one apparatus may be physically realized by one medium.

また、上記実施の形態において、各構成要素が実行する処理に関係する情報、例えば、各構成要素が受け付けたり、取得したり、選択したり、生成したり、送信したり、受信したりする情報や、各構成要素が処理で用いるしきい値や数式、アドレス等の情報等は、上記説明で明記していない場合であっても、図示しない記録媒体において、一時的に、あるいは長期にわたって保持されていてもよい。また、その図示しない記録媒体への情報の蓄積を、各構成要素、あるいは、図示しない蓄積部が行ってもよい。また、その図示しない記録媒体からの情報の読み出しを、各構成要素、あるいは、図示しない読み出し部が行ってもよい。   In the above embodiment, information related to processing executed by each component, for example, information received, acquired, selected, generated, transmitted, and received by each component. In addition, information such as threshold values, mathematical formulas, addresses, etc. used by each component in processing is retained temporarily or over a long period of time on a recording medium (not shown) even when not explicitly stated in the above description. It may be. Further, the storage of information in the recording medium (not shown) may be performed by each component or a storage unit (not shown). Further, reading of information from the recording medium (not shown) may be performed by each component or a reading unit (not shown).

また、上記各実施の形態では、プログラム検証装置がスタンドアロンである場合について説明したが、プログラム検証装置は、スタンドアロンの装置であってもよく、サーバ・クライアントシステムにおけるサーバ装置であってもよい。後者の場合には、出力部や受付部は、通信回線を介して入力を受け付けたり、画面を出力したりすることになる。   Further, although cases have been described with the above embodiments where the program verification apparatus is a stand-alone, the program verification apparatus may be a stand-alone apparatus or a server apparatus in a server / client system. In the latter case, the output unit or the reception unit receives an input or outputs a screen via a communication line.

また、上記各実施の形態において、各構成要素は専用のハードウェアにより構成されてもよく、あるいは、ソフトウェアにより実現可能な構成要素については、プログラムを実行することによって実現されてもよい。例えば、ハードディスクや半導体メモリ等の記録媒体に記録されたソフトウェア・プログラムをCPU等のプログラム実行部が読み出して実行することによって、各構成要素が実現され得る。   In each of the above embodiments, each component may be configured by dedicated hardware, or a component that can be realized by software may be realized by executing a program. For example, each component can be realized by a program execution unit such as a CPU reading and executing a software program recorded on a recording medium such as a hard disk or a semiconductor memory.

なお、上記各実施の形態におけるプログラム検証装置を実現するソフトウェアは、以下のようなプログラムである。つまり、このプログラムは、コンピュータを、第一命令パターンに対応するソースコードを、第一命令パターンに対応する1以上の第二命令パターンに対応するソースコードに変換して得られたソースプログラムが格納され得るソースプログラム格納部に格納されているソースプログラムに基づくプログラムを実行させた場合に使用されるソースコードである実行済ソースコードをソースプログラムから検出する実行済ソースコード検出部と、検出された実行済ソースコードのうちの、第二命令パターンに対応するソースコードに変換された部分に関する情報である変換関連情報を取得する変換関連情報取得部と、変換関連情報取得部が取得した変換関連情報を出力する出力部として機能させるためのプログラムである。   The software that realizes the program verification device in each of the above embodiments is the following program. That is, the program stores a source program obtained by converting a source code corresponding to the first instruction pattern into a source code corresponding to one or more second instruction patterns corresponding to the first instruction pattern. An executed source code detection unit that detects an executed source code that is a source code used when a program based on a source program stored in a source program storage unit that can be executed is executed from the source program; and Of the executed source code, a conversion related information acquisition unit that acquires conversion related information that is information related to a portion converted to the source code corresponding to the second instruction pattern, and the conversion related information acquired by the conversion related information acquisition unit Is a program for functioning as an output unit for outputting.

なお、上記プログラムにおいて、情報を送信する送信ステップや、情報を受信する受信ステップなどでは、ハードウェアによって行われる処理、例えば、送信ステップにおけるモデムやインターフェースカードなどで行われる処理(ハードウェアでしか行われない処理)は含まれない。   In the above program, in a transmission step for transmitting information, a reception step for receiving information, etc., processing performed by hardware, for example, processing performed by a modem or an interface card in the transmission step (only performed by hardware). Not included) is not included.

なお、上記プログラムにおいて、上記プログラムが実現する機能には、ハードウェアでしか実現できない機能は含まれない。例えば、情報を取得する取得部や、情報を出力する出力部などにおけるモデムやインターフェースカードなどのハードウェアでしか実現できない機能は、上記プログラムが実現する機能には含まれない。   In the program, the functions realized by the program do not include functions that can be realized only by hardware. For example, a function that can be realized only by hardware such as a modem or an interface card in an acquisition unit that acquires information or an output unit that outputs information is not included in the function realized by the program.

また、このプログラムを実行するコンピュータは、単数であってもよく、複数であってもよい。すなわち、集中処理を行ってもよく、あるいは分散処理を行ってもよい。   Further, the computer that executes this program may be singular or plural. That is, centralized processing may be performed, or distributed processing may be performed.

図16は、上記プログラムを実行して、上記実施の形態によるプログラム検証装置を実現するコンピュータの外観の一例を示す模式図である。上記実施の形態は、コンピュータハードウェア及びその上で実行されるコンピュータプログラムによって実現されうる。   FIG. 16 is a schematic diagram showing an example of the appearance of a computer that executes the program and realizes the program verification apparatus according to the embodiment. The above-described embodiment can be realized by computer hardware and a computer program executed on the computer hardware.

図16において、コンピュータシステム900は、CD−ROM(Compact Disk Read Only Memory)ドライブ905、FD(Floppy(登録商標) Disk)ドライブ906を含むコンピュータ901と、キーボード902と、マウス903と、モニタ904とを備える。   In FIG. 16, a computer system 900 includes a computer 901 including a CD-ROM (Compact Disk Read Only Memory) drive 905 and an FD (Floppy (registered trademark) Disk) drive 906, a keyboard 902, a mouse 903, a monitor 904, and the like. Is provided.

図17は、コンピュータシステム900の内部構成を示す図である。図17において、コンピュータ901は、CD−ROMドライブ905、FDドライブ906に加えて、MPU(Micro Processing Unit)911と、ブートアッププログラム等のプログラムを記憶するためのROM912と、MPU911に接続され、アプリケーションプログラムの命令を一時的に記憶すると共に、一時記憶空間を提供するRAM(Random Access Memory)913と、アプリケーションプログラム、システムプログラム、及びデータを記憶するハードディスク914と、MPU911、ROM912等を相互に接続するバス915とを備える。なお、コンピュータ901は、LANへの接続を提供する図示しないネットワークカードを含んでいてもよい。   FIG. 17 is a diagram showing an internal configuration of the computer system 900. In FIG. 17, in addition to the CD-ROM drive 905 and the FD drive 906, a computer 901 is connected to an MPU (Micro Processing Unit) 911, a ROM 912 for storing a program such as a bootup program, and the MPU 911. A RAM (Random Access Memory) 913 that temporarily stores program instructions and provides a temporary storage space, a hard disk 914 that stores application programs, system programs, and data, and an MPU 911 and a ROM 912 are interconnected. And a bus 915. The computer 901 may include a network card (not shown) that provides connection to the LAN.

コンピュータシステム900に、上記実施の形態によるプログラム検証装置等の機能を実行させるプログラムは、CD−ROM921、またはFD922に記憶されて、CD−ROMドライブ905、またはFDドライブ906に挿入され、ハードディスク914に転送されてもよい。これに代えて、そのプログラムは、図示しないネットワークを介してコンピュータ901に送信され、ハードディスク914に記憶されてもよい。プログラムは実行の際にRAM913にロードされる。なお、プログラムは、CD−ROM921やFD922、またはネットワークから直接、ロードされてもよい。   A program that causes the computer system 900 to execute functions such as the program verification device according to the above embodiment is stored in the CD-ROM 921 or the FD 922, inserted into the CD-ROM drive 905 or the FD drive 906, and stored in the hard disk 914. May be forwarded. Instead, the program may be transmitted to the computer 901 via a network (not shown) and stored in the hard disk 914. The program is loaded into the RAM 913 when executed. The program may be loaded directly from the CD-ROM 921, the FD 922, or the network.

プログラムは、コンピュータ901に、上記実施の形態によるプログラム検証装置の機能を実行させるオペレーティングシステム(OS)、またはサードパーティプログラム等を必ずしも含んでいなくてもよい。プログラムは、制御された態様で適切な機能(モジュール)を呼び出し、所望の結果が得られるようにする命令の部分のみを含んでいてもよい。コンピュータシステム900がどのように動作するのかについては周知であり、詳細な説明は省略する。
本発明は、以上の実施の形態に限定されることなく、種々の変更が可能であり、それらも本発明の範囲内に包含されるものであることは言うまでもない。
The program does not necessarily include an operating system (OS) or a third-party program that causes the computer 901 to execute the functions of the program verification apparatus according to the above-described embodiment. The program may include only a part of an instruction that calls an appropriate function (module) in a controlled manner and obtains a desired result. How the computer system 900 operates is well known and will not be described in detail.
The present invention is not limited to the above-described embodiments, and various modifications are possible, and it goes without saying that these are also included in the scope of the present invention.

以上のように、本発明にかかるプログラム検証装置等は、プログラムを検証する装置等として適しており、特に、命令パターンにより変換された部分が十分に検証されたか否か等を確認可能な検証装置等として有用である。   As described above, the program verification device according to the present invention is suitable as a device for verifying a program, and in particular, a verification device capable of confirming whether or not a portion converted by an instruction pattern has been sufficiently verified. Useful as such.

1、2 プログラム検証装置
101 ソースプログラム格納部
102 実行済ソースコード検出部
103、203 変換関連情報取得部
104 出力部
105 第二命令パターン格納部
1031 実行済命令パターン検出手段
1032 変換命令パターン検出手段
1033 第一変換関連情報取得手段
2031 ステップ対応実行済コード検出手段
2032 ステップ対応変換コード検出手段
2033 第二変換関連情報取得手段
2034 指定情報格納部
DESCRIPTION OF SYMBOLS 1, 2 Program verification apparatus 101 Source program storage part 102 Execution source code detection part 103, 203 Conversion related information acquisition part 104 Output part 105 Second instruction pattern storage part 1031 Execution instruction pattern detection means 1032 Conversion instruction pattern detection means 1033 First conversion related information acquisition means 2031 Step corresponding executed code detection means 2032 Step corresponding conversion code detection means 2033 Second conversion related information acquisition means 2034 Designated information storage unit

Claims (11)

第一命令パターンに対応するソースコードを、当該第一命令パターンに対応する1以上の第二命令パターンに対応するソースコードに変換して得られたソースプログラムが格納され得るソースプログラム格納部と、
前記ソースプログラム格納部に格納されているソースプログラムに基づくプログラムを実行させた場合に使用されるソースコードである実行済ソースコードを当該ソースプログラムから検出する実行済ソースコード検出部と、
前記検出された実行済ソースコードのうちの、前記第二命令パターンに対応するソースコードに変換された部分に関する情報である変換関連情報を取得する変換関連情報取得部と、
前記変換関連情報取得部が取得した変換関連情報を出力する出力部とを備えたプログラム検証装置。
A source program storage unit capable of storing a source program obtained by converting source code corresponding to a first instruction pattern into source code corresponding to one or more second instruction patterns corresponding to the first instruction pattern;
An executed source code detection unit for detecting an executed source code, which is a source code used when a program based on the source program stored in the source program storage unit is executed, from the source program;
A conversion related information acquisition unit that acquires conversion related information that is information on a portion of the detected executed source code that has been converted into a source code corresponding to the second instruction pattern;
The program verification apparatus provided with the output part which outputs the conversion relevant information which the said conversion relevant information acquisition part acquired.
前記変換関連情報取得部は、
前記実行済ソースコードに含まれるソースコードと対応する前記第二命令パターンである実行済命令パターンを検出する実行済命令パターン検出手段と、
前記実行済命令パターン検出手段が検出した第二命令パターンに関する情報を含む前記変換関連情報を取得する第一変換関連情報取得手段とを備えた請求項1記載のプログラム検証装置。
The conversion related information acquisition unit
Executed instruction pattern detection means for detecting an executed instruction pattern which is the second instruction pattern corresponding to the source code included in the executed source code;
The program verification apparatus according to claim 1, further comprising first conversion related information acquisition means for acquiring the conversion related information including information related to the second instruction pattern detected by the executed instruction pattern detection means.
前記変換関連情報は、前記実行済命令パターン検出手段が検出した第二命令パターンの出現量に関する情報である請求項記載のプログラム検証装置。 The program verification apparatus according to claim 2 , wherein the conversion related information is information related to an appearance amount of the second instruction pattern detected by the executed instruction pattern detection unit. 前記変換関連情報取得部は、
前記ソースプログラムに含まれるソースコードと対応する前記第二命令パターンである変換命令パターンを検出する変換命令パターン検出手段を更に備え、
前記第一変換関連情報取得手段は、
前記変換命令パターン検出手段が検出した異なる変換命令パターンの数に対する、前記実行済命令パターン検出手段が検出した異なる実行済命令パターンの数の比率を示す情報を含む前記変換関連情報を取得する請求項2または請求項3記載のプログラム検証装置。
The conversion related information acquisition unit
A conversion instruction pattern detecting means for detecting a conversion instruction pattern that is the second instruction pattern corresponding to the source code included in the source program;
The first conversion related information acquisition unit includes:
The conversion related information including information indicating a ratio of the number of different executed instruction patterns detected by the executed instruction pattern detection means to the number of different conversion instruction patterns detected by the conversion instruction pattern detection means. The program verification apparatus according to claim 2 or claim 3.
前記変換関連情報取得部は、
前記ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードであって、前記実行済ソースコードに含まれるとともに、前記第二命令パターンに対応するソースコードを含むソースコードであるステップ対応実行済コードを検出するステップ対応実行済コード検出手段と、
前記ステップ対応実行済コード検出手段が検出したステップ対応実行済コードに関する情報を含む前記変換関連情報を取得する第二変換関連情報取得手段とを備えた請求項1から請求項4いずれか記載のプログラム検証装置。
The conversion related information acquisition unit
Source code in a source program corresponding to each step that can be executed when a program based on the source program is executed, the source code being included in the executed source code and corresponding to the second instruction pattern Step-corresponding executed code detecting means for detecting step-corresponding executed code that is source code including:
5. The program according to claim 1, further comprising second conversion related information acquisition means for acquiring the conversion related information including information related to the step corresponding executed code detected by the step corresponding executed code detection means. Verification device.
前記変換関連情報は、前記ステップ対応実行済コード検出手段が検出したステップ対応実行済コードの出現量に関する情報である請求項5記載のプログラム検証装置。 The program verification apparatus according to claim 5, wherein the conversion related information is information relating to an appearance amount of the step-corresponding executed code detected by the step-corresponding executed code detecting means. 前記変換関連情報取得部は、
前記ソースプログラムに基づくプログラムを実行させた場合に実行されうる各ステップに対応するソースプログラム内のソースコードであって、前記第二命令パターンと対応するソースコードを含むソースコードであるステップ対応変換コードを検出するステップ対応変換コード検出手段を更に備え、
前記第二変換関連情報取得手段は、
前記ステップ対応変換コード検出手段が検出したステップ対応変換コードの数に対する、前記ステップ対応実行済コード検出手段が検出したステップ対応実行済コードの数の比率を示す情報を含む前記変換関連情報を取得する請求項5または請求項6記載のプログラム検証装置。
The conversion related information acquisition unit
Step-corresponding conversion code that is source code in a source program corresponding to each step that can be executed when a program based on the source program is executed, and is a source code that includes the source code corresponding to the second instruction pattern Further comprising step corresponding conversion code detecting means for detecting
The second conversion related information acquisition means
The conversion related information including information indicating the ratio of the number of step-corresponding executed codes detected by the step-corresponding executed code detecting means to the number of step-corresponding converted codes detected by the step-corresponding conversion code detecting means is acquired. The program verification apparatus according to claim 5 or 6.
前記ソースプログラム格納部には、前記ソースプログラムの変換に用いられた第二命令パターンを示す情報と、当該第二命令パターンにより変換された当該ソースプログラム内のソースコードとが対応付けて格納されており、
前記実行済命令パターン検出手段は、前記ソースプログラム格納部に格納されている第二命令パターンを示す情報から、前記実行済ソースコード検出部が検出した実行済ソースコード内に含まれるソースコードと対応付けられた第二命令パターンを示す情報を検出して、実行済命令パターンである第二命令パターンを検出する請求項2から請求項4いずれか記載のプログラム検証装置。
In the source program storage unit, information indicating the second instruction pattern used for the conversion of the source program and the source code in the source program converted by the second instruction pattern are stored in association with each other. And
The executed instruction pattern detection means corresponds to the source code included in the executed source code detected by the executed source code detection unit from the information indicating the second instruction pattern stored in the source program storage unit 5. The program verification apparatus according to claim 2, wherein information indicating the attached second instruction pattern is detected to detect a second instruction pattern which is an executed instruction pattern.
前記ソースプログラムの変換に用いられた第二命令パターンを含む第二命令パターンが格納され得る第二命令パターン格納部を更に備え、
前記実行済命令パターン検出手段は、前記実行済ソースコード検出部が検出した実行済ソースコードと前記第二命令パターン格納部に格納されている前記第二命令パターンとのパターンマッチングを行って、前記実行済ソースコードに含まれるソースコードと対応する前記第二命令パターンを検出する請求項2から請求項4いずれか記載のプログラム検証装置。
A second instruction pattern storage unit capable of storing a second instruction pattern including a second instruction pattern used for conversion of the source program;
The executed instruction pattern detection means performs pattern matching between the executed source code detected by the executed source code detection unit and the second instruction pattern stored in the second instruction pattern storage unit, and The program verification apparatus according to claim 2, wherein the second instruction pattern corresponding to the source code included in the executed source code is detected.
第一命令パターンに対応するソースコードを、当該第一命令パターンに対応する1以上の第二命令パターンに対応するソースコードに変換して得られたソースプログラムが格納され得るソースプログラム格納部と、実行済ソースコード検出部と、変換関連情報取得部と、出力部とを用いて行われるプログラム検証方法であって、
前記実行済ソースコード検出部が、前記ソースプログラム格納部に格納されているソースプログラムに基づくプログラムを実行させた場合に使用されるソースコードである実行済ソースコードを当該ソースプログラムから検出する実行済ソースコード検出ステップと、
前記変換関連情報取得部が、前記検出された実行済ソースコードのうちの、前記第二命令パターンに対応するソースコードに変換された部分に関する情報である変換関連情報を取得する変換関連情報取得ステップと、
前記出力部が、前記変換関連情報取得ステップで取得した変換関連情報を出力する出力ステップとを備えたプログラム検証方法。
A source program storage unit capable of storing a source program obtained by converting source code corresponding to a first instruction pattern into source code corresponding to one or more second instruction patterns corresponding to the first instruction pattern; A program verification method performed using an executed source code detection unit, a conversion related information acquisition unit, and an output unit,
The executed source code detection unit detects an executed source code, which is a source code used when a program based on the source program stored in the source program storage unit is executed, from the source program. A source code detection step;
A conversion related information acquisition step in which the conversion related information acquisition unit acquires conversion related information that is information on a portion of the detected executed source code that has been converted into a source code corresponding to the second instruction pattern. When,
An output step in which the output unit outputs the conversion related information acquired in the conversion related information acquisition step.
コンピュータを、
第一命令パターンに対応するソースコードを、当該第一命令パターンに対応する1以上の第二命令パターンに対応するソースコードに変換して得られたソースプログラムが格納され得るソースプログラム格納部に格納されているソースプログラムに基づくプログラムを実行させた場合に使用されるソースコードである実行済ソースコードを当該ソースプログラムから検出する実行済ソースコード検出部と、
前記検出された実行済ソースコードのうちの、前記第二命令パターンに対応するソースコードに変換された部分に関する情報である変換関連情報を取得する変換関連情報取得部と、
前記変換関連情報取得部が取得した変換関連情報を出力する出力部として機能させるためのプログラム。
Computer
The source code corresponding to the first instruction pattern is stored in the source program storage unit in which the source program obtained by converting the source code corresponding to the one or more second instruction patterns corresponding to the first instruction pattern can be stored. An executed source code detection unit that detects an executed source code, which is a source code used when a program based on the source program being executed is executed, from the source program;
A conversion related information acquisition unit that acquires conversion related information that is information on a portion of the detected executed source code that has been converted into a source code corresponding to the second instruction pattern;
The program for functioning as an output part which outputs the conversion relevant information which the said conversion relevant information acquisition part acquired.
JP2010031925A 2010-02-17 2010-02-17 Program verification apparatus, program verification method, and program Active JP5448907B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010031925A JP5448907B2 (en) 2010-02-17 2010-02-17 Program verification apparatus, program verification method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010031925A JP5448907B2 (en) 2010-02-17 2010-02-17 Program verification apparatus, program verification method, and program

Publications (2)

Publication Number Publication Date
JP2011170473A JP2011170473A (en) 2011-09-01
JP5448907B2 true JP5448907B2 (en) 2014-03-19

Family

ID=44684560

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010031925A Active JP5448907B2 (en) 2010-02-17 2010-02-17 Program verification apparatus, program verification method, and program

Country Status (1)

Country Link
JP (1) JP5448907B2 (en)

Also Published As

Publication number Publication date
JP2011170473A (en) 2011-09-01

Similar Documents

Publication Publication Date Title
US9251046B2 (en) Method and system for generating and processing black box test cases
US9454466B2 (en) Explaining partially illegal combinations in combinatorial models
JP5350428B2 (en) Automatic program generation apparatus, method and computer program
CN102804147A (en) Code inspection executing system for performing a code inspection of ABAP source codes
KR20160021585A (en) Method for measuring code coverage and computer readable recording medium having program the same
JP6245006B2 (en) Test case generation apparatus, method, and program
JP2008305386A (en) Program pattern analyzing device, pattern appearance status information production method, pattern information creation device and program
JP6440895B2 (en) Software analysis apparatus and software analysis method
JP2010102620A (en) User operation scenario generating device, method and program
JP6451417B2 (en) Debug support device, debug support system, debug support method, and debug support program
JP5448907B2 (en) Program verification apparatus, program verification method, and program
JP2013077124A (en) Software test case generation device
JP7331681B2 (en) Test execution program, test execution method, and test execution device
JP7380851B2 (en) Test script generation device, test script generation method and program
JP6018539B2 (en) Information processing apparatus, information processing method, and program
JP5578625B2 (en) Program analysis apparatus, program analysis method, and program
JP2018116517A (en) Development support device, development support method, and program
KR20160025881A (en) Apparatus and method for detecting malicious shared library file
JP2011170474A (en) Device and method for detecting program, and program
JP5900197B2 (en) Route condition selection apparatus, program, and method
JP2020098413A (en) Test support device, test support method and computer program
JP5411613B2 (en) Program test determination device, program test determination method, and program
KR101984294B1 (en) System and method for analyzing source code based on dynamic analysis
JP5516277B2 (en) Test case relation extraction method, test case relation extraction device, and test case relation extraction program
JP2010277576A (en) Software development linage measurement device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20121001

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131023

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131025

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20131121

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: 20131203

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131224

R150 Certificate of patent or registration of utility model

Ref document number: 5448907

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

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