JP5170555B2 - Error trace simplification system, error trace simplification method, and program - Google Patents
Error trace simplification system, error trace simplification method, and program Download PDFInfo
- Publication number
- JP5170555B2 JP5170555B2 JP2008265162A JP2008265162A JP5170555B2 JP 5170555 B2 JP5170555 B2 JP 5170555B2 JP 2008265162 A JP2008265162 A JP 2008265162A JP 2008265162 A JP2008265162 A JP 2008265162A JP 5170555 B2 JP5170555 B2 JP 5170555B2
- Authority
- JP
- Japan
- Prior art keywords
- error trace
- expression
- conditional
- simplification
- true
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Description
本発明は、エラートレース簡略化システムに関し、特にソースコード検証におけるエラートレース簡略化システムに関する。 The present invention relates to an error trace simplification system, and more particularly to an error trace simplification system in source code verification.
従来、コンピュータプログラムのソースコードを検証し、エラートレース、すなわちエラーが発生するパスをユーザに提示できるソースコード検証手法が存在する。 Conventionally, there is a source code verification method that can verify a source code of a computer program and present an error trace, that is, a path where an error occurs to a user.
エラートレースは、エラーが発生するまでに実行される各ステップ(プログラムステップ)において、そのステップが対応するソースコード上の行番号、当該ステップで実行された代入の式、当該ステップで評価されて成立した条件の式、及び当該ステップにおける変数の値を含む。 Error tracing is performed at each step (program step) executed until an error occurs, the line number on the source code corresponding to the step, the substitution expression executed at that step, and evaluated at that step. And the value of the variable in that step.
このようなエラートレースをユーザが参照すると、エラーが発生する原因を調査することができる。 When the user refers to such an error trace, the cause of the error can be investigated.
これは、エラートレースを提示しないソースコード検証手法と比較した場合、大きな利点であると言える。エラートレースを提示しないソースコード検証手法として、例えばSplint(非特許文献1参照)等が存在する。 This can be said to be a great advantage when compared to a source code verification method that does not present an error trace. As a source code verification method that does not present an error trace, for example, there is Spint (see Non-Patent Document 1).
なお、エラートレースを提示するソースコード検証手法は、一般に厳密な計算を要求するために、次のような特徴を持つ。例えば、エラートレースを提示するソースコード検証手法では、ソースコード内のメモリ領域に対するアクセスを行う箇所において、静的にアドレスが決まる表現(静的アクセス)は扱えるが、動的にアドレスが決まる表現(動的アクセス)は扱えない。 Note that the source code verification method for presenting an error trace generally has the following characteristics in order to require strict calculation. For example, in the source code verification method that presents an error trace, an expression that statically determines an address (static access) can be handled at a location that accesses a memory area in the source code, but an expression that dynamically determines an address ( Dynamic access) cannot be handled.
一般的なソースコードは、配列の添字が変数である場合や、変数を用いてポインタ演算をする場合等、動的アクセスを多く含む。前述したようなソースコード検証手法では動的アクセスを利用できないため、それらのソースコードをそのままでは扱うことができない。 General source code includes many dynamic accesses, such as when an array index is a variable or when a pointer operation is performed using a variable. Since the source code verification method as described above cannot use dynamic access, the source code cannot be handled as it is.
このような場合、動的アクセスを静的アクセスに書き換える方式を利用できる。このための手段として、条件分岐を用いる技術が知られている(非特許文献2参照)。 In such a case, a method of rewriting dynamic access to static access can be used. As means for this, a technique using conditional branching is known (see Non-Patent Document 2).
これを応用し、動的アクセスを、条件演算子(conditional operator)による条件分岐を用いて、静的アクセスに書き換え、その後にソースコード検証手法を適用する技術が知られている(非特許文献3参照)。このような書き換えのことをフラット化と呼ぶ。 A technique is known in which dynamic access is rewritten to static access using a conditional branch by a conditional operator, and then a source code verification method is applied (Non-patent Document 3). reference). Such rewriting is called flattening.
以上により、動的アクセスを含むソースコードに、ソースコード検証を適用することはできる。 As described above, source code verification can be applied to source code including dynamic access.
しかしながら、従来のソースコード検証手法においては、ユーザがエラートレースを参照する労力が大きいという問題があった。 However, the conventional source code verification method has a problem that the user has a great effort to refer to the error trace.
なぜなら、ソースコード検証手法の出力であるエラートレースは、フラット化後のソースコードに基づくためである。フラット化後のソースコードは条件演算子による演算を多数含むので、結果として、エラートレースも条件演算子による演算を多数含む複雑なものとなる。条件演算子による演算を用いた複雑な式を解釈するのは、ユーザにとって労力を要する作業であると言える。 This is because the error trace that is the output of the source code verification technique is based on the flattened source code. Since the source code after flattening includes many operations using conditional operators, as a result, the error trace also becomes complicated including many operations using conditional operators. It can be said that interpreting a complex expression using an operation by a conditional operator is a labor-intensive work for the user.
関連する技術として、特開2000−215037号公報(特許文献1)にソ―スコ―ド表示装置、ソ―スコ―ド表示方法およびデバック処理装置が開示されている。この関連技術では、プログラムをステップ実行中に分岐処理があると、分岐処理条件を解析してその条件で実行しない行と実行する行とを調べ、ソースコードの表示で実行しない行の色を目立たなくしている。 As a related technique, Japanese Laid-Open Patent Publication No. 2000-215037 (Patent Document 1) discloses a source code display device, a source code display method, and a debug processing device. In this related technology, if there is a branch process during step execution of a program, the branch process condition is analyzed, the line that is not executed under that condition and the line that is executed are examined, and the color of the line that is not executed in the source code display stands out. It is lost.
また、特開2001−142716号公報(特許文献2)にループ内条件分岐削除最適化方式が開示されている。この関連技術では、条件分岐コードから無条件分岐コードへの変更に起因して不要となったコード(当該無条件分岐コードおよび当該変更に起因して決して実行されなくなったコード)を削除している。 Japanese Patent Laid-Open No. 2001-142716 (Patent Document 2) discloses an in-loop conditional branch deletion optimization method. In this related technology, the code that became unnecessary due to the change from the conditional branch code to the unconditional branch code (the unconditional branch code and the code that has never been executed due to the change) is deleted. .
本発明の目的は、コンピュータプログラムのソースコードに対して、ソースコード検証手法を適用した場合に、得られるエラートレースを参照する作業を省力化するエラートレース簡略化システムを提供することである。 An object of the present invention is to provide an error trace simplification system that saves labor for referring to an error trace obtained when a source code verification method is applied to the source code of a computer program.
本発明のエラートレース簡略化システムは、入力されたソースコードをフラット化するフラット化部と、フラット化されたソースコードを検証し、エラートレースを作成するソースコード検証部と、作成されたエラートレースに含まれるステップに対し、条件演算子による演算を含む場合には、条件演算子による演算を含まない形式に簡略化するエラートレース簡略化部とを具備する。 An error trace simplification system according to the present invention includes a flattening unit that flattens input source code, a source code verification unit that verifies the flattened source code and creates an error trace, and the created error trace. In the case where an operation by a conditional operator is included in the steps included in, an error trace simplification unit that simplifies to a format not including an operation by a conditional operator is provided.
本発明のエラートレース簡略化方法は、入力されたソースコードをフラット化することと、フラット化されたソースコードを検証し、エラートレースを作成することと、作成されたエラートレースに含まれるステップに対し、条件演算子による演算を含む場合には、条件演算子による演算を含まない形式に簡略化することとを含む。 The error trace simplification method of the present invention includes flattening input source code, verifying the flattened source code, creating an error trace, and steps included in the created error trace. On the other hand, in the case of including an operation by a conditional operator, it includes simplification to a format not including an operation by a conditional operator.
本発明のプログラムは、入力されたソースコードをフラット化することと、フラット化されたソースコードを検証し、エラートレースを作成することと、作成されたエラートレースに含まれるステップに対し、条件演算子による演算を含む場合には、条件演算子による演算を含まない形式に簡略化することとをコンピュータに実行させるためのプログラムである。 The program of the present invention flattens input source code, verifies the flattened source code, creates an error trace, and performs conditional operations on the steps included in the created error trace. When a calculation by a child is included, this is a program for causing a computer to execute simplification to a format that does not include a calculation by a conditional operator.
フラット化を用いたソースコード検証処理において、エラートレースに含まれる表現を簡略化し、ユーザにとって分かりやすいエラートレースの出力を可能とする。 In the source code verification process using flattening, the expression included in the error trace is simplified, and an error trace that is easy for the user to output can be output.
以下に、本発明の実施形態について添付図面を参照して説明する。 Embodiments of the present invention will be described below with reference to the accompanying drawings.
図1を参照すると、本発明のエラートレース簡略化システムは、入力ソースコード1と、処理装置2と、記憶装置3と、簡略化エラートレース4を含む。
Referring to FIG. 1, the error trace simplification system of the present invention includes an
本発明のエラートレース簡略化システムの例として、PC(パソコン)、シンクライアント端末/サーバ、ワークステーション、メインフレーム、スーパーコンピュータ等のコンピュータを想定している。なお、本システムは、端末やサーバに限らず、中継機器や周辺機器でも良い。また、本システムは、コンピュータに搭載される拡張ボードやソフトウェアでも良い。更に、本システムは、コンピュータに搭載された仮想マシン(Virtual Machine(VM))環境でも良い。但し、実際には、これらの例に限定されない。 As an example of the error trace simplification system of the present invention, a computer such as a PC (personal computer), a thin client terminal / server, a workstation, a mainframe, and a supercomputer is assumed. The system is not limited to a terminal or a server, and may be a relay device or a peripheral device. The system may be an expansion board or software installed in a computer. Furthermore, this system may be a virtual machine (Virtual Machine (VM)) environment mounted on a computer. However, actually, it is not limited to these examples.
入力ソースコード1は、ソースコード検証の対象となるソースコードである。図2に、入力ソースコード1の内容を例示する。
The
処理装置2は、プログラム制御により動作する。処理装置2の例として、CPU(Central Processing Unit)やマイクロプロセッサ(microprocessor)等の処理装置、又は同様の機能を有する半導体集積回路(Integrated Circuit(IC))等が考えられる。なお、処理装置2は、本発明のエラートレース簡略化方法をコンピュータに実行させるためのプログラムでも良い。但し、実際には、これらの例に限定されない。
The
記憶装置3は、情報を記憶する。記憶装置3の例として、メモリ等の半導体記憶装置、ハードディスク等の外部記憶装置(ストレージ)、又は、記憶媒体(メディア)等が考えられる。また、記憶装置3は、外付けの記憶装置やネットワーク上のストレージサーバでも良い。但し、実際には、これらの例に限定されない。
The
簡略化エラートレース4は、本発明のエラートレース簡略化システムにおける処理結果である。
The
処理装置2は、ソースコード入力部21と、フラット化部22と、ソースコード検証部23と、エラートレース簡略化部24と、結果出力部25を備える。
The
ソースコード入力部21は、入力ソースコード1を読み込み、フラット化部22に受け渡す。
The source
フラット化部22は、入力ソースコード1をフラット化して、ソースコード検証部23に受け渡す。ここでは、フラット化部22は、図2に示すような入力ソースコード1をフラット化して、図3に示すようなフラット化されたソースコード(フラット化コード)を作成し、フラット化されたソースコード(フラット化コード)をソースコード検証部23に受け渡す。
The flattening
ソースコード検証部23は、フラット化されたソースコード(フラット化コード)にソースコード検証を適用し、得られたエラートレースを記憶装置3のエラートレース記憶部31に格納する。すなわち、ソースコード検証部23は、フラット化されたソースコード(フラット化コード)を基に、ソースコード検証手法に従って、エラートレースを作成する。
The source
エラートレース簡略化部24は、記憶装置3のエラートレース記憶部31に格納されたエラートレースに含まれる全てのステップについて、条件演算子による演算を含む場合には簡略化しながら、記憶装置3の簡略化エラートレース記憶部32に格納する。条件演算子による演算は、「条件式 ? 真の式 : 偽の式」で表される。すなわち、条件演算子による演算は、条件式、真の式、偽の式の3要素を含む。エラートレース簡略化部24は、条件式が真であるか偽であるかを当該ステップにおける変数の値を根拠にして判定し、判定の結果と条件演算子によって選択された真の式、又は偽の式のみを残すことにより、式の構成要素を減らす。
The error
なお、エラートレース簡略化部24は、処理装置2の外部に独立して設けられた装置とすることも可能である。例えば、エラートレース簡略化部24は、複数の記憶装置3にアクセス可能なサーバでも良い。また、エラートレース簡略化部24は、記憶装置3を有する端末やサーバ等に含まれていても良い。
Note that the error
結果出力部25は、記憶装置3の簡略化エラートレース記憶部32に格納されたエラートレースを、簡略化エラートレース4として出力する。
The
記憶装置3は、エラートレース記憶部31と、簡略化エラートレース記憶部32を備える。
The
エラートレース記憶部31は、エラーが発生するまでに実行される各ステップの情報を保持する。具体的には、エラートレース記憶部31に保持される情報は、図4A、図4B、及び図4Cに示すように、そのステップが対応するソースコード上の行番号、当該ステップで実行された代入式、当該ステップで評価され成立した条件式、及び当該ステップにおける変数の値を含む。なお、ステップ数の数え方には様々な基準があるが、多くの場合、プログラムのソースコードの行数である「LOC」(Lines Of Code)を基にした値となる。LOCをそのままステップ数として用いることもあるが、LOCからプログラムとしては意味を成さない空行やコメントの行の数を除いて換算する場合もある。
The error
簡略化エラートレース記憶部32は、基本的には、エラートレース記憶部31の内容と同様の内容(エラーが発生するまでに実行される各ステップの情報)を保持する。但し、簡略化エラートレース記憶部32は、条件演算子による演算を含むステップについては、簡略化された後に保持する。すなわち、簡略化エラートレース記憶部32は、条件演算子による演算を含まないステップが転記されたエラートレースを格納する。例えば、簡略化エラートレース記憶部32は、エラートレース記憶部31に格納されたエラートレースに、条件演算子による演算を含むステップが含まれていない場合、エラートレース記憶部31に格納されたエラートレースをそのまま格納する。反対に、簡略化エラートレース記憶部32は、エラートレース記憶部31に格納されたエラートレースに、条件演算子による演算を含むステップが含まれていた場合、該エラートレースをエラートレース簡略化部24に提供し、エラートレース簡略化部24で簡略化された後に格納する。
The simplified error
なお、図5と図6は、図4A、図4B、及び図4Cに示すエラートレースに含まれるステップの、簡略化前と簡略化後のステップの状態を示す。ここでは、説明を簡単にするため、簡略化後に式が変化するステップ、すなわち条件演算子による演算を含むステップのみについて示している。図5は、エラートレース記憶部31に格納されている簡略化前のエラートレースに含まれるステップを示す。図6は、簡略化エラートレース記憶部32に格納された簡略化後のエラートレースに含まれるステップを示す。但し、実際には、条件演算子による演算を含むステップ以外のステップも示されている。
5 and 6 show the states of the steps included in the error trace shown in FIGS. 4A, 4B, and 4C before and after the simplification. Here, in order to simplify the explanation, only the step in which the expression changes after simplification, that is, the step including the calculation by the conditional operator is shown. FIG. 5 shows steps included in the error trace before simplification stored in the error
次に、図7を参照して、本発明のエラートレース簡略化システムの動作について詳細に説明する。 Next, the operation of the error trace simplification system of the present invention will be described in detail with reference to FIG.
(1)処理手順A1
ソースコード入力部21は、入力ソースコード1を読み込み、フラット化部22に受け渡す。フラット化部22に受け渡される入力ソースコード1の例については、図2に示す通りである。ここでは、ソースコード入力部21は、入力装置や通信用インタフェース等を介して、入力ソースコード1を取得する。なお、ソースコード入力部21は、外部のコンピュータから入力ソースコード1を受け取っても良い。或いは、ソースコード入力部21は、外部の記憶装置や記憶媒体(メディア)から入力ソースコード1を読み出しても良い。
(1) Processing procedure A1
The source
(2)処理手順A2
次に、フラット化部22は、入力ソースコード1をフラット化し、ソースコード検証部23に受け渡す。例えば、フラット化部22は、ソースコード入力部21から、図2に示す入力ソースコード1を受け取ると、フラット化し、結果として図3に示す形のフラット化されたソースコード(フラット化コード)を作成し、ソースコード検証部23に受け渡す。
(2) Processing procedure A2
Next, the flattening
(3)処理手順A3
次に、ソースコード検証部23は、フラット化されたソースコード(フラット化コード)を検証する。
(3) Processing procedure A3
Next, the source
(4)処理手順A4
ソースコード検証部23は、フラット化されたソースコード(フラット化コード)の検証において、エラートレースが得られたかどうか判断する。ソースコード検証部23は、フラット化されたソースコード(フラット化コード)の検証の結果、エラートレースが得られた場合には、エラートレース記憶部31に格納する。例えば、ソースコード検証部23は、図3に示すフラット化されたソースコード(フラット化コード)を検証した場合には、図4A、図4B、及び図4Cに示すエラートレースが得られるので、この内容(図4A、図4B、及び図4Cに示すエラートレース)をエラートレース記憶部31に格納する。なお、フラット化されたソースコード(フラット化コード)の検証においては、エラーが検出されない場合にはエラートレースは得られない。ソースコード検証部23は、エラートレースが得られなかった場合には、処理を終了する。
(4) Processing procedure A4
The source
(5)処理手順A5
次に、エラートレース簡略化部24は、得られたエラートレースを簡略化する。例えば、エラートレース簡略化部24は、エラートレース記憶部31に格納されたエラートレースを読み出し、読み出されたエラートレースを簡略化し、簡略化エラートレース記憶部32に格納する。なお、エラートレース簡略化部24は、ソースコード検証部23から直接、得られたエラートレースを受け取るようにしても良い。エラートレース簡略化の詳細については後述する。
(5) Processing procedure A5
Next, the error
(6)処理手順A6
次に、結果出力部25は、簡略化エラートレース記憶部32に格納されたエラートレースを簡略化エラートレース4として出力する。なお、結果出力部25は、エラートレース簡略化部24から直接、簡略化されたエラートレースを受け取り、簡略化エラートレース4として出力するようにしても良い。
(6) Processing procedure A6
Next, the
得られた簡略化エラートレース4は、図7の処理手順A5(エラートレース簡略化)の処理により条件演算子による演算を含まないものとなっているため、本システムのユーザは、条件演算子による演算を解釈することなく、少ない労力でエラートレースを参照できる。
Since the obtained
次に、図8を参照して、エラートレース簡略化(図7の処理手順A5)について詳細に説明する。 Next, error trace simplification (processing procedure A5 in FIG. 7) will be described in detail with reference to FIG.
(1)処理手順B1
エラートレース簡略化部24は、エラートレースの簡略化の処理において、エラートレース記憶部31に格納されたエラートレースに含まれる全てのステップについて、図8の処理手順B2から処理手順B6までの処理を繰り返し、簡略化エラートレース記憶部32に転記する。図4A、図4B、及び図4Cに示すエラートレースの例では、ステップ番号1から55まで、1ステップずつ繰り返すことになる。ここでは、エラートレース簡略化部24は、エラートレース記憶部31に格納されたエラートレースに、未処理のステップがあるか確認する。このとき、エラートレース簡略化部24は、ソースコード検証部23から直接、エラートレースを取得し、取得されたエラートレースに、未処理のステップがあるか確認するようにしても良い。エラートレース簡略化部24は、エラートレース簡略化部24は、エラートレースに未処理のステップが含まれている場合、エラートレース記憶部31に格納されたエラートレースに含まれる全てのステップについて、1ステップずつ読み出す。すなわち、エラートレース簡略化部24は、図4A、図4B、及び図4Cに示すエラートレースの例では、1ステップずつ、ステップ番号1から55に対応するステップの式を読み出す。
(1) Processing procedure B1
The error
(2)処理手順B2
エラートレース簡略化部24は、当該ステップ(読み出されたステップ)の式に、条件演算子による演算が含まれるか否かを判定する。すなわち、エラートレース簡略化部24は、当該ステップの式に、「条件式 ? 真の式 : 偽の式」で表される表現が含まれるか否かを判定する。
(2) Processing procedure B2
The error
(3)処理手順B3
エラートレース簡略化部24は、当該ステップの式に、条件演算子による演算が含まれる場合、条件演算子による演算の条件式部分を、当該ステップにおける変数の値により評価し、その真偽を判断する。例えば、エラートレース簡略化部24は、図4A、図4B、及び図4Cに示すエラートレースがエラートレース記憶部31に格納されているとして、ステップ番号45のステップを処理する場合、条件演算子による演算を含むため、この分岐はイエスとなり、条件演算子による演算の条件式部分を、当該ステップにおける変数の値により評価し、その真偽を判断する。
(3) Processing procedure B3
The error
(4)処理手順B4
エラートレース簡略化部24は、判断の結果が偽であれば、結果に従い、偽の式に相当する式をもって条件演算子による演算全体を置換する。これにより、当該ステップの式について、条件演算子による演算が含まれなくなる。
(4) Processing procedure B4
If the determination result is false, the error
(5)処理手順B5
エラートレース簡略化部24は、判断の結果が真であれば、結果に従い、真の式に相当する式でもって条件演算子による演算全体を置換する。これにより、当該ステップの式について、条件演算子による演算が含まれなくなる。
(5) Processing procedure B5
If the determination result is true, the error
(6)処理手順B6
エラートレース簡略化部24は、当該ステップについて、条件演算子による演算全体を置換した後の情報を、簡略化エラートレース記憶部32に格納するためのエラートレース(簡略化エラートレース4)に転記する。なお、エラートレース簡略化部24は、当該ステップの式に、条件演算子による演算が含まれない場合、当該ステップの情報をそのまま簡略化エラートレース記憶部32に格納するためのエラートレースに転記する。例えば、エラートレース簡略化部24は、図4A、図4B、及び図4Cに示すエラートレースがエラートレース記憶部31に格納されているとして、ステップ番号1のステップを処理する場合、条件演算子による演算を含まないため、当該ステップの情報をそのまま簡略化エラートレース記憶部32に格納するためのエラートレースに転記する。すなわち、エラートレース簡略化部24は、ステップの式に条件演算子による演算を含まないステップの情報を、簡略化エラートレース記憶部32に格納するためのエラートレースに転記する。
(6) Processing procedure B6
The error
(7)処理手順B7
エラートレース簡略化部24は、エラートレース記憶部31に格納されたエラートレースに含まれる全てのステップについて、未処理のステップが無くなった場合、簡略化エラートレース記憶部32に格納するためのエラートレースを、簡略化エラートレース記憶部32に格納して、処理を終了する。なお、エラートレース簡略化部24は、エラートレース記憶部31に格納されたエラートレースに含まれる全てのステップの式に、条件演算子による演算が含まれない場合、エラートレース記憶部31に格納されたエラートレースを、そのまま簡略化エラートレース記憶部32に格納するためのエラートレースとして、簡略化エラートレース記憶部32に格納して、処理を終了する。このとき、エラートレース簡略化部24は、簡略化エラートレース記憶部32に格納するためのエラートレースを、簡略化エラートレース記憶部32に格納せず、直接、結果出力部25に出力するようにしても良い。ここで、エラートレース記憶部31に格納されたエラートレースは、ソースコード検証部23から取得されたエラートレースと読み替えても良い。
(7) Processing procedure B7
The error
これにより、簡略化エラートレース記憶部32に格納されたエラートレースに転記されたステップの式は、条件式の真偽の判断がすでに完了した、簡略化された形になる。
As a result, the expression of the step transferred to the error trace stored in the simplified error
ここで、図9を参照して、図4Cのステップ番号45を例に、処理手順B2,B3,B4,B5の詳細について説明する。
Here, with reference to FIG. 9, the details of the processing procedures B2, B3, B4, and B5 will be described using the
図9の式4501は、図4Cのステップ番号45における式を転記したものである。式4501は、条件演算子による演算45011を示す。条件演算子による演算45011は、条件式45012と、真の式45013と、偽の式45014を含む。図9の式4501を見ると、条件演算子による演算45011が含まれているため、エラートレース簡略化部24は、処理手順B3を実行する。すなわち、エラートレース簡略化部24は、条件演算子45011による演算の条件式部分を、当該ステップにおける変数の値により評価し、その真偽を判断する。図4Cのステップ番号45の変数iの値を見ると「1」(「i == 1」)となっているため、エラートレース簡略化部24は、条件式45012の「i == 0」を偽であると判断する。従って、条件演算子による演算45011は、偽の式45014により置き換えられ、図9の式4502の形となる。
The
図9の式4502は、条件演算子による演算45021を示す。条件演算子による演算45021は、条件式45022と、真の式45023と、偽の式45024を含む。図9の式4502を見ると、条件演算子による演算45021が含まれているため、エラートレース簡略化部24は、再度、処理手順B3を実行する。すなわち、エラートレース簡略化部24は、条件演算子45021による演算の条件式部分を、当該ステップにおける変数の値により評価し、その真偽を判断する。図4Cのステップ番号45の変数iの値を見ると「1」(「i == 1」)となっているため、エラートレース簡略化部24は、条件式45022の「i == 1」は真であると判断する。従って、条件演算子による演算45021は、真の式45023により置き換えられ、図9の4503の形となる。
An
図9の式4503は、条件演算子による演算45031を示す。条件演算子による演算45031は、条件式45032と、真の式45033と、偽の式45034を含む。図9の式4503を見ても、条件演算子による演算45031が含まれているため、エラートレース簡略化部24は、再度、処理手順B3を実行する。すなわち、エラートレース簡略化部24は、条件演算子45031による演算の条件式部分を、当該ステップにおける変数の値により評価し、その真偽を判断する。図4Cのステップ番号45の変数jの値を見ると「0」(「j == 0」)となっているため、エラートレース簡略化部24は、条件式45032の「j == 0」は真であると判断する。従って、条件演算子による演算45031は、真の式45033により置き換えられ、図9の4504の形となる。
An
図9の式4504を見ると、条件演算子による演算は含まれていないため、エラートレース簡略化部24は、このステップに関する処理を終了する。
When the
以上のように、本発明では、コンピュータプログラムのソースコードに対して、ソースコード検証手法を適用した場合に、得られるエラートレースを参照する作業を省力化する。具体的には、エラートレースに含まれる条件演算子による演算を、エラートレースが示す変数の値を根拠にして解釈し、条件演算子が含まれない簡略化されたエラートレースをユーザに提示することにより、ユーザがエラートレースに含まれる条件演算子による演算を解釈する労力を軽減する。 As described above, according to the present invention, when the source code verification method is applied to the source code of the computer program, the work of referring to the obtained error trace is saved. Specifically, the operation by the conditional operator included in the error trace is interpreted based on the value of the variable indicated by the error trace, and a simplified error trace that does not include the conditional operator is presented to the user. Thus, the user can reduce the labor for interpreting the calculation by the conditional operator included in the error trace.
本発明のエラートレース簡略化システムは、フラット化を用いたソースコード検証手法において、エラートレースに含まれる表現を簡略化することにより、ユーザにとって分かりやすいエラートレースを出力する。 The error trace simplification system of the present invention outputs an error trace that is easy for the user to understand by simplifying the expression included in the error trace in the source code verification method using flattening.
まず、本発明のエラートレース簡略化システムは、入力ソースコードを読み込み、入力されたソースコードをフラット化して、フラット化されたソースコード(フラット化コード)にソースコード検証手法を適用し、得られたエラートレースをエラートレース記憶部に格納する。 First, the error trace simplification system of the present invention is obtained by reading an input source code, flattening the input source code, and applying a source code verification method to the flattened source code (flattened code). Stored error traces in the error trace storage unit.
次に、本発明のエラートレース簡略化システムは、エラートレース記憶部に格納されたエラートレースに含まれる全てのステップについて、条件演算子による演算を含む場合には、条件演算子による演算を含まない形式に簡略化し、簡略化エラートレース記憶部に格納する。すなわち、条件演算子は、条件式、真の式、偽の式の要素を含む。kのとき、本発明のエラートレース簡略化システムは、条件式が真であるか偽であるかを当該ステップにおける変数の値を根拠にして判定し、条件演算子によって選択された真の式、又は偽の式のみを残す。 Next, the error trace simplification system of the present invention does not include the calculation by the conditional operator when all the steps included in the error trace stored in the error trace storage unit include the calculation by the conditional operator. Simplify to format and store in simplified error trace storage. That is, the conditional operator includes elements of a conditional expression, a true expression, and a false expression. When k, the error trace simplification system of the present invention determines whether the conditional expression is true or false based on the value of the variable in the step, and the true expression selected by the conditional operator, Or leave only false expressions.
最後に、本発明のエラートレース簡略化システムは、簡略化エラートレース記憶部に格納されたエラートレースを、簡略化エラートレースとして出力する。 Finally, the error trace simplification system of the present invention outputs the error trace stored in the simplified error trace storage unit as a simplified error trace.
これにより、ユーザは条件演算子による演算を解釈することなく、簡略化されたエラートレースを参照できるので、エラートレースを参照する労力を減らすことができる。 Thereby, since the user can refer to the simplified error trace without interpreting the calculation by the conditional operator, the effort for referring to the error trace can be reduced.
以上、本発明の実施形態を詳述してきたが、実際には上記の実施形態に限られるものではなく、本発明の要旨を逸脱しない範囲の変更があっても本発明に含まれる。 As mentioned above, although embodiment of this invention was explained in full detail, actually it is not restricted to said embodiment, Even if there is a change of the range which does not deviate from the summary of this invention, it is contained in this invention.
1…入力ソースコード
2…処理装置
21…ソースコード入力部
22…フラット化部
23…ソースコード検証部
24…エラートレース簡略化部
25…結果出力部
3…記憶装置
31…エラートレース記憶部
32…簡略化エラートレース記憶部
4…簡略化エラートレース
DESCRIPTION OF
Claims (12)
前記フラット化されたソースコードを検証し、エラートレースを作成するソースコード検証部と、
前記作成されたエラートレースに含まれるステップに対し、条件演算子による演算を含む場合には、前記条件演算子による演算を含まない形式に簡略化するエラートレース簡略化部と
を具備する
エラートレース簡略化システム。 A flattening unit for flattening the input source code;
A source code verification unit that verifies the flattened source code and creates an error trace;
If the step included in the created error trace includes an operation by a conditional operator, the error trace simplification unit includes an error trace simplification unit that simplifies to a format not including the operation by the conditional operator. System.
前記条件演算子による演算は、
前記ステップにおける変数の値に基づいて、真であるか偽であるかを判定するための条件式と、
前記条件式が真の場合に選択される真の式と、
前記条件式が偽の場合に選択される偽の式と
を含む
エラートレース簡略化システム。 The error trace simplification system according to claim 1,
The operation by the conditional operator is
A conditional expression for determining whether it is true or false based on the value of the variable in the step;
A true expression selected when the conditional expression is true;
An error trace simplification system including a false expression selected when the conditional expression is false.
前記エラートレース簡略化部は、前記ステップにおける変数の値に基づいて、前記条件演算子による演算における条件式が真であるか偽であるかを判定し、判定結果に応じて、前記条件演算子による演算を、前記条件演算子による演算における真の式と偽の式とのいずれかに置き換える
エラートレース簡略化システム。 The error trace simplification system according to claim 2,
The error trace simplification unit determines whether a conditional expression in the calculation by the conditional operator is true or false based on the value of the variable in the step, and the conditional operator is determined according to a determination result. An error trace simplification system that replaces the operation by using either a true expression or a false expression in the operation by the conditional operator.
前記エラートレース簡略化部は、前記置き換えられた後の演算が前記条件演算子による演算である場合、前記置き換えられた後の演算に対し、前記ステップにおける変数の値に基づいて、前記置き換えられた後の演算における条件式が真であるか偽であるかを判定し、判定結果に応じて、前記置き換えられた後の演算を、前記置き換えられた後の演算における真の式と偽の式とのいずれかに置き換える
エラートレース簡略化システム。 An error trace simplification system according to claim 3,
The error trace simplification unit, when the replaced operation is an operation based on the conditional operator, the replaced operation based on the value of the variable in the step with respect to the replaced operation. It is determined whether a conditional expression in a subsequent operation is true or false, and the replaced operation is changed into a true expression and a false expression in the replaced operation according to a determination result. Replace with one of the error trace simplification systems.
前記フラット化されたソースコードを検証し、エラートレースを作成することと、
前記作成されたエラートレースに含まれるステップに対し、条件演算子による演算を含む場合には、前記条件演算子による演算を含まない形式に簡略化することと
を含む
エラートレース簡略化方法。 Flatten the input source code,
Verifying the flattened source code and creating an error trace;
An error trace simplification method comprising: simplifying the step included in the created error trace to a format that does not include the operation by the conditional operator when the operation by the conditional operator is included.
前記条件演算子による演算は、
前記ステップにおける変数の値に基づいて、真であるか偽であるかを判定するための条件式と、
前記条件式が真の場合に選択される真の式と、
前記条件式が偽の場合に選択される偽の式と
を含む
エラートレース簡略化方法。 An error tracing simplification method according to claim 5,
The operation by the conditional operator is
A conditional expression for determining whether it is true or false based on the value of the variable in the step;
A true expression selected when the conditional expression is true;
An error trace simplification method including a false expression selected when the conditional expression is false.
前記ステップにおける変数の値に基づいて、前記条件演算子による演算における条件式が真であるか偽であるかを判定し、判定結果に応じて、前記条件演算子による演算を、前記条件演算子による演算における真の式と偽の式とのいずれかに置き換えること
を更に含む
エラートレース簡略化方法。 The error trace simplification method according to claim 6,
Based on the value of the variable in the step, it is determined whether a conditional expression in the calculation by the conditional operator is true or false, and the calculation by the conditional operator is performed according to the determination result. A method for simplifying error tracing, further comprising replacing one of a true expression and a false expression in an operation by.
前記置き換えられた後の演算が前記条件演算子による演算である場合、前記置き換えられた後の演算に対し、前記ステップにおける変数の値に基づいて、前記置き換えられた後の演算における条件式が真であるか偽であるかを判定し、判定結果に応じて、前記置き換えられた後の演算を、前記置き換えられた後の演算における真の式と偽の式とのいずれかに置き換えること
を更に含む
エラートレース簡略化方法。 The error trace simplification method according to claim 7,
When the replaced operation is an operation based on the conditional operator, the conditional expression in the replaced operation is true based on the value of the variable in the step with respect to the replaced operation. Or replacing the operation after the replacement with either a true expression or a false expression in the operation after the replacement according to the determination result. Including error trace simplification method.
前記フラット化されたソースコードを検証し、エラートレースを作成することと、
前記作成されたエラートレースに含まれるステップに対し、条件演算子による演算を含む場合には、前記条件演算子による演算を含まない形式に簡略化することと
をコンピュータに実行させるための
プログラム。 Flatten the input source code,
Verifying the flattened source code and creating an error trace;
A program for causing a computer to execute simplification to a format that does not include an operation by a conditional operator when an operation by a conditional operator is included in the steps included in the created error trace.
前記条件演算子による演算は、
前記ステップにおける変数の値に基づいて、真であるか偽であるかを判定するための条件式と、
前記条件式が真の場合に選択される真の式と、
前記条件式が偽の場合に選択される偽の式と
を含む
プログラム。 The program according to claim 9, wherein
The operation by the conditional operator is
A conditional expression for determining whether it is true or false based on the value of the variable in the step;
A true expression selected when the conditional expression is true;
A program including a false expression selected when the conditional expression is false.
前記ステップにおける変数の値に基づいて、前記条件演算子による演算における条件式が真であるか偽であるかを判定し、判定結果に応じて、前記条件演算子による演算を、前記条件演算子による演算における真の式と偽の式とのいずれかに置き換えること
を更にコンピュータに実行させるための
プログラム。 The program according to claim 10,
Based on the value of the variable in the step, it is determined whether a conditional expression in the calculation by the conditional operator is true or false, and the calculation by the conditional operator is performed according to the determination result. A program that further causes a computer to execute replacement with either a true expression or a false expression in an operation by.
前記置き換えられた後の演算が前記条件演算子による演算である場合、前記置き換えられた後の演算に対し、前記ステップにおける変数の値に基づいて、前記置き換えられた後の演算における条件式が真であるか偽であるかを判定し、判定結果に応じて、前記置き換えられた後の演算を、前記置き換えられた後の演算における真の式と偽の式とのいずれかに置き換えること
を更にコンピュータに実行させるための
プログラム。 The program according to claim 11,
When the replaced operation is an operation based on the conditional operator, the conditional expression in the replaced operation is true based on the value of the variable in the step with respect to the replaced operation. Or replacing the operation after the replacement with either a true expression or a false expression in the operation after the replacement according to the determination result. A program that causes a computer to execute.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008265162A JP5170555B2 (en) | 2008-10-14 | 2008-10-14 | Error trace simplification system, error trace simplification method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008265162A JP5170555B2 (en) | 2008-10-14 | 2008-10-14 | Error trace simplification system, error trace simplification method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010097251A JP2010097251A (en) | 2010-04-30 |
JP5170555B2 true JP5170555B2 (en) | 2013-03-27 |
Family
ID=42258913
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008265162A Expired - Fee Related JP5170555B2 (en) | 2008-10-14 | 2008-10-14 | Error trace simplification system, error trace simplification method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5170555B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11138094B2 (en) | 2020-01-10 | 2021-10-05 | International Business Machines Corporation | Creation of minimal working examples and environments for troubleshooting code issues |
US11163592B2 (en) | 2020-01-10 | 2021-11-02 | International Business Machines Corporation | Generation of benchmarks of applications based on performance traces |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
IN2013MU03461A (en) * | 2013-10-31 | 2015-07-17 | Tata Consultancy Services Ltd | |
JP7256662B2 (en) * | 2019-03-22 | 2023-04-12 | 三菱電機インフォメーションネットワーク株式会社 | Service amount visualization system and service amount visualization program |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10333943A (en) * | 1997-05-27 | 1998-12-18 | Mitsubishi Electric Corp | Method and device for processing trace log of computer system |
-
2008
- 2008-10-14 JP JP2008265162A patent/JP5170555B2/en not_active Expired - Fee Related
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11138094B2 (en) | 2020-01-10 | 2021-10-05 | International Business Machines Corporation | Creation of minimal working examples and environments for troubleshooting code issues |
US11163592B2 (en) | 2020-01-10 | 2021-11-02 | International Business Machines Corporation | Generation of benchmarks of applications based on performance traces |
Also Published As
Publication number | Publication date |
---|---|
JP2010097251A (en) | 2010-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4148527B2 (en) | Functional test script generator | |
JP5679989B2 (en) | Debug pipeline | |
US9424008B2 (en) | API descriptions | |
US8701084B1 (en) | Preview of auto-fix changes to software code | |
JP5303795B2 (en) | Application analysis method, analysis system, and analysis program | |
US20160004579A1 (en) | Method of generating automatic code for remote procedure call | |
JP5170555B2 (en) | Error trace simplification system, error trace simplification method, and program | |
US20140282123A1 (en) | Executable guidance experiences based on implicitly generated guidance models | |
KR101826828B1 (en) | System and method for managing log data | |
JP4915362B2 (en) | Annotation automatic insertion method of static verification tool | |
JP4929121B2 (en) | Source program analysis apparatus, source program analysis method, and computer program | |
US20130111431A1 (en) | Validation of a system model including an activity diagram | |
US8332204B2 (en) | Instruction check program, instruction check apparatus, and I/O simulator | |
JP5545133B2 (en) | Static analysis processing system, method, and program | |
JP5093508B2 (en) | Loop optimization system, loop optimization method, and loop optimization program | |
JP5755861B2 (en) | Test case generation apparatus, test case generation method, and test case generation program | |
JP5686686B2 (en) | Program trace management apparatus, program trace management method and program | |
JP2005174045A (en) | Source program conversion device, source program conversion method, source program conversion program and program recording medium | |
JP2014106770A (en) | Type check device, type check method and type check program | |
JP2013080386A (en) | Information processing device and address management method | |
JP7534865B2 (en) | Test automation equipment | |
JP5365846B2 (en) | Program verification apparatus, program verification method, and verification function execution program | |
KR101225577B1 (en) | Apparatus and method for analyzing assembly language code | |
JP2007041777A (en) | Language processing method | |
JP2006277560A (en) | Software development support device, design document generation program and design document generating method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110803 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20121121 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20121206 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20121219 |
|
LAPS | Cancellation because of no payment of annual fees |