JP2022177585A - Error check program, information processing apparatus, and error check method - Google Patents

Error check program, information processing apparatus, and error check method Download PDF

Info

Publication number
JP2022177585A
JP2022177585A JP2021083952A JP2021083952A JP2022177585A JP 2022177585 A JP2022177585 A JP 2022177585A JP 2021083952 A JP2021083952 A JP 2021083952A JP 2021083952 A JP2021083952 A JP 2021083952A JP 2022177585 A JP2022177585 A JP 2022177585A
Authority
JP
Japan
Prior art keywords
error
check
source code
identifier
compared
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.)
Pending
Application number
JP2021083952A
Other languages
Japanese (ja)
Inventor
斎 齊藤
Hitoshi Saito
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2021083952A priority Critical patent/JP2022177585A/en
Publication of JP2022177585A publication Critical patent/JP2022177585A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

To reduce the time for handling errors using a check result when a source code is checked with an error check tool for source code.SOLUTION: An information processing apparatus 1 checks a source code 21 of a program for errors with a predetermined error check tool. The information processing apparatus 1 determines whether two blocks included in the source code 21 for comparison have sets in which error identifiers uniquely identifying errors and conditions of the errors match, in the same order or not, from a check result. When a determination is made that the orders of the sets are identical, the information processing apparatus 1 outputs the corresponding compared blocks and error identifiers.SELECTED DRAWING: Figure 3A

Description

本発明は、エラーチェックプログラムなどに関する。 The present invention relates to an error check program and the like.

従来から、ソースコードのエラーチェックツールを使ってソースコードがチェックされる際、開発者は、チェック結果を確認し、ソースコードを修正することがなされている。例えば、開発者は、チェック結果を目視で確認し、修正の必要なコードを修正する。 Conventionally, when source code is checked using a source code error checking tool, a developer confirms the check result and corrects the source code. For example, the developer visually confirms the check result and corrects the code that needs to be corrected.

また、ソースコードの修正支援に関し、ソースコード中の関数呼び出しの異常パターンを検出するプログラムが提供されている(例えば、特許文献1参照)。かかるプログラムでは、各関数毎に、前処理結果ファイルにおける当該関数についての関数呼出の前後から、グローバル識別子又はキーワードを抽出し、出現頻度が高いグローバル識別子又はキーワードを共通出現パターンとして設定し、共通出現パターンをその前後の文に含まない関数呼出について、警告メッセージを出力する。 In addition, regarding source code correction support, a program for detecting abnormal patterns of function calls in source code has been provided (see, for example, Patent Document 1). In such a program, for each function, the global identifier or keyword is extracted from before and after the function call for that function in the preprocessing result file, the global identifier or keyword with high appearance frequency is set as a common occurrence pattern, and common appearance Print a warning message for function calls that do not include the pattern in the surrounding statements.

特開2007-249765号公報JP 2007-249765 A

しかしながら、従来の技術では、ソースコードのエラーチェックツールを使ってソースコードがチェックされた場合に、チェック結果を用いたエラーの対処に時間がかかるという問題がある。すなわち、開発者がチェック結果を目視で確認し、修正の必要なコードを修正するので、エラーの対処に時間がかかる。 However, the conventional technology has a problem that when the source code is checked using the source code error check tool, it takes time to deal with the error using the check result. That is, the developer visually confirms the check result and corrects the code that needs to be corrected, so it takes time to deal with the error.

なお、ソースコード中の関数呼び出しの異常パターンを検出するプログラムは、関数呼出についての異常を修正支援するものに過ぎず、ソースコード全体の異常を修正支援するものではない。 It should be noted that the program for detecting an abnormal pattern of function calls in the source code only supports correction of abnormalities in function calls, and does not support correction of abnormalities in the entire source code.

本発明は、1つの側面では、ソースコードのエラーチェックツールを使ってソースコードがチェックされた場合に、チェック結果を用いたエラーの対処時間を削減することを目的とする。 An object of the present invention is, in one aspect, to reduce the error handling time using the check result when the source code is checked using the source code error check tool.

1つの態様では、エラーチェックプログラムは、プログラムのソースコードに対して所定のエラーチェックツールによりエラーをチェックし、前記ソースコードに含まれる互いのブロックについて、前記エラーを一意に識別できるエラー識別子および前記エラーが発生する条件が一致する組の順番が一致するか否かを判定し、前記組の順番が一致すると判定した場合には、一致したブロックおよびエラー識別子を出力する、処理をコンピュータに実行させる。 In one aspect, the error checking program checks the source code of the program for errors by a predetermined error checking tool, and for each block included in the source code, an error identifier capable of uniquely identifying the error and the It is determined whether or not the order of pairs matching the conditions for generating an error is matched, and if it is determined that the order of the pairs is matched, the matched block and error identifier are output, and the computer executes processing. .

1実施態様によれば、ソースコードのエラーチェックツールを使ってソースコードがチェックされた場合に、チェック結果を用いたエラーの対処時間を削減することができる。 According to one embodiment, when the source code is checked using a source code error checking tool, the error handling time using the check results can be reduced.

図1は、実施例に係る情報処理装置の機能構成の一例を示すブロック図である。FIG. 1 is a block diagram illustrating an example of a functional configuration of an information processing apparatus according to an embodiment; 図2Aは、実施例に係るチェック結果の一例を示す図(1)である。FIG. 2A is a diagram (1) illustrating an example of a check result according to the embodiment; 図2Bは、実施例に係るチェック結果の一例を示す図(2)である。FIG. 2B is a diagram (2) illustrating an example of a check result according to the embodiment; 図2Cは、実施例に係るチェック結果の一例を示す図(3)である。FIG. 2C is a diagram (3) illustrating an example of a check result according to the embodiment; 図3Aは、実施例に係る検出処理の一例を示す図(1)である。FIG. 3A is a diagram (1) illustrating an example of detection processing according to the embodiment; 図3Bは、実施例に係る検出処理の一例を示す図(2)である。FIG. 3B is a diagram (2) illustrating an example of detection processing according to the embodiment; 図4は、実施例に係る検出結果の一例を示す図である。FIG. 4 is a diagram illustrating an example of a detection result according to the embodiment; 図5は、実施例に係る検出処理のフローチャートの一例を示す図である。FIG. 5 is a diagram illustrating an example of a flowchart of detection processing according to the embodiment. 図6は、エラーチェックプログラムを実行するコンピュータの一例を示す図である。FIG. 6 is a diagram showing an example of a computer that executes an error check program.

以下に、本願の開示するエラーチェックプログラム、情報処理装置およびエラーチェック方法の実施例を図面に基づいて詳細に説明する。なお、本発明は、実施例により限定されるものではない。 Hereinafter, embodiments of an error check program, an information processing apparatus, and an error check method disclosed in the present application will be described in detail based on the drawings. In addition, this invention is not limited by an Example.

[情報処理装置の機能構成]
図1は、実施例に係る情報処理装置の機能構成の一例を示すブロック図である。実施例に係る情報処理装置1は、プログラムのソースコード21に対する問題箇所のチェック結果22から、ブロック単位で同類の問題である箇所を自動的に検出し、他方のブロックのエラー対処を不要にする。ここでいうブロック単位とは、例えば関数であったり、中括弧で区切られた略同じ行数の固まりであったりする。なお、実施例では、ブロックを関数として説明する。
[Functional Configuration of Information Processing Device]
FIG. 1 is a block diagram illustrating an example of a functional configuration of an information processing apparatus according to an embodiment; The information processing apparatus 1 according to the embodiment automatically detects a location with a similar problem in block units from the check result 22 of the problem location in the source code 21 of the program, and eliminates the need for error handling in the other block. . Here, the block unit may be, for example, a function or a group of approximately the same number of lines delimited by curly braces. In addition, in the embodiment, the block will be described as a function.

情報処理装置1は、制御部10と、記憶部20とを有する。制御部10は、情報処理装置1全体を司る処理部であり、チェック実行部11、検出部12および出力部13を有する。記憶部20は、ソースコード21、チェック結果22および検出結果23を有する。なお、チェック実行部11は、チェック部の一例である。検出部12は、判定部の一例である。出力部13は、出力部の一例である。 The information processing device 1 has a control unit 10 and a storage unit 20 . The control unit 10 is a processing unit that controls the entire information processing apparatus 1 and has a check execution unit 11 , a detection unit 12 and an output unit 13 . Storage unit 20 has source code 21 , check result 22 and detection result 23 . Note that the check execution unit 11 is an example of a check unit. The detection unit 12 is an example of a determination unit. The output unit 13 is an example of an output unit.

ソースコード21は、チェック対象のソースプログラムのプログラムコードを示す。すなわち、ソースコード21は、開発者によってコーディングされたプログラムコードである。 Source code 21 indicates the program code of the source program to be checked. That is, the source code 21 is program code coded by the developer.

チェック結果22は、ソースコード21に対してエラーチェックツールによってチェックされた結果を示す。チェック結果22には、問題箇所に対して問題(エラー)を一意に識別できるエラー識別子およびエラーが発生する条件が記述される。ここでいうエラーチェックツールとは、ソースコードの静的解析ツールを意味し、例えば、Agile+Relief(登録商標)、QAC(登録商標)やKlocwork(登録商標)等が挙げられる。ここでいうエラーが発生する条件とは、当該エラーに到った条件を示すものである。かかるエラーが発生する条件は、例えば、エラーチェックツールの中でエラーを探索する際に用いられる静的解析を利用して生成されれば良く、エラーチェックツールの中で生成されても良いし、エラーチェックツールの後の後述するチェック実行部11の中で生成されても良い。なお、チェック結果22は、後述するチェック実行部11によって出力される。 A check result 22 indicates the result of checking the source code 21 by the error check tool. The check result 22 describes an error identifier that can uniquely identify the problem (error) for the problem location and the conditions under which the error occurs. The error check tool here means a source code static analysis tool, and examples thereof include Agile+Relief (registered trademark), QAC (registered trademark), and Klocwork (registered trademark). The condition under which an error occurs here indicates the condition leading to the error. The conditions under which such errors occur may be generated using, for example, static analysis used when searching for errors in an error checking tool, may be generated in the error checking tool, It may be generated in the later-described check execution unit 11 after the error check tool. Note that the check result 22 is output by the check execution unit 11, which will be described later.

検出結果23は、チェック結果22から同類のブロックを検出した結果を示す。なお、検出結果23は、後述する検出部12によって出力される。 A detection result 23 indicates a result of detecting similar blocks from the check result 22 . Note that the detection result 23 is output by the detection unit 12, which will be described later.

チェック実行部11は、プログラムのソースコード21に対して所定のエラーチェックツールを実行する。そして、チェック実行部11は、チェック結果22を出力する。ここで、チェック結果22の一例を、図2A~図2Cを参照して説明する。 The check execution unit 11 executes a predetermined error check tool on the source code 21 of the program. The check execution unit 11 then outputs the check result 22 . An example of the check result 22 will now be described with reference to FIGS. 2A to 2C.

図2A~図2Cは、実施例に係るチェック結果の一例を示す図である。図2Aは、ソースコード21に含まれる関数であるfuncAのチェック結果22である。図2Bは、ソースコード21に含まれる関数であるfuncBのチェック結果22である。図2Cは、ソースコード21に含まれる関数であるfuncCのチェック結果22である。なお、関数であるfuncA、funcBおよびfuncCは、ブロックの一例である。 2A to 2C are diagrams showing examples of check results according to the embodiment. 2A shows a check result 22 of funcA, which is a function included in source code 21. FIG. FIG. 2B is a check result 22 of funcB, which is a function included in the source code 21. FIG. FIG. 2C is a check result 22 of funcC, which is a function included in the source code 21. FIG. The functions funcA, funcB and funcC are examples of blocks.

図2Aに示すように、符号a1で示す問題箇所には、「save==1;」というコードが記述されている。このコードに対して、エラー識別子およびエラーが発生する条件が対応付けられている。エラー識別子として「pgr0038」が記述されている。「pgr0038」が示すエラーの内容は、「==が間違いの可能性あり」である。すなわち、コードに含まれる「==」に間違いの可能性が指摘されている。そして、条件として「return戻り値=NO、実引数の並び=NO」が記述されている。すなわち、かかる条件は、コードに含まれる変数(ここでは、「save」)がreturnの戻り値でなく、funcAの実引数の並びにないことを示している。 As shown in FIG. 2A, a code "save==1;" is described at the problem location indicated by symbol a1. This code is associated with an error identifier and an error condition. "pgr0038" is described as an error identifier. The content of the error indicated by "pgr0038" is "== may be wrong". That is, it is pointed out that there is a possibility of a mistake in "==" included in the code. Then, "return return value=NO, sequence of actual arguments=NO" is described as a condition. That is, this condition indicates that the variable (here, "save") included in the code is not the return value of return and is not in the line of actual arguments of funcA.

また、符号a2で示す問題箇所には、「muinf=save:」というコードが記述されている。このコードに対して、エラー識別子およびエラーが発生する条件が対応付けられている。エラー識別子として「pgr0000」が記述されている。「pgr0000」が示すエラーの内容は、「save参照の前に値設定がない可能性あり」である。すなわち、コードに含まれる「save」を参照する前に「save」に値を設定するコードがない可能性が指摘されている。そして、条件として「値設定ルートあり=YES」が記述されている。すなわち、かかる条件は、funcAのいずれかの行で、コードに含まれる変数(ここでは、「save」)に値が設定されるルートがあることを示している。 Also, a code "muinf=save:" is described at the problem location indicated by symbol a2. This code is associated with an error identifier and an error condition. "pgr0000" is described as an error identifier. The content of the error indicated by "pgr0000" is "there may be no value setting before the save reference". That is, it is pointed out that there may be no code that sets a value to "save" before referring to "save" included in the code. As a condition, "value setting route exists=YES" is described. That is, this condition indicates that any line of funcA has a route in which a value is set to a variable (here, "save") included in the code.

また、符号a3で示す問題箇所には、「return0:」というコードが記述されている。このコードに対して、エラー識別子およびエラーが発生する条件が対応付けられている。エラー識別子として「pgr0524」が記述されている。「pgr0524」が示すエラーの内容は、「獲得した資源が未開放の可能性あり」である。すなわち、いずれかの行で獲得した資源が解放されていない可能性が指摘されている。そして、条件として「関数=malloc,資源解放ルートあり=YES」が記述されている。すなわち、かかる条件は、malloc関数によって資源が獲得された後のいずれかの行で、資源を解放するルートがあることを示している。 In addition, a code "return0:" is written at the problematic portion indicated by reference a3. This code is associated with an error identifier and an error condition. "pgr0524" is described as an error identifier. The content of the error indicated by "pgr0524" is "the acquired resource may not be released". In other words, it points out the possibility that the resource acquired by one of the lines has not been released. Then, "function=malloc, resource release route exists=YES" is described as a condition. That is, such a condition indicates that at some line after the resource is acquired by the malloc function, there is a route to release the resource.

図2Bに示すように、符号b1で示す問題箇所には、「res==chknum();」というコードが記述されている。このコードに対して、エラー識別子およびエラーが発生する条件が対応付けられている。エラー識別子として「pgr0038」が記述されている。「pgr0038」が示すエラーの内容は、「==が間違いの可能性あり」である。すなわち、コードに含まれる「==」に間違いの可能性が指摘されている。そして、条件として「return戻り値=Yes、実引数の並び=NO」が記述されている。すなわち、かかる条件は、コードに含まれる変数(ここでは、「res」)がreturnの戻り値であり、funcBの実引数の並びにないことを示している。 As shown in FIG. 2B, a code "res==chknum( );" is written in the problematic portion indicated by symbol b1. This code is associated with an error identifier and an error condition. "pgr0038" is described as an error identifier. The content of the error indicated by "pgr0038" is "== may be wrong". That is, it is pointed out that there is a possibility of a mistake in "==" included in the code. Then, "return return value=Yes, array of actual arguments=NO" is described as a condition. That is, this condition indicates that the variable (here, "res") included in the code is the return value of return and is not in the line of actual arguments of funcB.

また、符号b2で示す問題箇所には、「res=save:」というコードが記述されている。このコードに対して、エラー識別子およびエラーが発生する条件が対応付けられている。エラー識別子として「pgr0000」が記述されている。「pgr0000」が示すエラーの内容は、「save参照の前に値設定がない可能性あり」である。すなわち、コードに含まれる「save」を参照する前に「save」に値を設定するコードがない可能性が指摘されている。そして、条件として「値設定ルートあり=NO」が記述されている。すなわち、かかる条件は、funcBのいずれかの行で、コードに含まれる変数(ここでは、「save」)に値が設定されるルートがないことを示している。 In addition, a code "res=save:" is written at the problematic portion indicated by symbol b2. This code is associated with an error identifier and an error condition. "pgr0000" is described as an error identifier. The content of the error indicated by "pgr0000" is "there may be no value setting before the save reference". That is, it is pointed out that there may be no code that sets a value to "save" before referring to "save" included in the code. As a condition, "value setting route exists=NO" is described. That is, this condition indicates that there is no route in any line of funcB where a value is set to a variable (here, "save") included in the code.

また、符号b3で示す問題箇所には、「}」という中括弧の最後を示すコードが記述されている。このコードに対して、エラー識別子およびエラーが発生する条件が対応付けられている。エラー識別子として「pgr0524」が記述されている。「pgr0524」が示すエラーの内容は、「獲得した資源が未開放の可能性あり」である。すなわち、いずれかの行で獲得した資源が解放されていない可能性が指摘されている。そして、条件として「関数=malloc,資源解放ルートあり=NO」が記述されている。すなわち、かかる条件は、malloc関数によって資源が獲得された後のいずれかの行で、資源を解放するルートがないことを示している。 In addition, a code "}" indicating the end of the curly bracket is described at the problematic portion indicated by symbol b3. This code is associated with an error identifier and an error condition. "pgr0524" is described as an error identifier. The content of the error indicated by "pgr0524" is "the acquired resource may not be released". In other words, it points out the possibility that the resource acquired by one of the lines has not been released. As a condition, "function=malloc, resource release route present=NO" is described. That is, such a condition indicates that there is no route to release the resource on any line after the resource is acquired by the malloc function.

図2Cに示すように、符号c1で示す問題箇所には、「save==1;」というコードが記述されている。このコードに対して、エラー識別子およびエラーが発生する条件が対応付けられている。エラー識別子として「pgr0038」が記述されている。「pgr0038」が示すエラーの内容は、「==が間違いの可能性あり」である。すなわち、コードに含まれる「==」に間違いの可能性が指摘されている。そして、条件として「return戻り値=NO、実引数の並び=NO」が記述されている。すなわち、かかる条件は、コードに含まれる変数(ここでは、「save」)がreturnの戻り値でなく、funcCの実引数の並びにないことを示している。 As shown in FIG. 2C, a code "save==1;" is written in the problematic portion indicated by reference symbol c1. This code is associated with an error identifier and an error condition. "pgr0038" is described as an error identifier. The content of the error indicated by "pgr0038" is "== may be wrong". That is, it is pointed out that there is a possibility of a mistake in "==" included in the code. Then, "return return value=NO, sequence of actual arguments=NO" is described as a condition. That is, this condition indicates that the variable (here, "save") included in the code is not the return value of return and is not in the line of actual arguments of funcC.

また、符号c2で示す問題箇所には、「muinf=save:」というコードが記述されている。このコードに対して、エラー識別子およびエラーが発生する条件が対応付けられている。エラー識別子として「pgr0000」が記述されている。「pgr0000」が示すエラーの内容は、「save参照の前に値設定がない可能性あり」である。すなわち、コードに含まれる「save」を参照する前に「save」に値を設定するコードがない可能性が指摘されている。そして、条件として「値設定ルートあり=YES」が記述されている。すなわち、かかる条件は、funcCのいずれかの行で、コードに含まれる変数(ここでは、「save」)に値が設定されるルートがあることを示している。 In addition, a code "muinf=save:" is written at the problematic portion indicated by symbol c2. This code is associated with an error identifier and an error condition. "pgr0000" is described as an error identifier. The content of the error indicated by "pgr0000" is "there may be no value setting before the save reference". That is, it is pointed out that there may be no code that sets a value to "save" before referring to "save" included in the code. As a condition, "value setting route exists=YES" is described. That is, this condition indicates that there is a route where a value is set to a variable (here, "save") included in the code in any line of funcC.

また、符号c3で示す問題箇所には、「}」という中括弧の最後を示すコードが記述されている。このコードに対して、エラー識別子およびエラーが発生する条件が対応付けられている。エラー識別子として「pgr0524」が記述されている。「pgr0524」が示すエラーの内容は、「獲得した資源が未開放の可能性あり」である。すなわち、いずれかの行で獲得した資源が解放されていない可能性が指摘されている。そして、条件として「関数=malloc,資源解放ルートあり=YES」が記述されている。すなわち、かかる条件は、malloc関数によって資源が獲得された後のいずれかの行で、資源を解放するルートがあることを示している。 In addition, a code "}" indicating the end of the curly bracket is described at the problematic portion indicated by reference symbol c3. This code is associated with an error identifier and an error condition. "pgr0524" is described as an error identifier. The content of the error indicated by "pgr0524" is "the acquired resource may not be released". In other words, it points out the possibility that the resource acquired by one of the lines has not been released. Then, "function=malloc, resource release route exists=YES" is described as a condition. That is, such a condition indicates that at some line after the resource is acquired by the malloc function, there is a route to release the resource.

図1に戻って、検出部12は、ソースコード21に含まれる比較対象の2つのブロック(例えば関数)について、チェック結果22から、エラー識別子および条件が一致する組の順番が一致するか否かを判定する。例えば、検出部12は、ソースコード21のエラーチェックツールによって解析された解析データから関数リストを取得する。検出部12は、関数リスト内の2つの異なる関数に対するチェック結果22を順番に比較する。検出部12は、比較対象の2つの関数内のエラー箇所のエラー識別子が一致するか否かを判定する。検出部12は、エラー識別子が一致する場合には、比較対象の2つの関数内のエラー箇所の条件が一致するか否かを判定する。そして、検出部12は、エラー箇所の条件が一致する場合には、比較対象の2つの関数内のエラー箇所におけるエラー識別子および条件が一致する組の順番が一致するか否かを判定する。検出部12は、比較対象の2つの関数内のエラー箇所におけるエラー識別子および条件が一致する組の順番が一致する場合には、比較対象の2つの関数が同類の問題を持つ関数であると判断する。検出部12は、比較対象の2つの関数内のエラー箇所におけるエラー識別子または条件が違っている場合、またはエラー識別子および条件が一致していてもこれらの組の順番が一致しない場合には、比較対象の2つの関数が同類の問題を持つ関数でないと判断する。なお、検出部12は、同類の問題を持つ関数であると判断する条件として、さらに、比較対象の2つの関数内のエラー箇所の数が一致する場合を加えても良い。 Returning to FIG. 1, the detection unit 12 determines whether or not the order of pairs of matching error identifiers and matching conditions matches from the check result 22 for two blocks (for example, functions) to be compared included in the source code 21. judge. For example, the detection unit 12 acquires a function list from analysis data analyzed by an error check tool for the source code 21 . The detector 12 sequentially compares the check results 22 for two different functions in the function list. The detection unit 12 determines whether or not the error identifiers of the error locations in the two functions to be compared match. When the error identifiers match, the detection unit 12 determines whether the conditions of the error locations in the two functions to be compared match. Then, when the conditions at the error locations match, the detection unit 12 determines whether or not the order of pairs of matching error identifiers and conditions at the error locations in the two functions to be compared match. The detection unit 12 determines that the two functions to be compared have the same problem when the order of pairs of matching error identifiers and conditions in the error locations in the two functions to be compared is the same. do. If the error identifiers or conditions at the error locations in the two functions to be compared are different, or if the error identifiers and conditions match but the order of these sets does not match, the detection unit 12 performs comparison. It is determined that the two functions of interest are not functions with similar problems. In addition, the detection unit 12 may add the case where the number of error locations in the two functions to be compared match as a condition for determining that the functions have similar problems.

また、検出部12は、検出した結果を、検出結果23に格納する。 Also, the detection unit 12 stores the detection result in the detection result 23 .

出力部13は、検出結果23を出力する。例えば、出力部13は、検出結果23を画面に表示する。これにより、出力部13は、同類の問題を持つ関数を開発者に知らせることができる。この結果、開発者は、同類の問題を持つ一方の関数について、問題の原因を解析するとともに対処を実施するが、他方の関数について、問題の原因の解析を省略して対処のみを実施すれば良い。すなわち、開発者は、コーディングにおいて、他方の関数における問題の原因の解析を不要にすることで、問題の対処時間を削減できる。 The output unit 13 outputs the detection result 23. FIG. For example, the output unit 13 displays the detection result 23 on the screen. As a result, the output unit 13 can notify the developer of functions having similar problems. As a result, the developer analyzes the cause of the problem and implements countermeasures for one function with the same problem, but for the other function, if the analysis of the cause of the problem is omitted and only the countermeasures are executed. good. In other words, the developer can reduce the problem handling time by eliminating the need to analyze the cause of the problem in the other function during coding.

[検出処理の一例]
ここで、検出部12によって行われる検出処理の一例を、図3Aおよび図3Bを参照して説明する。図3Aおよび図3Bは、実施例に係る検出処理の一例を示す図である。なお、図3Aでは、図2Aで示した関数(funcA)のチェック結果22と図2Cで示した関数(funcC)のチェック結果22とを比較し、比較対象の関数が同類の問題であるか否かを判断する場合を説明する。図3Bでは、図2Aで示した関数(funcA)のチェック結果22と図2Bで示した関数(funcB)のチェック結果22とを比較し、比較対象の関数が同類の問題であるか否かを判断する場合を説明する。
[Example of detection process]
Here, an example of detection processing performed by the detection unit 12 will be described with reference to FIGS. 3A and 3B. 3A and 3B are diagrams illustrating an example of detection processing according to the embodiment. In FIG. 3A, the check result 22 of the function (funcA) shown in FIG. 2A is compared with the check result 22 of the function (funcC) shown in FIG. A case of determining whether In FIG. 3B, the check result 22 of the function (funcA) shown in FIG. 2A and the check result 22 of the function (funcB) shown in FIG. 2B are compared to determine whether the functions to be compared have similar problems. A case of judgment will be explained.

図3Aに示すように、funcAには、符号a1、符号a2、符号a3で示されるエラー箇所がこの順で存在する。funcCには、符号c1、符号c2、符号c3で示されるエラー箇所がこの順で存在する。 As shown in FIG. 3A, funcA has error locations indicated by symbols a1, a2, and a3 in this order. In funcC, error locations indicated by code c1, code c2, and code c3 exist in this order.

このような状況の下、検出部12は、比較対象の2つの関数内のエラー箇所のエラー識別子が一致するか否かを判定する。なお、関数内に複数のエラー箇所がある場合には、検出部12は、エラー箇所順にエラー識別子を比較する。funcAでのエラー箇所のエラー識別子は、pgr0038、pgr0000、pgr0524である。これに対して、funcCでのエラー箇所のエラー識別子は、pgr0038、pgr0000、pgr0524である。funcAおよびfuncCは、どちらもpgr0038、pgr0000、pgr0524のエラー識別子をこの順で持つ。したがって、検出部12は、比較対象のfuncAおよびfuncCの関数内のエラー箇所のエラー識別子が一致すると判定する。 Under such circumstances, the detection unit 12 determines whether or not the error identifiers of the error locations in the two functions to be compared match. Note that if there are multiple error locations in the function, the detection unit 12 compares the error identifiers in the order of the error locations. Error identifiers of error locations in funcA are pgr0038, pgr0000, and pgr0524. On the other hand, the error identifiers of the error locations in funcC are pgr0038, pgr0000, and pgr0524. Both funcA and funcC have error identifiers of pgr0038, pgr0000, pgr0524 in that order. Therefore, the detection unit 12 determines that the error identifiers of the error locations in the functions of funcA and funcC to be compared match.

そして、検出部12は、エラー識別子が一致する場合には、比較対象の2つの関数内のエラー箇所の条件が一致するか否かを判定する。なお、関数内に複数のエラー箇所がある場合には、検出部12は、エラー箇所順に条件を比較する。funcAでのエラー箇所の条件は、「return戻り値=NO,実引数の並び=NO」、「値設定ルートあり=YES」、「関数=malloc、資源解放ルートあり=YES」である。funcCでのエラー箇所の条件は、「return戻り値=NO,実引数の並び=NO」、「値設定ルートあり=YES」、「関数=malloc、資源解放ルートあり=YES」である。funcAおよびfuncCは、どちらもこの順で同じ条件を持つ。したがって、検出部12は、比較対象のfuncAおよびfuncCの関数内のエラー箇所の条件が一致すると判定する。 Then, when the error identifiers match, the detection unit 12 determines whether or not the conditions of the error locations in the two functions to be compared match. Note that if there are multiple error locations in the function, the detection unit 12 compares the conditions in the order of the error locations. The conditions for the error location in funcA are "return return value=NO, actual argument list=NO", "value setting route=YES", "function=malloc, resource release route=YES". The conditions for the error location in funcC are "return return value=NO, actual argument list=NO", "value setting route=YES", "function=malloc, resource release route=YES". Both funcA and funcC have the same conditions in that order. Therefore, the detection unit 12 determines that the conditions of the error locations in the functions of funcA and funcC to be compared match.

そして、検出部12は、エラー箇所の条件が一致する場合には、比較対象の2つの関数内のエラー箇所におけるエラー識別子および条件が一致する組の順番が一致するか否かを判定する。ここでは、funcAでは、符号a1、符号a2、符号a3で示されるエラー箇所におけるエラー識別子および条件の組がこの順で存在する。funcCでは、符号c1、符号c2、符号c3で示されるエラー箇所におけるエラー識別子および条件の組がこの順で存在する。そして、符号a1で示されるエラー箇所におけるエラー識別子および条件と符号c1で示されるエラー箇所におけるエラー識別子および条件は、一致している。符号a2で示されるエラー箇所におけるエラー識別子および条件と符号c2で示されるエラー箇所におけるエラー識別子および条件は、一致している。符号a3で示されるエラー箇所におけるエラー識別子および条件と符号c3で示されるエラー箇所におけるエラー識別子および条件は、一致している。したがって、検出部12は、比較対象のfuncAおよびfuncCの関数内のエラー箇所におけるエラー識別子および条件が一致する組の順番が一致すると判定する。 Then, when the conditions at the error locations match, the detection unit 12 determines whether or not the order of pairs of matching error identifiers and conditions at the error locations in the two functions to be compared match. Here, in funcA, there are pairs of error identifiers and conditions at error locations indicated by symbols a1, a2, and a3 in this order. In funcC, there are pairs of error identifiers and conditions at error locations indicated by symbols c1, c2, and c3 in this order. The error identifier and condition at the error location indicated by symbol a1 and the error identifier and condition at the error location indicated by symbol c1 match. The error identifier and condition at the error location indicated by symbol a2 and the error identifier and condition at the error location indicated by symbol c2 match. The error identifier and condition at the error location indicated by symbol a3 and the error identifier and condition at the error location indicated by symbol c3 match. Therefore, the detection unit 12 determines that the order of pairs of matching error identifiers and matching conditions at error locations in the functions of funcA and funcC to be compared matches.

そして、検出部12は、比較対象の2つの関数内のエラー箇所におけるエラー識別子および条件が一致する組の順番が一致する場合には、比較対象の2つの関数が同類の問題を持つ関数であると判断する。ここでは、比較対象のfuncAおよびfuncCの関数内のエラー箇所におけるエラー識別子および条件が一致する組の順番が一致するので、検出部12は、比較対象のfuncAおよびfuncCの関数は同類の問題を持つ関数であると判断する。 Then, if the order of the sets of matching error identifiers and conditions in the error locations in the two functions to be compared match, the detection unit 12 determines that the two functions to be compared are functions having similar problems. I judge. In this case, the order of pairs matching the error identifiers and conditions at the error locations in the functions of funcA and funcC to be compared is the same, so the detection unit 12 detects that the functions of funcA and funcC to be compared have similar problems. Judge it as a function.

そして、検出部12は、比較対象のfuncAおよびfuncCの関数が同類の問題を持つ関数であることを示す結果を、検出結果23に格納する。 Then, the detection unit 12 stores in the detection result 23 a result indicating that the functions of funcA and funcC to be compared have similar problems.

図3Bに示すように、funcAには、符号a1、符号a2、符号a3で示されるエラー箇所がこの順で存在する。funcBには、符号b1、符号b2、符号b3で示されるエラー箇所がこの順で存在する。 As shown in FIG. 3B, funcA has error locations denoted by a1, a2, and a3 in this order. In funcB, there are error locations indicated by symbols b1, b2, and b3 in this order.

このような状況の下、検出部12は、比較対象の2つの関数内のエラー箇所のエラー識別子が一致するか否かを判定する。なお、関数内に複数のエラー箇所がある場合には、検出部12は、エラー箇所順にエラー識別子を比較する。funcAでのエラー箇所のエラー識別子は、pgr0038、pgr0000、pgr0524である。これに対して、funcBでのエラー箇所のエラー識別子は、pgr0038、pgr0000、pgr0524である。funcAおよびfuncBは、どちらもpgr0038、pgr0000、pgr0524のエラー識別子をこの順で持つ。したがって、検出部12は、比較対象のfuncAおよびfuncBの関数内のエラー箇所のエラー識別子が一致すると判定する。 Under such circumstances, the detection unit 12 determines whether or not the error identifiers of the error locations in the two functions to be compared match. Note that if there are multiple error locations in the function, the detection unit 12 compares the error identifiers in the order of the error locations. Error identifiers of error locations in funcA are pgr0038, pgr0000, and pgr0524. On the other hand, the error identifiers of the error locations in funcB are pgr0038, pgr0000, and pgr0524. Both funcA and funcB have error identifiers of pgr0038, pgr0000, pgr0524 in that order. Therefore, the detection unit 12 determines that the error identifiers of the error locations in the functions of funcA and funcB to be compared match.

そして、検出部12は、エラー識別子が一致する場合には、比較対象の2つの関数内のエラー箇所の条件が一致するか否かを判定する。なお、関数内に複数のエラー箇所がある場合には、検出部12は、エラー箇所順に条件を比較する。funcAでのエラー箇所の条件は、「return戻り値=NO,実引数の並び=NO」、「値設定ルートあり=YES」、「関数=malloc、資源解放ルートあり=YES」である。funcBでのエラー箇所の条件は、「return戻り値=YES,実引数の並び=NO」、「値設定ルートあり=NO」、「関数=malloc、資源解放ルートあり=NO」である。funcAおよびfuncBは、異なる条件を持つ。したがって、検出部12は、比較対象のfuncAおよびfuncBの関数内のエラー箇所の条件が一致しないと判定する。 Then, when the error identifiers match, the detection unit 12 determines whether or not the conditions of the error locations in the two functions to be compared match. Note that if there are multiple error locations in the function, the detection unit 12 compares the conditions in the order of the error locations. The conditions for the error location in funcA are "return return value=NO, actual argument list=NO", "value setting route=YES", "function=malloc, resource release route=YES". The conditions for the error location in funcB are "return return value=YES, actual argument list=NO", "value setting route=NO", "function=malloc, resource release route=NO". funcA and funcB have different conditions. Therefore, the detection unit 12 determines that the conditions of the error locations in the functions of funcA and funcB to be compared do not match.

そして、検出部12は、エラー箇所の条件が一致しない場合には、比較対象の2つの関数が同類の問題を持つ関数でないと判断する。ここでは、比較対象のfuncAおよびfuncBの関数におけるエラー箇所の条件が一致しないので、検出部12は、比較対象のfuncAおよびfuncBの関数は同類の問題を持つ関数でないと判断する。 Then, when the conditions of the error locations do not match, the detection unit 12 determines that the two functions to be compared do not have similar problems. Here, since the conditions for the error locations in the functions funcA and funcB to be compared do not match, the detecting unit 12 determines that the functions funcA and funcB to be compared do not have similar problems.

そして、検出部12は、比較対象のfuncAおよびfuncBの関数が同類の問題を持つ関数でないことを示す結果を、検出結果23に格納する。 Then, the detection unit 12 stores in the detection result 23 a result indicating that the functions of funcA and funcB to be compared do not have similar problems.

[検出結果の一例]
図4は、実施例に係る検出結果の一例を示す図である。なお、図4に示す検出結果23は、図2Aで示した関数(funcA)、図2Bで示した関数(funcB)および図2Cで示した関数(funcC)に対する検出結果23である。
[Example of detection result]
FIG. 4 is a diagram illustrating an example of a detection result according to the embodiment; The detection result 23 shown in FIG. 4 is the detection result 23 for the function (funcA) shown in FIG. 2A, the function (funcB) shown in FIG. 2B, and the function (funcC) shown in FIG. 2C.

図4に示すように、検出結果23は、検出問題と、同類問題とを対応付けた情報である。検出問題の項目には、比較対象の一方の関数を識別する識別子と、当該関数内で検出された問題のエラー識別子とが設定される。同類問題の項目には、同類の問題を持つ関数であると判断された他方の関数を識別する識別子と、当該関数内で検出された問題のエラー識別子とが設定される。 As shown in FIG. 4, the detection result 23 is information in which the detected problem and the similar problem are associated with each other. In the detected problem item, an identifier for identifying one function to be compared and an error identifier of a problem detected in the function are set. In the similar problem item, an identifier for identifying the other function determined to have a similar problem and an error identifier for the problem detected in the function are set.

ここでは、1行目には、検出問題として、関数(funcA)を識別する識別子「a.c」と、エラー識別子「pgr0038」とが設定されている。同類問題として、関数(funcC)を識別する識別子「c.c」と、エラー識別子「pgr0038」とが設定されている。2行目には、検出問題として、関数(funcA)を識別する識別子「a.c」と、エラー識別子「pgr0000」とが設定されている。同類問題として、関数(funcC)を識別する識別子「c.c」と、エラー識別子「pgr0000」とが設定されている。3行目には、検出問題として、関数(funcA)を識別する識別子「a.c」と、エラー識別子「pgr0524」とが設定されている。同類問題として、関数(funcC)を識別する識別子「c.c」と、エラー識別子「pgr0524」とが設定されている。すなわち、1行目から3行目には、例えば、図3Aで示した検出処理の検出結果が表わされている。 Here, in the first line, an identifier "a.c" for identifying the function (funcA) and an error identifier "pgr0038" are set as detection problems. As similar problems, an identifier "c.c" for identifying the function (funcC) and an error identifier "pgr0038" are set. In the second line, an identifier "a.c" for identifying the function (funcA) and an error identifier "pgr0000" are set as detection problems. As similar problems, an identifier "c.c" for identifying the function (funcC) and an error identifier "pgr0000" are set. In the third line, an identifier "a.c" for identifying the function (funcA) and an error identifier "pgr0524" are set as detection problems. As similar problems, an identifier "c.c" for identifying the function (funcC) and an error identifier "pgr0524" are set. That is, the first to third lines show, for example, the detection results of the detection process shown in FIG. 3A.

また、4行目には、検出問題として、関数(funcB)を識別する識別子「b.c」と、エラー識別子「pgr0038」とが設定されている。同類問題として、「同類なし」が設定されている。5行目には、検出問題として、関数(funcB)を識別する識別子「b.c」と、エラー識別子「pgr0000」とが設定されている。同類問題として、「同類なし」が設定されている。6行目には、検出問題として、関数(funcB)を識別する識別子「b.c」と、エラー識別子「pgr0524」とが設定されている。同類問題として、「同類なし」が設定されている。すなわち、4行目から6行目には、例えば、図3Bで示した検出処理の検出結果が表わされている。 In the fourth line, an identifier "bc" for identifying the function (funcB) and an error identifier "pgr0038" are set as detection problems. As a similar problem, "no similar" is set. In the fifth line, an identifier "bc" for identifying the function (funcB) and an error identifier "pgr0000" are set as detection problems. As a similar problem, "no similar" is set. In the sixth line, an identifier "bc" for identifying the function (funcB) and an error identifier "pgr0524" are set as detection problems. As a similar problem, "no similar" is set. That is, the fourth to sixth lines show, for example, the detection results of the detection process shown in FIG. 3B.

この後、出力部13は、検出結果23を出力する。出力された検出結果23を見た開発者は、a.cについて、pgr0038、pgr0000およびpgr0524のエラーの原因を解析し、対象のソースコード21のa.cの関数に対して対処を実施する。開発者は、c.cについては、pgr0038、pgr0000およびpgr0524のエラーの対処のみを実施する。かかるエラーの原因の解析は、a.cで実施済みであるからである。これにより、開発者は、コーディングにおいて、他方の関数における問題の原因の解析を不要にすることで、問題の対処時間を削減できる。なお、開発者は、b.cについては、同類の問題を持つ関数がないので、pgr0038、pgr0000およびpgr0524のエラーの原因を解析し、対象のソースコード21のb.cの関数に対して対処を実施する。 After that, the output unit 13 outputs the detection result 23 . The developer who saw the output detection result 23 a. For c, analyze the cause of the error of pgr0038, pgr0000 and pgr0524, and a. Take action on the function in c. Developer c. For c, only the pgr0038, pgr0000 and pgr0524 errors are handled. Analysis of the cause of such errors includes: a. This is because it has already been implemented in c. This allows the developer to reduce the problem handling time by eliminating the need to analyze the cause of the problem in the other function during coding. In addition, the developer b. As for c, there is no function with similar problems, so the cause of the error in pgr0038, pgr0000 and pgr0524 is analyzed, and b. Take action on the function in c.

[検出処理のフローチャート]
図5は、実施例に係る検出処理のフローチャートの一例を示す図である。なお、検出処理は、同類の問題を持つ関数であると判断する条件として、さらに、比較対象の2つの関数内のエラー箇所の数が一致する場合を含むとする。
[Flowchart of detection processing]
FIG. 5 is a diagram illustrating an example of a flowchart of detection processing according to the embodiment. In the detection process, a condition for judging that functions have similar problems is that the number of error locations in the two functions to be compared is the same.

まず、チェック実行部11が、対象のプログラムのソースコード21に対して、エラーチェックツールを実行し、チェック結果22を出力する。すると、検出部12は、エラーチェックツールの解析データから、関数リストを取得する(ステップS11)。そして、検出部12は、関数リスト内の関数を順番に比較する(ステップS12)。 First, the check execution unit 11 executes an error check tool on the source code 21 of the target program and outputs the check result 22 . Then, the detection unit 12 acquires a function list from the analysis data of the error check tool (step S11). Then, the detection unit 12 sequentially compares the functions in the function list (step S12).

検出部12は、比較対象の関数内の問題箇所数が一致するか否かを判定する(ステップS13)。比較対象の関数内の問題箇所数が一致しないと判定した場合には(ステップS13;No)、検出部12は、比較対象の関数が同類問題でないと判断し、ステップS17に移行する。 The detection unit 12 determines whether or not the numbers of problem locations in the functions to be compared match (step S13). When it is determined that the numbers of problem locations in the functions to be compared do not match (step S13; No), the detection unit 12 determines that the functions to be compared are not similar problems, and proceeds to step S17.

一方、比較対象の関数内の問題箇所数が一致すると判定した場合には(ステップS13;Yes)、検出部12は、比較対象の関数内の問題箇所の問題ID(エラー識別子)が一致するか否かを判定する(ステップS14)。ここで、検出部12は、比較対象のそれぞれの関数内に複数の問題IDがある場合には、関数内の問題箇所順に、問題IDが一致するか否かを判定すれば良い。比較対象の関数内の問題箇所の問題IDが一致しないと判定した場合には(ステップS14;No)、検出部12は、比較対象の関数が同類問題でないと判断し、ステップS17に移行する。 On the other hand, if it is determined that the numbers of problem locations in the functions to be compared match (Step S13; Yes), the detection unit 12 determines whether the problem IDs (error identifiers) of the problem locations in the functions to be compared match. It is determined whether or not (step S14). Here, when there are a plurality of problem IDs in each function to be compared, the detection unit 12 may determine whether or not the problem IDs match in the order of the problem locations in the function. If it is determined that the problem IDs of the problem locations in the comparison target function do not match (step S14; No), the detection unit 12 determines that the comparison target function is not a similar problem, and proceeds to step S17.

一方、比較対象の関数内の問題箇所の問題IDが一致すると判定した場合には(ステップS14;Yes)、検出部12は、比較対象の関数内の問題箇所の検出条件が一致するか否かを判定する(ステップS15)。ここで、検出部12は、比較対象のそれぞれの関数内に複数の問題IDがある場合には、関数内の問題箇所順に、検出条件が一致するか否かを判定すれば良い。比較対象の関数内の問題箇所の検出条件が一致しないと判定した場合には(ステップS15;No)、検出部12は、比較対象の関数が同類問題でないと判断し、ステップS17に移行する。 On the other hand, if it is determined that the problem IDs of the problem location in the comparison target function match (step S14; Yes), the detection unit 12 determines whether the detection conditions of the problem location in the comparison target function match. is determined (step S15). Here, if there are a plurality of problem IDs in each function to be compared, the detection unit 12 may determine whether or not the detection conditions match in the order of the problem locations in the function. If it is determined that the detection conditions for the problem location in the comparison target function do not match (step S15; No), the detection unit 12 determines that the comparison target function is not a similar problem, and proceeds to step S17.

一方、比較対象の関数内の問題箇所の検出条件が一致すると判定した場合には(ステップS15;Yes)、検出部12は、比較対象の関数が同類問題を持つ関数と判断し、検出結果23に記録する(ステップS16)。そして、検出部12は、ステップS18に移行する。 On the other hand, if it is determined that the detection conditions for the problem location in the function to be compared match (Step S15; Yes), the detection unit 12 determines that the function to be compared is a function having similar problems, and the detection result 23 (step S16). And the detection part 12 transfers to step S18.

ステップS17において、検出部12は、比較対象の関数が同類問題を持たない関数と判断し、検出結果23に記録する(ステップS17)。そして、検出部12は、ステップS18に移行する。 In step S17, the detection unit 12 determines that the function to be compared is a function that does not have a similarity problem, and records it in the detection result 23 (step S17). And the detection part 12 transfers to step S18.

ステップS18において、検出部12は、関数リスト内に比較する関数があるか否かを判定する(ステップS18)。関数リスト内に比較する関数があると判定した場合には(ステップS18;Yes)、検出部12は、次の比較処理を行うべく、ステップS12に移行する。一方、関数リスト内に比較する関数がないと判定した場合には(ステップS18;No)、検出部12は、検出処理を終了する。 In step S18, the detection unit 12 determines whether or not there is a function to be compared in the function list (step S18). If it is determined that there is a function to be compared in the function list (step S18; Yes), the detection unit 12 proceeds to step S12 to perform the next comparison process. On the other hand, when it is determined that there is no function to be compared in the function list (step S18; No), the detection unit 12 terminates the detection process.

[実施例の効果]
上記実施例によれば、情報処理装置1は、プログラムのソースコード21に対して所定のエラーチェックツールによりエラーをチェックする。情報処理装置1は、ソースコード21に含まれる比較対象の2つのブロックについて、チェック結果22から、エラーを一意に識別できるエラー識別子およびエラーが発生する条件が一致する組の順番が一致するか否かを判定する。そして、情報処理装置1は、組の順番が一致すると判定した場合には、一致した比較対象のブロックおよびエラー識別子を出力する。かかる構成によれば、情報処理装置1は、ソースコード21のエラーチェックツールを使ってソースコード21がチェックされた場合に、エラーの対処時間を削減することができる。すなわち、情報処理装置1は、コーディングにおいて、2つのブロックのうち2つ目のブロックのエラー解析が不要になるので、エラーの対処時間を削減することができる。
[Effect of Example]
According to the above embodiment, the information processing apparatus 1 checks the source code 21 of the program for errors using a predetermined error check tool. The information processing apparatus 1 determines whether or not the order of pairs matching the error identifier that can uniquely identify the error and the conditions for the occurrence of the error matches from the check result 22 for the two blocks to be compared included in the source code 21. determine whether When the information processing apparatus 1 determines that the order of the sets matches, it outputs the blocks to be compared that match and the error identifier. According to such a configuration, the information processing apparatus 1 can reduce the error coping time when the source code 21 is checked using the error check tool for the source code 21 . In other words, the information processing apparatus 1 does not need to perform error analysis on the second block of the two blocks in coding, so it is possible to reduce the error coping time.

また、上記実施例によれば、情報処理装置1は、さらに、エラーの数が一致するか否かを判定する。そして、情報処理装置1は、組の順番およびエラーの数が一致すると判定した場合には、一致したブロックおよびエラー識別子を出力する。かかる構成によれば、情報処理装置1は、エラーを持つ比較対象の2つのブロックが同類のエラーを持つブロックと判断できるので、2つのブロックのうち2つ目のブロックのエラー解析が不要になるので、エラーの対処時間を削減することができる。 Further, according to the above embodiment, the information processing apparatus 1 further determines whether or not the numbers of errors match. When the information processing apparatus 1 determines that the order of the sets and the number of errors match, the information processing apparatus 1 outputs the matched block and error identifier. According to such a configuration, the information processing apparatus 1 can determine that the two blocks to be compared that have errors are blocks that have similar errors, so the error analysis of the second block of the two blocks becomes unnecessary. Therefore, the error handling time can be reduced.

また、上記実施例によれば、エラーが発生する条件は、エラーチェックツールの中でエラーを探索する際に用いられる静的解析を利用して生成される。これにより、情報処理装置1は、エラーが発生する条件をエラーチェックツールの既知のロジックを用いて容易に生成することができる。 In addition, according to the above embodiment, the conditions under which an error occurs are generated using static analysis used when searching for errors in an error checking tool. Thereby, the information processing apparatus 1 can easily generate the conditions under which an error occurs using the known logic of the error check tool.

[その他]
なお、上記実施例では、検出部12は、比較対象の2つのブロック内のエラー箇所におけるエラー識別子および条件が一致する組の順番が一致する場合に、比較対象の2つのブロックが同類の問題を持つ関数であると判断すると説明した。しかしながら、検出部12は、これに限定されず、比較対象の2つのブロック内のエラー箇所におけるエラー識別子および条件が一致する組が重複する場合に、比較対象の2つのブロックが同類の問題を持つ関数であると判断しても良い。コーディングの内容によっては、開発者毎にそれぞれコードの記述の順序が異なる場合があるからである。
[others]
In the above-described embodiment, the detecting unit 12 detects that the two blocks to be compared have the same problem when the order of pairs of matching error identifiers and conditions in the error locations in the two blocks to be compared is the same. It was explained that it is judged to be a function with However, the detection unit 12 is not limited to this, and when pairs of matching error identifiers and conditions at error locations in two blocks to be compared overlap, the two blocks to be compared have similar problems. You can judge that it is a function. This is because the code description order may vary from developer to developer depending on the content of the coding.

また、上記実施例では、図示した情報処理装置1の各構成要素は、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、情報処理装置1の分散・統合の具体的態様は図示のものに限られず、その全部または一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的または物理的に分散・統合して構成することができる。例えば、チェック実行部11を、エラーチェックツールを実行する実行部と、エラーが発生する条件を生成する生成部とに分散しても良い。また、検出部12を、検出部12と出力部13とを1つの部として統合しても良い。また、記憶部20を情報処理装置1の外部装置としてネットワーク経由で接続するようにしても良い。 Further, in the above embodiment, each component of the illustrated information processing apparatus 1 does not necessarily have to be physically configured as illustrated. That is, the specific aspects of the distribution and integration of the information processing device 1 are not limited to those shown in the drawings, and all or part of them can be functionally or physically implemented in arbitrary units according to various loads and usage conditions. It can be distributed and integrated. For example, the check execution unit 11 may be divided into an execution unit that executes an error check tool and a generation unit that generates conditions for error occurrence. Alternatively, the detection unit 12 and the output unit 13 may be integrated as one unit. Alternatively, the storage unit 20 may be connected to the information processing apparatus 1 as an external device via a network.

また、上記実施例で説明した各種の処理は、予め用意されたプログラムをパーソナルコンピュータやワークステーションなどのコンピュータで実行することによって実現することができる。そこで、以下では、図1に示した情報処理装置1と同様の機能を実現する書き換えプログラムを実行するコンピュータの一例を説明する。図6は、エラーチェックプログラムを実行するコンピュータの一例を示す図である。 Moreover, various processes described in the above embodiments can be realized by executing a prepared program on a computer such as a personal computer or a work station. Therefore, an example of a computer that executes a rewriting program that implements the same functions as those of the information processing apparatus 1 shown in FIG. 1 will be described below. FIG. 6 is a diagram showing an example of a computer that executes an error check program.

図6に示すように、コンピュータ200は、各種演算処理を実行するCPU203と、ユーザからのデータの入力を受け付ける入力装置215と、表示装置209とを有する。また、コンピュータ200は、記憶媒体からプログラムなどを読取るドライブ装置213と、ネットワークを介して他のコンピュータとの間でデータの授受を行う通信I/F(Interface)217とを有する。また、コンピュータ200は、各種情報を一時記憶するメモリ201と、HDD(Hard Disk Drive)205を有する。そして、メモリ201、CPU203、HDD205、表示装置209、ドライブ装置213、入力装置215、通信I/F217は、バス219で接続されている。 As shown in FIG. 6, the computer 200 has a CPU 203 that executes various arithmetic processes, an input device 215 that receives data input from the user, and a display device 209 . The computer 200 also has a drive device 213 that reads programs and the like from a storage medium, and a communication I/F (Interface) 217 that exchanges data with other computers via a network. The computer 200 also has a memory 201 that temporarily stores various information and a HDD (Hard Disk Drive) 205 . The memory 201 , CPU 203 , HDD 205 , display device 209 , drive device 213 , input device 215 and communication I/F 217 are connected via a bus 219 .

ドライブ装置213は、例えばリムーバブルディスク211用の装置である。HDD205は、エラーチェックプログラム205aおよびエラーチェック処理関連情報205bを記憶する。通信I/F217は、ネットワークと装置内部とのインターフェースを司り、他のコンピュータからのデータの入出力を制御する。通信I/F217には、例えば、モデムやLANアダプタなどを採用することができる。 The drive device 213 is a device for the removable disk 211, for example. The HDD 205 stores an error check program 205a and error check processing related information 205b. A communication I/F 217 serves as an interface between the network and the inside of the apparatus, and controls input/output of data from other computers. For the communication I/F 217, for example, a modem, a LAN adapter, or the like can be adopted.

表示装置209は、カーソル、アイコンあるいはツールボックスをはじめ、文書、画像、機能情報などのデータを表示する表示装置である。表示装置209は、例えば、液晶ディスプレイや有機EL(Electroluminescence)ディスプレイなどを採用することができる。 A display device 209 is a display device that displays data such as a cursor, an icon, a toolbox, documents, images, and functional information. The display device 209 can employ, for example, a liquid crystal display or an organic EL (Electroluminescence) display.

CPU203は、エラーチェックプログラム205aを読み出して、メモリ201に展開し、プロセスとして実行する。かかるプロセスは情報処理装置1の各機能部に対応する。エラーチェック処理関連情報205bは、ソースコード21、チェック結果22および検出結果23などに対応する。そして、例えばリムーバブルディスク211が、エラーチェックプログラム205aなどの各情報を記憶する。 The CPU 203 reads the error check program 205a, develops it in the memory 201, and executes it as a process. Such a process corresponds to each functional unit of the information processing apparatus 1 . The error check processing related information 205b corresponds to the source code 21, the check result 22, the detection result 23, and the like. For example, the removable disk 211 stores each information such as the error check program 205a.

なお、エラーチェックプログラム205aについては、必ずしも最初からHDD205に記憶させておかなくても良い。例えば、コンピュータ200に挿入されるフレキシブルディスク(FD)、CD-ROM、DVDディスク、光磁気ディスク、ICカードなどの「可搬用の物理媒体」に当該プログラムを記憶させておく。そして、コンピュータ200がこれらからエラーチェックプログラム205aを読み出して実行するようにしても良い。 Note that the error check program 205a does not necessarily have to be stored in the HDD 205 from the beginning. For example, the program is stored in a “portable physical medium” such as a flexible disk (FD), CD-ROM, DVD disk, magneto-optical disk, IC card, etc. inserted into the computer 200 . Then, the computer 200 may read and execute the error check program 205a from these.

1 情報処理装置
10 制御部
11 チェック実行部
12 検出部
13 出力部
20 記憶部
21 ソースコード
22 チェック結果
23 検出結果
1 information processing device 10 control unit 11 check execution unit 12 detection unit 13 output unit 20 storage unit 21 source code 22 check result 23 detection result

Claims (6)

プログラムのソースコードに対して所定のエラーチェックツールによりエラーをチェックし、
前記ソースコードに含まれる比較対象の2つのブロックについて、チェック結果から、前記エラーを一意に識別できるエラー識別子および前記エラーが発生する条件が一致する組の順番が一致するか否かを判定し、
前記組の順番が一致すると判定した場合には、一致した比較対象のブロックおよびエラー識別子を出力する
処理をコンピュータに実行させることを特徴とするエラーチェックプログラム。
Check the source code of the program for errors with a predetermined error checking tool,
For two blocks to be compared included in the source code, it is determined from the check result whether the order of pairs matching the error identifier that can uniquely identify the error and the condition that the error occurs is matched,
An error check program for causing a computer to execute a process of outputting a matched block to be compared and an error identifier when it is determined that the sets match in order.
該判定する処理は、さらに、前記エラーの数が一致するか否かを判定し、
該出力する処理は、前記組の順番および前記エラーの数が一致すると判定した場合には、一致したブロックおよびエラー識別子を出力する
ことを特徴とする請求項1に記載のエラーチェックプログラム。
The determining process further determines whether or not the numbers of errors match,
2. The error check program according to claim 1, wherein the output processing outputs a matching block and an error identifier when it is determined that the order of the sets and the number of errors match.
前記エラーが発生する条件は、前記エラーチェックツールの中で前記エラーを探索する際に用いられる静的解析を利用して生成される
ことを特徴とする請求項1に記載のエラーチェックプログラム。
2. The error check program according to claim 1, wherein the conditions under which the error occurs are generated using static analysis used when searching for the error in the error check tool.
前記ブロックは、前記ソースコードに含まれる関数である
ことを特徴とする請求項1に記載のエラーチェックプログラム。
2. The error check program according to claim 1, wherein said block is a function included in said source code.
プログラムのソースコードに対して所定のエラーチェックツールによりエラーをチェックするチェック部と、
前記ソースコードに含まれる比較対象の2つのブロックについて、チェック結果から、前記エラーを一意に識別できるエラー識別子および前記エラーが発生する条件が一致する組の順番が一致するか否かを判定する判定部と、
前記組の順番が一致すると判定した場合には、一致した比較対象のブロックおよびエラー識別子を出力する出力部と、
を有することを特徴とする情報処理装置。
a checking unit for checking an error with a predetermined error checking tool for the source code of the program;
Judgment for determining whether or not the order of pairs matching the error identifier that can uniquely identify the error and the condition that the error occurs matches from the check result for the two blocks to be compared included in the source code. Department and
an output unit for outputting a matched block to be compared and an error identifier when it is determined that the order of the sets matches;
An information processing device comprising:
プログラムのソースコードに対して所定のエラーチェックツールによりエラーをチェックし、
前記ソースコードに含まれる比較対象の2つのブロックについて、チェック結果から、前記エラーを一意に識別できるエラー識別子および前記エラーが発生する条件が一致する組の順番が一致するか否かを判定し、
前記組の順番が一致すると判定した場合には、一致した比較対象のブロックおよびエラー識別子を出力する
処理をコンピュータが実行することを特徴とするエラーチェック方法。
Check the source code of the program for errors with a predetermined error checking tool,
For two blocks to be compared included in the source code, it is determined from the check result whether the order of pairs matching the error identifier that can uniquely identify the error and the condition that the error occurs is matched,
An error checking method, wherein when it is determined that the sets match in order, the computer executes a process of outputting a matched block to be compared and an error identifier.
JP2021083952A 2021-05-18 2021-05-18 Error check program, information processing apparatus, and error check method Pending JP2022177585A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021083952A JP2022177585A (en) 2021-05-18 2021-05-18 Error check program, information processing apparatus, and error check method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021083952A JP2022177585A (en) 2021-05-18 2021-05-18 Error check program, information processing apparatus, and error check method

Publications (1)

Publication Number Publication Date
JP2022177585A true JP2022177585A (en) 2022-12-01

Family

ID=84237616

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021083952A Pending JP2022177585A (en) 2021-05-18 2021-05-18 Error check program, information processing apparatus, and error check method

Country Status (1)

Country Link
JP (1) JP2022177585A (en)

Similar Documents

Publication Publication Date Title
US10019240B2 (en) Method and apparatus for detecting code change
US8370816B2 (en) Device, method and computer program product for evaluating a debugger script
US7739553B2 (en) System crash analysis using path tracing technologies
US20120047579A1 (en) Information device, program, method for preventing execution of unauthorized program code, and computer readable recording medium
JP5125938B2 (en) Bug detection support program, similar syntax identification information list output program, bug detection support device, and bug detection support method
US8904360B2 (en) Automated identification of redundant method calls
JP4915362B2 (en) Annotation automatic insertion method of static verification tool
JP6567212B2 (en) Equivalence verification device and equivalence verification program
KR20190020363A (en) Method and apparatus for analyzing program by associating dynamic analysis with static analysis
JP2022177585A (en) Error check program, information processing apparatus, and error check method
JP5188421B2 (en) Source code analysis method and source code analysis support system
US7533314B2 (en) Unit test extender
JP2016057715A (en) Graphic type program analyzer
JP6665576B2 (en) Support device, support method, and program
CN109241742B (en) Malicious program identification method and electronic device
CN114168489B (en) Function information acquisition method, computing device and storage medium
JP5365846B2 (en) Program verification apparatus, program verification method, and verification function execution program
JP5343840B2 (en) Program analysis apparatus and analysis method
JP5464673B2 (en) Compilation support device, compilation support method, and program
JP6945434B2 (en) Software development equipment, software development methods and software development programs
JP2024013784A (en) Source code correction support apparatus and source code correction support method
JP2022136477A (en) Test control program, information processing device and test control method
JP6724673B2 (en) Test support program, test support method, and test support device
CN117742787A (en) Instruction data conflict diagnosis method, electronic equipment and storage medium
CN115756936A (en) Kernel instruction adapting method and device, computer equipment and storage medium