JP2016128941A - Output determination device, output determination method, output determination program, and static analysis device - Google Patents

Output determination device, output determination method, output determination program, and static analysis device Download PDF

Info

Publication number
JP2016128941A
JP2016128941A JP2015002765A JP2015002765A JP2016128941A JP 2016128941 A JP2016128941 A JP 2016128941A JP 2015002765 A JP2015002765 A JP 2015002765A JP 2015002765 A JP2015002765 A JP 2015002765A JP 2016128941 A JP2016128941 A JP 2016128941A
Authority
JP
Japan
Prior art keywords
function
source program
variable
extracted
output
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
JP2015002765A
Other languages
Japanese (ja)
Inventor
宏昭 金子
Hiroaki Kaneko
宏昭 金子
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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2015002765A priority Critical patent/JP2016128941A/en
Publication of JP2016128941A publication Critical patent/JP2016128941A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To extract information that is very likely to be faulty from the information outputted relating to a source program by a static analysis program.SOLUTION: An output determination device 101 has: a process extraction unit 102 for specifying a first function including instruction statements in a source program and extracting a first function identifier on the basis of a flow extracted from the source program by static analysis means and instruction statements extracted from the flow; a function extraction unit 103 for specifying, in the source program, a second function that calls the first function and extracting a second function identifier, as well as specifying a third function called by the first function and extracting a third function identifier; and an output determination unit 104 for determining whether each of the first, second, and third function identifiers extracted from the first and second source programs matches, and determining that when all are found matching, a second flow extracted in the second source program by the static analysis means be not outputted, and when one of them is found not matching, the second flow be outputted.SELECTED DRAWING: Figure 1

Description

本発明は、たとえば、静的解析プログラムに従い出力される情報から適切な情報を選択する出力判定装置等に関する。   The present invention relates to an output determination device that selects appropriate information from information output according to a static analysis program, for example.

静的解析プログラムは、コンピュータソフトウェア(以降、「ソフトウェア」と表す)に関して、オブジェクトプログラムを実行することなく、ソースプログラムを解析することにより、該ソフトウェアに含まれる不具合等を解析する。静的解析プログラムは、ソースプログラムにおいて不具合と判定される箇所(フロー)を指摘することにより、ソフトウェアの開発を支援する情報を提供する。   The static analysis program analyzes a source program with respect to computer software (hereinafter referred to as “software”) without analyzing the object program, thereby analyzing a defect or the like included in the software. The static analysis program provides information for supporting software development by pointing out a part (flow) determined to be a defect in the source program.

しかし、静的解析プログラムは、ソースプログラムにおいて、実際には不具合ではないにもかかわらず、フローを不具合であると判定する場合もある。この場合に、開発者は、静的解析プログラムにより指摘されたフローが、実際に不具合であるのか否かを確認する必要がある。したがって、静的解析プログラムを用いてソフトウェアの開発を支援する場合には、指摘されたフローが、実際に実行される場合に不具合であるのか否かを確認するのに多くの時間を要するという問題がある。   However, the static analysis program may determine that the flow is defective even though it is not actually a defect in the source program. In this case, the developer needs to confirm whether or not the flow pointed out by the static analysis program is actually a malfunction. Therefore, when software development is supported using a static analysis program, it takes a lot of time to check whether the indicated flow is a problem when actually executed. There is.

この問題を解決する手法の一例として、あるソースプログラムに関して、静的解析プログラムが過去に不具合であると指摘されなかったフロー(「第1フロー」と表す)と、新たに不具合であると指摘されたフロー(「第2フロー」と表す)とが類似するか否かを判定する手法がある。該手法は、第1フローと、第2フローとが類似すると判定する場合に、第2フローが不具合でないと判定する。たとえば、特許文献1には、上述した時間を削減することが可能な解析装置が開示されている。   As an example of a method for solving this problem, regarding a certain source program, a flow in which a static analysis program has not been pointed out as a problem in the past (referred to as “first flow”) and a new problem have been pointed out. There is a method for determining whether or not the flow (represented as “second flow”) is similar. This method determines that the second flow is not defective when it is determined that the first flow and the second flow are similar. For example, Patent Document 1 discloses an analysis apparatus that can reduce the above-described time.

特許文献1は、静的解析プログラムを用いてソースプログラムを解析した結果に基づいて、警告文を出力する解析装置を開示する。該解析装置は、ソースプログラムを解析した結果を表すファイルを、複数バージョンに関してそれぞれ作成し、該ファイル間の差分を作成する。次に、該解析装置は、作成した差分に関連付けされた警告文を出力する。   Patent Document 1 discloses an analysis device that outputs a warning text based on a result of analyzing a source program using a static analysis program. The analysis apparatus creates a file representing the result of analyzing the source program for each of a plurality of versions, and creates a difference between the files. Next, the analysis apparatus outputs a warning text associated with the created difference.

特開2004−126866号公報JP 2004-126866 A

しかし、上述したように、静的解析プログラムは、第1フローと第2フローとの類似性に基づき不具合を判定する場合に、判定を誤る可能性がある。たとえば、静的解析プログラムは、相互に類似する2つのソースコード(クローンコード)を検証する場合に、新たに指摘した第2フローが不具合でないと判定する可能性がある。これは、クローンコードが相互に類似するので、静的解析プログラムが、第1フローと第2フローとが類似すると判定するからである。この場合に、開発者は、第2フローが実際には不具合であっても、該不具合であることを見落としてしまう。   However, as described above, the static analysis program may make a determination error when determining a defect based on the similarity between the first flow and the second flow. For example, when verifying two source codes (clone code) similar to each other, the static analysis program may determine that the newly pointed second flow is not defective. This is because the clone code is similar to each other and the static analysis program determines that the first flow and the second flow are similar. In this case, even if the second flow is actually a failure, the developer overlooks that it is a failure.

一方、静的解析プログラムが、第1フローと第2フローとが類似しているか否かを、厳密に判定すれば、第2フローが不具合であることを見落としてしまう可能性を低減することができる。しかし、この場合に、静的解析プログラムは、より多くの不具合を出力する。この結果、静的解析プログラムを用いてソフトウェアの開発を支援する場合には、フローが実際に実行される場合に、不具合であるのか否かを確認するのに多くの時間を要するという問題がある。   On the other hand, if the static analysis program strictly determines whether or not the first flow and the second flow are similar, the possibility of overlooking that the second flow is defective can be reduced. it can. However, in this case, the static analysis program outputs more defects. As a result, when software development is supported using a static analysis program, there is a problem that it takes a lot of time to check whether or not there is a problem when the flow is actually executed. .

そこで、本発明の主たる目的は、ソースプログラムに関して静的解析プログラムが出力する情報から、該ソースプログラムが実行される場合に不具合である可能性の高い情報を抽出する出力判定装置等を提供することである。   Therefore, a main object of the present invention is to provide an output determination device or the like that extracts information that is likely to be defective when the source program is executed from information that the static analysis program outputs regarding the source program. It is.

前述の目的を達成するために、本発明の一態様として、出力判定装置は
ソースプログラムを静的に解析する静的解析手段が、前記ソースプログラムから抽出したフローと、前記フローから抽出した命令文とに基づき、前記ソースプログラムにおいて前記命令文を含む第1関数を特定し、特定した前記第1関数に関して、関数を一意に識別可能な関数識別子を第1関数識別子として抽出する処理抽出手段と、
前記ソースプログラムにおいて、前記第1関数識別子が表す前記関数を呼び出す第2関数を特定し、特定した前記第2関数を表す第2関数識別子を抽出するとともに、前記ソースプログラムにおいて前記第1関数識別子が表す前記関数が呼び出す第3関数を特定し、特定した前記第3関数を表す第3関数識別子を抽出する関数抽出手段と、
第1ソースプログラムにおいて抽出された前記第1関数識別子と、第2ソースプログラムにおいて抽出された前記第1関数識別子とが一致するか否か、前記第1ソースプログラムにおいて抽出された前記第2関数識別子と、前記第2ソースプログラムにおいて抽出された前記第2関数識別子とが一致するか否か、及び、前記第1ソースプログラムにおいて抽出された前記第3関数識別子と、前記第2ソースプログラムにおいて抽出された前記第3関数識別子とが一致するか否かを判定し、(a)いずれも一致すると判定した場合に、前記静的解析手段が前記第2ソースプログラムにおいて抽出した第2フローを出力せず、(b)いずれかが一致しないと判定した場合に、前記第2フローを出力することを決定する出力決定手段
とを備える。
In order to achieve the above-described object, as one aspect of the present invention, the output determination device includes a flow extracted from the source program and a statement extracted from the flow by a static analysis unit that statically analyzes the source program. And a process extracting unit that identifies a first function including the statement in the source program, and extracts a function identifier that can uniquely identify the function as the first function identifier with respect to the identified first function;
In the source program, a second function that calls the function represented by the first function identifier is identified, a second function identifier representing the identified second function is extracted, and in the source program, the first function identifier is A function extracting means for identifying a third function called by the function to be represented and extracting a third function identifier representing the identified third function;
Whether the first function identifier extracted in the first source program matches the first function identifier extracted in the second source program, whether the second function identifier extracted in the first source program And the second function identifier extracted in the second source program, the third function identifier extracted in the first source program, and the second source program extracted in the second source program Whether or not the third function identifier matches, and (a) does not output the second flow extracted by the static analysis means in the second source program when it is determined that both match. , (B) output determining means for determining that the second flow is to be output when it is determined that either does not match.

また、本発明の他の見地として、出力判定方法は、
情報処理装置が、
ソースプログラムを静的に解析する静的解析手段が、前記ソースプログラムから抽出したフローと、前記フローから抽出した命令文とに基づき、前記ソースプログラムにおいて前記命令文を含む第1関数を特定し、特定した前記第1関数に関して、関数を一意に識別可能な関数識別子を第1関数識別子として抽出し、
前記ソースプログラムにおいて、前記第1関数識別子が表す前記関数を呼び出す第2関数を特定し、特定した前記第2関数を表す第2関数識別子を抽出するとともに、前記ソースプログラムにおいて前記第1関数識別子が表す前記関数が呼び出す第3関数を特定し、特定した前記第3関数を表す第3関数識別子を抽出し、
第1ソースプログラムにおいて抽出された前記第1関数識別子と、第2ソースプログラムにおいて抽出された前記第1関数識別子とが一致するか否か、前記第1ソースプログラムにおいて抽出された前記第2関数識別子と、前記第2ソースプログラムにおいて抽出された前記第2関数識別子とが一致するか否か、及び、前記第1ソースプログラムにおいて抽出された前記第3関数識別子と、前記第2ソースプログラムにおいて抽出された前記第3関数識別子とが一致するか否かを判定し、(a)いずれも一致すると判定した場合に、前記静的解析手段が前記第2ソースプログラムにおいて抽出した第2フローを出力せず、(b)いずれかが一致しないと判定した場合に、前記第2フローを出力することを決定する。
As another aspect of the present invention, the output determination method is:
Information processing device
Static analysis means for statically analyzing a source program specifies a first function including the instruction sentence in the source program based on the flow extracted from the source program and the instruction sentence extracted from the flow, With respect to the identified first function, a function identifier that can uniquely identify the function is extracted as a first function identifier,
In the source program, a second function that calls the function represented by the first function identifier is identified, a second function identifier representing the identified second function is extracted, and in the source program, the first function identifier is Identifying a third function called by the function to be represented, extracting a third function identifier representing the identified third function;
Whether the first function identifier extracted in the first source program matches the first function identifier extracted in the second source program, whether the second function identifier extracted in the first source program And the second function identifier extracted in the second source program, the third function identifier extracted in the first source program, and the second source program extracted in the second source program Whether or not the third function identifier matches, and (a) does not output the second flow extracted by the static analysis means in the second source program when it is determined that both match. , (B) If it is determined that either does not match, it is determined to output the second flow.

さらに、同目的は、係る出力判定プログラム、及び、そのプログラムを記録するコンピュータ読み取り可能な記録媒体によっても実現される。   Further, the same object is realized by such an output determination program and a computer-readable recording medium for recording the program.

本発明に係る出力判定装置等によれば、ソースプログラムに関して静的解析プログラムが出力する情報から、該ソースプログラムが実行される場合に不具合である可能性の高い情報を抽出することができる。   According to the output determination apparatus and the like according to the present invention, information that is highly likely to be defective when the source program is executed can be extracted from information output by the static analysis program regarding the source program.

本発明の第1の実施形態に係る出力判定装置が有する構成を示すブロック図である。It is a block diagram which shows the structure which the output determination apparatus which concerns on the 1st Embodiment of this invention has. 第1の実施形態に係る出力判定装置における処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the output determination apparatus which concerns on 1st Embodiment. 第1ソースプログラムの一例を表す図である。It is a figure showing an example of the 1st source program. 第1ソースプログラムの一例を表す図である。It is a figure showing an example of the 1st source program. 第2ソースプログラムの一例を表す図である。It is a figure showing an example of a 2nd source program. 第2ソースプログラムの一例を表す図である。It is a figure showing an example of a 2nd source program. 静的解析プログラムに従い抽出されたフローの一例を表す図である。It is a figure showing an example of the flow extracted according to the static analysis program. 本発明の第2の実施形態に係る出力判定装置が有する構成を示すブロック図である。It is a block diagram which shows the structure which the output determination apparatus which concerns on the 2nd Embodiment of this invention has. 第2の実施形態に係る出力判定装置における処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the output determination apparatus which concerns on 2nd Embodiment. 本発明の第3の実施形態に係る出力判定装置が有する構成を示すブロック図である。It is a block diagram which shows the structure which the output determination apparatus which concerns on the 3rd Embodiment of this invention has. 第3の実施形態に係る出力判定装置における処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the output determination apparatus which concerns on 3rd Embodiment. 本発明の第4の実施形態に係る出力判定装置が有する構成を示すブロック図である。It is a block diagram which shows the structure which the output determination apparatus which concerns on the 4th Embodiment of this invention has. 第4の実施形態に係る出力判定装置における処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the output determination apparatus which concerns on 4th Embodiment. 出力決定部が判定する場合に参照する基準の一例を概念的に表す図である。It is a figure which expresses an example of the standard referred when an output determination part determines. 第1ソースプログラムに基づくコールグラフ情報の一例を概念的に表す図である。It is a figure which represents notionally an example of the call graph information based on a 1st source program. 第2ソースプログラムに基づくコールグラフ情報の一例を概念的に表す図である。It is a figure showing notionally an example of call graph information based on the 2nd source program. 差分情報の一例を概念的に表す図である。It is a figure which represents an example of difference information notionally. 本発明の第5の実施形態に係る出力判定装置が有する構成を示すブロック図である。It is a block diagram which shows the structure which the output determination apparatus which concerns on the 5th Embodiment of this invention has. 第5の実施形態に係る出力判定装置における処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the output determination apparatus which concerns on 5th Embodiment. 第2ソースプログラムの一例を表す図である。It is a figure showing an example of a 2nd source program. 本発明の第6の実施形態に係る出力判定装置が有する構成を示すブロック図である。It is a block diagram which shows the structure which the output determination apparatus which concerns on the 6th Embodiment of this invention has. 第6の実施形態に係る出力判定装置における処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the output determination apparatus which concerns on 6th Embodiment. 第2ソースプログラムの一例を表す図である。It is a figure showing an example of a 2nd source program. 本発明の第7の実施形態に係る出力判定装置が有する構成を示すブロック図である。It is a block diagram which shows the structure which the output determination apparatus which concerns on the 7th Embodiment of this invention has. 第7の実施形態に係る出力判定装置における処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a process in the output determination apparatus which concerns on 7th Embodiment. 本発明の各実施形態に係る出力判定装置を実現可能な計算処理装置のハードウェア構成例を、概略的に示すブロック図である。It is a block diagram which shows roughly the hardware structural example of the calculation processing apparatus which can implement | achieve the output determination apparatus which concerns on each embodiment of this invention.

本発明の理解を容易にするために、以降の説明において用いる用語や前提等について説明する。   In order to facilitate understanding of the present invention, terms and assumptions used in the following description will be described.

静的解析プログラムに従い処理を実行する静的解析部は、たとえば、ソースプログラムを受信し、受信したソースプログラムに内在するバグ、または、セキュリティに関する脆弱性等に関連するフロー(ソースプログラムの一部)及び命令文を算出する。静的解析部が算出するフロー及び命令文は、複数であってもよい。   A static analysis unit that executes processing according to a static analysis program receives, for example, a source program, and a flow related to bugs inherent in the received source program or security vulnerabilities (part of the source program) And calculate a statement. There may be a plurality of flows and statements calculated by the static analysis unit.

フロー判定部は、改変される前のソースプログラムに関して静的解析プログラムが算出するフロー及び命令文と、改変された後のソースプログラムに関して該静的解析プログラムが算出するフロー及び命令文とを比較する。該フロー判定部は、たとえば、改変前後のフロー及び命令文が一致すると判定する場合に、該フローを出力しないことを決定する。一方、該フロー判定部は、たとえば、改変前後のフロー及び命令文が一致しないと判定する場合に、該フローを出力することを決定する。静的解析プログラムが算出するフロー及び命令文が複数である場合に、フロー判定部は、各フロー及び命令文に関して上述した処理を実行する。   The flow determination unit compares the flow and the instruction sentence calculated by the static analysis program with respect to the source program before the modification and the flow and the instruction sentence calculated by the static analysis program with respect to the source program after the modification. . The flow determination unit determines not to output the flow, for example, when it is determined that the flow before and after the modification and the statement match. On the other hand, the flow determination unit determines to output the flow, for example, when it is determined that the flow before and after the modification and the command statement do not match. When there are a plurality of flows and command statements calculated by the static analysis program, the flow determination unit executes the processing described above for each flow and command statement.

尚、ソースプログラムがバージョンを用いて管理されている場合に、改変される前のソースプログラムと、改変された後のソースプログラムとは、2つのバージョンを用いて特定されるソースプログラムであってもよい。また、静的解析プログラムが算出するフローは、たとえば、バグ等に関連すると推定された命令文から、算出した命令文に至る命令文列を表す。   When the source program is managed using versions, the source program before being modified and the source program after being modified are source programs specified using two versions. Good. Further, the flow calculated by the static analysis program represents, for example, an instruction sentence string from an instruction sentence estimated to be related to a bug or the like to the calculated instruction sentence.

以降の各実施形態に示す出力判定装置は、たとえば、上述したようなフロー判定部がフローを出力するか否かを判定するのを支援することができる。   The output determination apparatus shown in each of the following embodiments can assist, for example, in determining whether or not a flow determination unit as described above outputs a flow.

次に、本発明を実施する実施形態について図面を参照しながら詳細に説明する。   Next, embodiments for carrying out the present invention will be described in detail with reference to the drawings.

<第1の実施形態>
本発明の第1の実施形態に係る出力判定装置101が有する構成について、図1を参照しながら詳細に説明する。図1は、本発明の第1の実施形態に係る出力判定装置101が有する構成を示すブロック図である。
<First Embodiment>
The configuration of the output determination apparatus 101 according to the first embodiment of the present invention will be described in detail with reference to FIG. FIG. 1 is a block diagram illustrating a configuration of the output determination apparatus 101 according to the first embodiment of the present invention.

第1の実施形態に係る出力判定装置101は、処理抽出部102と、関数抽出部103と、出力決定部104とを有する。   The output determination apparatus 101 according to the first embodiment includes a process extraction unit 102, a function extraction unit 103, and an output determination unit 104.

出力判定装置101は、たとえば、第1ソースプログラム301と、静的解析プログラムに従い第1ソースプログラム301において抽出されたフロー303と、静的解析プログラムに従いフロー303において抽出された命令文305とを受信する。同様に、出力判定装置101は、たとえば、第2ソースプログラム302と、静的解析プログラムに従い第2ソースプログラム302において抽出されたフロー304と、静的解析プログラムに従いフロー304において抽出された命令文306とを受信する。   The output determination apparatus 101 receives, for example, the first source program 301, the flow 303 extracted in the first source program 301 according to the static analysis program, and the imperative sentence 305 extracted in the flow 303 according to the static analysis program. To do. Similarly, the output determination apparatus 101 includes, for example, the second source program 302, the flow 304 extracted in the second source program 302 according to the static analysis program, and the command statement 306 extracted in the flow 304 according to the static analysis program. And receive.

たとえば、第1ソースプログラム301は、図3A及び図3Bに例示するようなプログラミング言語に従い記述されたソースプログラムである。図3A及び図3Bは、C言語に従い記述された第1ソースプログラム301の一例を表す図である。たとえば、第2ソースプログラム302は、図4A及び図4Bに例示するようなプログラミング言語に従い記述されたソースプログラムである。図4A及び図4Bは、C言語に従い記述された第2ソースプログラム302の一例を表す図である。第1ソースプログラム301及び第2ソースプログラム302は、たとえば、上述したような改変前後のソースプログラムである。   For example, the first source program 301 is a source program written according to a programming language as exemplified in FIGS. 3A and 3B. 3A and 3B are diagrams illustrating an example of the first source program 301 described according to the C language. For example, the second source program 302 is a source program written according to a programming language as exemplified in FIGS. 4A and 4B. 4A and 4B are diagrams illustrating an example of the second source program 302 described according to the C language. The first source program 301 and the second source program 302 are source programs before and after modification as described above, for example.

この場合に、たとえば、改変前のソースプログラム(すなわち、第1ソースプログラム301)に関して、静的解析プログラムは、フロー303及び命令文305を算出する。また、改変後のソースプログラム(すなわち、第2ソースプログラム302)に関して、静的解析プログラムは、フロー304及び命令文306を算出する。   In this case, for example, with respect to the source program before modification (that is, the first source program 301), the static analysis program calculates the flow 303 and the command statement 305. Further, regarding the modified source program (that is, the second source program 302), the static analysis program calculates a flow 304 and a command statement 306.

図3A、または、図4Aに例示するソースプログラムにおいて、命令文「#define ERROR 0」は、「ERROR」に0を設定する命令文を表す。また、「int_main()」のうち、「main()」は、main関数を表し、「int」は、該main関数の出力である戻り値が「int」型(たとえば、整数を表す型)であることを表す。「rv=funcB(X)」は、関数funcBを、入出力する変数を表す引数Xにて呼び出し、その後、関数funcBの戻り値を変数rvに設定する設定命令文を表す。この場合、funcBの呼び出し元関数は、「main」である。   In the source program illustrated in FIG. 3A or FIG. 4A, the statement “#define ERROR 0” represents a statement that sets “ERROR” to 0. In “int_main ()”, “main ()” represents a main function, and “int” represents a return value that is an output of the main function in an “int” type (for example, a type representing an integer). Represents something. “Rv = funcB (X)” represents a setting command statement that calls the function funcB with an argument X representing a variable to be input / output, and then sets the return value of the function funcB to the variable rv. In this case, the caller function of funcB is “main”.

また、図3A、または、図4Aに例示するソースプログラムにおいて、「command」は、処理を関数の外部に移さない命令文(または、命令文列)を表す。また、「return v」は、関数funcBの戻り値を設定するとともに、処理を終了する命令文を表す。   In the source program illustrated in FIG. 3A or FIG. 4A, “command” represents an instruction sentence (or instruction sentence string) that does not transfer processing to the outside of the function. Further, “return v” represents a command statement that sets the return value of the function funcB and ends the processing.

図3B、または、図4Bに例示するソースプログラムにおいて、「if (U==NULL)」は、制御命令文を表し、変数Uの値が空値(NULL)である場合に、直後の{}にて囲まれた命令文列を実行することを表す。また、該制御命令文は、変数Uの値が空値(NULL)でない場合に、「else」直後の{}にて囲まれた命令文列を実行することを表す。   In the source program illustrated in FIG. 3B or FIG. 4B, “if (U == NULL)” represents a control command statement, and when the value of the variable U is a null value (NULL), {} Indicates that the command statement sequence enclosed by is executed. The control command statement indicates that a command statement sequence enclosed in {} immediately after “else” is executed when the value of the variable U is not a null value (NULL).

たとえば、静的解析プログラムに従い、第1ソースプログラム301、または、第2ソースプログラム302において、図5に例示されるフロー(すなわち、フロー303、または、フロー304)が抽出されているとする。図5は、静的解析プログラムに従い抽出されたフローの一例を表す図である。また、静的解析プログラムに従い、該フローの内、「printf(“%s”,X)」が、命令文(すなわち、命令文305、または、命令文306)として抽出されているとする。すなわち、この例においては、静的解析プログラムに従い第1ソースプログラム301において抽出されたフロー303は、第2ソースプログラム302において抽出されたフロー304と同じであるとする。同様に、静的解析プログラムに従い第1ソースプログラム301において抽出された命令文305は、第2ソースプログラム302において抽出された命令文306と同じであるとする。   For example, it is assumed that the flow illustrated in FIG. 5 (that is, the flow 303 or the flow 304) is extracted in the first source program 301 or the second source program 302 according to the static analysis program. FIG. 5 is a diagram illustrating an example of a flow extracted according to the static analysis program. Further, it is assumed that “printf (“% s ”, X)” is extracted as a command statement (that is, command statement 305 or command statement 306) in the flow according to the static analysis program. That is, in this example, it is assumed that the flow 303 extracted in the first source program 301 according to the static analysis program is the same as the flow 304 extracted in the second source program 302. Similarly, it is assumed that the command statement 305 extracted in the first source program 301 according to the static analysis program is the same as the command statement 306 extracted in the second source program 302.

次に、第1の実施形態に係る出力判定装置101が行う処理について、図2を参照しながら詳細に説明する。図2は、第1の実施形態に係る出力判定装置101における処理の流れを示すフローチャートである。説明の便宜上、ソースプログラムは、C言語を用いて記述されているとするが、他のプログラミング言語を用いて記述されていてもよい。   Next, processing performed by the output determination apparatus 101 according to the first embodiment will be described in detail with reference to FIG. FIG. 2 is a flowchart showing a process flow in the output determination apparatus 101 according to the first embodiment. For convenience of explanation, it is assumed that the source program is described using the C language, but may be described using another programming language.

まず、処理抽出部102は、第1ソースプログラム301において、命令文305を含む関数(説明の便宜上、「第1関数」と表す)を特定する(ステップS101)。同様に、処理抽出部102は、第2ソースプログラム302において、命令文306を含む関数を特定する(ステップS101)。   First, the process extraction unit 102 specifies a function including the command statement 305 (represented as “first function” for convenience of description) in the first source program 301 (step S101). Similarly, the process extraction unit 102 specifies a function including the command statement 306 in the second source program 302 (step S101).

たとえば、図3Aに例示するソースプログラムの場合に、関数funcBが、命令文「printf(“%s”,X)」を含むので、処理抽出部102は、第1ソースプログラム301において、第1関数として、関数funcBを選ぶ。同様に、図4Aに例示するソースプログラムの場合、関数funcBは、命令文「printf(“%s”,X)」を含むので、処理抽出部102は、第2ソースプログラム302において、第1関数として、関数funcBを特定する。   For example, in the case of the source program illustrated in FIG. 3A, the function funcB includes the statement “printf (“% s ”, X)”, so that the process extraction unit 102 includes the first function in the first source program 301. The function funcB is selected. Similarly, in the case of the source program illustrated in FIG. 4A, the function funcB includes the statement “printf (“% s ”, X)”, so that the process extraction unit 102 uses the first function in the second source program 302. The function funcB is specified as follows.

次に、関数抽出部103は、第1ソースプログラム301において、第1関数を呼び出す関数(説明の便宜上、「第2関数」と表す)を特定する(ステップS102)。同様に、関数抽出部103は、第2ソースプログラム302において、第1関数を呼び出す関数を特定する(ステップS102)。   Next, the function extraction unit 103 identifies a function that calls the first function (represented as “second function” for convenience of description) in the first source program 301 (step S102). Similarly, the function extraction unit 103 specifies a function that calls the first function in the second source program 302 (step S102).

たとえば、図3Aに例示するソースプログラムの場合、関数mainが命令文「rv=funcB(X)」にて、関数funcBを呼び出すので、関数抽出部103は、第1ソースプログラム301において、第2関数として関数mainを特定する。同様に、図4Aに例示するソースプログラムの場合、関数mainが命令文「rv=funcB(X)」にて、関数funcBを呼び出すので、関数抽出部103は、第2ソースプログラム302において、第2関数として関数mainを特定する。   For example, in the case of the source program illustrated in FIG. 3A, the function main calls the function funcB with the statement “rv = funcB (X)”, so that the function extraction unit 103 uses the second function in the first source program 301. The function main is specified as Similarly, in the case of the source program illustrated in FIG. 4A, the function main calls the function funcB with the statement “rv = funcB (X)”. A function main is specified as a function.

次に、関数抽出部103は、第1ソースプログラム301において、第1関数が呼び出す関数(説明の便宜上、「第3関数」と表す)を特定する(ステップS103)。同様に、関数抽出部103は、第2ソースプログラム302において、第1関数が呼び出す関数を特定する(ステップS103)。   Next, the function extraction unit 103 identifies a function that is called by the first function (represented as “third function” for convenience of description) in the first source program 301 (step S103). Similarly, the function extraction unit 103 specifies a function called by the first function in the second source program 302 (step S103).

たとえば、図3Aに例示するソースプログラムの場合、関数funcBが命令文「v=funcC(X)」にて、関数funcCを呼び出すので、関数抽出部103は、第1ソースプログラム301において、第3関数として関数funcCを特定する。同様に、図4Aに例示するソースプログラムの場合、関数mainが命令文「v=funcC(X)」にて、関数funcCを呼び出すので、関数抽出部103は、第2ソースプログラム302において、第3関数として関数funcCを特定する。   For example, in the case of the source program illustrated in FIG. 3A, the function funcB calls the function funcC with the statement “v = funcC (X)”, so that the function extraction unit 103 uses the third function in the first source program 301. The function funcC is specified as follows. Similarly, in the case of the source program illustrated in FIG. 4A, the function main calls the function funcC with the statement “v = funcC (X)”. A function funcC is specified as a function.

次に、出力決定部104は、第1ソースプログラム301において関数抽出部103が特定した関数と、第2ソースプログラム302において関数抽出部103が特定した関数とが一致するか否かを判定する(ステップS104)。出力決定部104は、たとえば、第1ソースプログラム301において特定された第1関数の名称(関数識別子)と、第2ソースプログラム302において特定された第1関数の名称(関数識別子)とが一致するか否かを判定する。尚、関数識別子は、関数を一意に識別可能な識別子を表すとする。さらに、出力決定部104は、第1ソースプログラム301において特定された第2関数の名称と、第2ソースプログラム302において特定された第2関数の名称とが一致するか否かを判定する。同様に、出力決定部104は、第1ソースプログラム301において特定された第3関数の名称と、第2ソースプログラム302において特定された第3関数の名称とが一致するか否かを判定する。   Next, the output determination unit 104 determines whether or not the function specified by the function extraction unit 103 in the first source program 301 matches the function specified by the function extraction unit 103 in the second source program 302 ( Step S104). For example, the output determination unit 104 matches the name of the first function (function identifier) specified in the first source program 301 with the name of the first function (function identifier) specified in the second source program 302. It is determined whether or not. The function identifier represents an identifier that can uniquely identify the function. Further, the output determination unit 104 determines whether or not the name of the second function specified in the first source program 301 matches the name of the second function specified in the second source program 302. Similarly, the output determination unit 104 determines whether or not the name of the third function specified in the first source program 301 matches the name of the third function specified in the second source program 302.

次に、出力決定部104は、第1ソースプログラム301において特定された関数と、第2ソースプログラム302において特定された関数とが一致すると判定する場合に(ステップS104にてYES)、出力を表すフロー307として、フロー304を出力することを決定する(ステップS106)。尚、出力決定部104は、ステップS104にてYESである場合に、フロー303を、フロー307として出力することを決定してもよい。また、出力決定部104は、第1ソースプログラム301において特定された関数と、第2ソースプログラム302において特定された関数とが一致しないと判定する場合に(ステップS104にてNO)、フロー304を出力しないことを決定する(ステップS105)。尚、上述した処理において、特定された関数は、第1関数乃至第3関数を表す。   Next, when determining that the function specified in the first source program 301 matches the function specified in the second source program 302 (YES in step S104), the output determination unit 104 represents an output. As the flow 307, it is determined to output the flow 304 (step S106). Note that the output determination unit 104 may determine to output the flow 303 as the flow 307 if YES in step S104. When the output determination unit 104 determines that the function specified in the first source program 301 and the function specified in the second source program 302 do not match (NO in step S104), the flow 304 It is determined not to output (step S105). In the above-described processing, the specified function represents the first function to the third function.

たとえば、図3A、図3B、図4A、及び、図4Bに示す例の場合に、出力決定部104は、第1ソースプログラム301において特定された第1関数funcBと、第2ソースプログラム302において特定された第1関数funcBとを比較する。この場合に、2つの該第1関数の名称は一致する。同様に、出力決定部104は、第1ソースプログラム301において特定された第2関数mainと、第2ソースプログラム302において特定された第2関数mainとを比較する。この場合に、2つの該第2関数の名称は一致する。さらに、出力決定部104は、第1ソースプログラム301において特定された第3関数funcCと、第2ソースプログラム302において特定された第3関数funcCとを比較する。この場合に、2つの該第2関数の名称は一致する。この場合に、いずれの関数も一致するので、出力決定部104は、第1ソースプログラム301において特定された関数と、第2ソースプログラム302において特定された関数とが一致すると判定する。   For example, in the example shown in FIGS. 3A, 3B, 4A, and 4B, the output determination unit 104 specifies the first function funcB specified in the first source program 301 and the second source program 302. The generated first function funcB is compared. In this case, the names of the two first functions match. Similarly, the output determination unit 104 compares the second function main specified in the first source program 301 with the second function main specified in the second source program 302. In this case, the names of the two second functions match. Further, the output determination unit 104 compares the third function funcC specified in the first source program 301 with the third function funcC specified in the second source program 302. In this case, the names of the two second functions match. In this case, since all the functions match, the output determination unit 104 determines that the function specified in the first source program 301 matches the function specified in the second source program 302.

以降、説明の便宜上、ステップS104にてYESと判定された場合に実行する処理を、「処理b」と表す。また、ステップS104にてNOと判定された場合に実行する処理を、「処理a」と表す。   Hereinafter, for convenience of explanation, the processing to be executed when YES is determined in step S104 is represented as “processing b”. In addition, the process that is executed when it is determined NO in step S104 is represented as “process a”.

たとえば、上述した例において、処理aは、フロー304を出力しないことを決定する処理を含む。また、処理bは、フロー304を出力することを決定する処理を含む。   For example, in the example described above, the process a includes a process of determining that the flow 304 is not output. Further, the process b includes a process for determining that the flow 304 is output.

次に、第1の実施形態に係る出力判定装置101に関する効果について説明する。   Next, effects related to the output determination device 101 according to the first embodiment will be described.

出力判定装置101によれば、ソースプログラムに関して静的解析プログラムが出力する情報から、該ソースプログラムが実行される場合に不具合である可能性の高い情報を抽出することができる。   According to the output determination apparatus 101, information that is likely to be a malfunction when the source program is executed can be extracted from information output by the static analysis program regarding the source program.

この理由は、本実施形態に係る出力判定装置101が、静的解析プログラムによって出力される複数のフロー(すなわち、フロー303、または、フロー304)に関して、関数呼び出しに関する処理を比較した結果に基づき、出力するか否かを判定するからである。この処理において、出力判定装置101は、命令文を含む第1関数の関数識別子と、該関数を呼び出す第2関数の関数識別子と、該関数が呼び出す第3関数の関数識別子とを、第1ソースプログラム301及び第2ソースプログラム302に関して比較する。この結果、出力判定装置101は、該関数呼び出しに関する処理を比較した結果に基づいて、フローを出力するか否かを判定する。   The reason for this is that the output determination apparatus 101 according to the present embodiment is based on a result of comparing processing related to function calls with respect to a plurality of flows output by the static analysis program (that is, the flow 303 or the flow 304). This is because it is determined whether or not to output. In this process, the output determination apparatus 101 receives the function identifier of the first function including the command statement, the function identifier of the second function that calls the function, and the function identifier of the third function that the function calls. The program 301 and the second source program 302 are compared. As a result, the output determination apparatus 101 determines whether or not to output a flow based on the result of comparing the processes related to the function call.

一方、特許文献1に開示された解析装置は、単に、静的解析プログラムが出力する結果を表すファイルを比較し、比較した結果に応じて警告文を出力する。すなわち、該解析装置は、該ファイルのみに基づき警告文を出力する。この結果、該解析装置は、本実施形態に係る出力判定装置に比べ、関数呼び出しに関する処理を比較していないので、誤った警告文を出力する可能性が高い。   On the other hand, the analysis device disclosed in Patent Document 1 simply compares files representing the results output by the static analysis program, and outputs a warning text according to the comparison results. That is, the analysis device outputs a warning text based only on the file. As a result, since the analysis device does not compare the processing related to the function call compared to the output determination device according to the present embodiment, there is a high possibility of outputting an erroneous warning text.

したがって、本実施形態に係る出力判定装置101よれば、ソースプログラムに関して静的解析プログラムが出力する情報から、該ソースプログラムが実行される場合に不具合である可能性の高い情報を抽出することができる。   Therefore, according to the output determination apparatus 101 according to the present embodiment, information that is likely to be defective when the source program is executed can be extracted from the information output by the static analysis program regarding the source program. .

尚、上述した実施形態において、出力判定装置101は、ソースプロプログラムにおいて、第1関数乃至第3関数を抽出するとした。出力判定装置101は、たとえば、後述するようなコールグラフ情報(たとえば、図13、図14)に基づいて、第1関数乃至第3関数を抽出してもよいし、ソースプログラムを解析することにより、第1関数乃至第3関数を抽出してもよい。   In the above-described embodiment, the output determination device 101 extracts the first function to the third function in the source pro program. For example, the output determination apparatus 101 may extract the first function to the third function based on call graph information (for example, FIG. 13 and FIG. 14) as will be described later, or by analyzing the source program. The first function to the third function may be extracted.

また、出力判定装置101と、上述した静的解析プログラムに従い処理を実行する静的解析部とを有する静的解析装置を構成することができる。この場合に、静的解析装置は、2つソースプログラムに基づき、上述したような処理を実行することにより、フロー及び命令文を算出する。   In addition, a static analysis device having the output determination device 101 and a static analysis unit that executes processing according to the static analysis program described above can be configured. In this case, the static analysis device calculates a flow and a statement by executing the above-described processing based on the two source programs.

<第2の実施形態>
次に、上述した第1の実施形態を基本とする本発明の第2の実施形態について説明する。
<Second Embodiment>
Next, a second embodiment of the present invention based on the first embodiment described above will be described.

以降の説明においては、本実施形態に係る特徴的な部分を中心に説明すると共に、上述した第1の実施形態と同様な構成については、同一の参照番号を付すことにより、重複する説明を省略する。   In the following description, the characteristic parts according to the present embodiment will be mainly described, and the same components as those in the first embodiment described above will be denoted by the same reference numerals, and redundant description will be omitted. To do.

図6と図7とを参照しながら、第2の実施形態に係る出力判定装置201が有する構成と、出力判定装置201が行う処理とについて説明する。図6は、本発明の第2の実施形態に係る出力判定装置201が有する構成を示すブロック図である。図7は、第2の実施形態に係る出力判定装置201における処理の流れを示すフローチャートである。   The configuration of the output determination device 201 according to the second embodiment and the processing performed by the output determination device 201 will be described with reference to FIGS. FIG. 6 is a block diagram showing the configuration of the output determination apparatus 201 according to the second embodiment of the present invention. FIG. 7 is a flowchart showing the flow of processing in the output determination device 201 according to the second embodiment.

第2の実施形態に係る出力判定装置201は、処理抽出部102と、関数抽出部103と、型抽出部202と、出力決定部203とを有する。   The output determination apparatus 201 according to the second embodiment includes a process extraction unit 102, a function extraction unit 103, a type extraction unit 202, and an output determination unit 203.

出力決定部203は、第1の実施形態に係る出力決定部104が実行する処理と同様の処理を実行した後に、第1ソースプログラム301に関して特定された関数と、第2ソースプログラム302に関して特定された関数とが一致するか否かを判定する。型抽出部202は、出力決定部203が一致しないと判定した場合に(ステップS104にてNO、図2)、以降に示す処理を開始する。   The output determination unit 203 performs the same processing as the processing performed by the output determination unit 104 according to the first embodiment, and then specifies the function specified for the first source program 301 and the second source program 302. Judge whether the function matches. When the type extraction unit 202 determines that the output determination unit 203 does not match (NO in step S104, FIG. 2), it starts the processing described below.

型抽出部202は、第1ソースプログラム301にて特定された第3関数が出力する値の型を、第1ソースプログラム301において特定する(ステップS201)。すなわち、型抽出部202は、第1ソースプログラム301において、第3関数の戻り値の型を特定する。説明の便宜上、第3関数が出力する値の型を、「第3の型」と表す。同様に、型抽出部202は、第2ソースプログラム302にて特定された第3関数が出力する値の第3の型を、第2ソースプログラム302において特定する(ステップS202)。   The type extraction unit 202 specifies the type of the value output by the third function specified by the first source program 301 in the first source program 301 (step S201). That is, the type extraction unit 202 identifies the return type of the third function in the first source program 301. For convenience of explanation, the type of the value output by the third function is represented as “third type”. Similarly, the type extraction unit 202 specifies the third type of the value output by the third function specified by the second source program 302 in the second source program 302 (step S202).

たとえば、型抽出部202は、第3関数funcCの戻り値の型を特定する場合に、まず、第1ソースプログラム301において、「unsigned int funcC(char *U)」(図3B)を特定する。次に、型抽出部202は、該第3関数funcCが出力する値の第3の型が、第1ソースプログラム301において、「unsigned int」型であることを特定する。同様に、型抽出部202は、第3関数funcCの戻り値の型を特定する場合に、第2ソースプログラム302において、「int_funcC(char *U)」(図4B)を特定する。次に、型抽出部202は、該第3関数funcCが出力する値の第3の型が、第2ソースプログラム302において、「int」型であることを特定する。   For example, when specifying the return type of the third function funcC, the type extraction unit 202 first specifies “unsigned int funcC (char * U)” (FIG. 3B) in the first source program 301. Next, the type extraction unit 202 specifies that the third type of the value output by the third function funcC is the “unsigned int” type in the first source program 301. Similarly, the type extraction unit 202 specifies “int_funcC (char * U)” (FIG. 4B) in the second source program 302 when specifying the return value type of the third function funcC. Next, the type extraction unit 202 specifies that the third type of the value output by the third function funcC is the “int” type in the second source program 302.

次に、出力決定部203は、第1ソースプログラム301において特定された第3の型と、第2ソースプログラム302において特定された第3の型とが一致するか否かを判定する(ステップS203)。出力決定部203は、該2つの型が一致すると判定する場合に(ステップS203にてYES)、フロー304を出力しないことを決定する(ステップS204)。出力決定部203は、該2つの第3の型が一致しないと判定する場合に(ステップS203にてNO)、フロー304を出力することを決定する(ステップS205)。尚、出力決定部203は、ステップS205にてYESである場合に、フロー303を出力することを決定してもよい。   Next, the output determination unit 203 determines whether or not the third type specified in the first source program 301 matches the third type specified in the second source program 302 (step S203). ). When determining that the two types match (YES in step S203), the output determining unit 203 determines not to output the flow 304 (step S204). When determining that the two third types do not match (NO in step S203), the output determining unit 203 determines to output the flow 304 (step S205). Note that the output determination unit 203 may determine to output the flow 303 if YES in step S205.

上述した例において、第1ソースプログラム301において特定された第3関数funcCに関する第3の型は、「unsigned int」型である。また、第2ソースプログラム302において特定された第3関数funcCに関する第3の型は、「int」型である。したがって、該2つの第3の型が一致しないので、出力決定部203は、ステップS203にてNOと判定する。したがって、この場合に、出力決定部203は、フロー304を出力することを決定する。   In the example described above, the third type related to the third function funcC specified in the first source program 301 is the “unsigned int” type. The third type related to the third function funcC specified in the second source program 302 is an “int” type. Accordingly, since the two third types do not match, the output determination unit 203 determines NO in step S203. Therefore, in this case, the output determination unit 203 determines to output the flow 304.

以降、説明の便宜上、ステップS203にてYESと判定された場合に実行する処理を、「処理c」と表す。また、ステップS203にてNOと判定された場合に実行する処理を、「処理d」と表す。   Hereinafter, for convenience of explanation, the process to be executed when YES is determined in step S203 is represented as “process c”. In addition, the process executed when NO is determined in step S203 is represented as “process d”.

たとえば、上述した例において、処理cは、フロー304を出力しないことを決定する処理を含む。また、処理dは、フロー304を出力することを決定する処理を含む。   For example, in the above-described example, the process c includes a process for determining that the flow 304 is not output. The process d includes a process for determining that the flow 304 is to be output.

次に、第2の実施形態に係る出力判定装置201に関する効果について説明する。   Next, effects related to the output determination device 201 according to the second embodiment will be described.

第2の実施形態に係る出力判定装置201によれば、ソースプログラムに関して静的解析プログラムが出力する情報から、該ソースプログラムが実行される場合に不具合である可能性の高い情報を抽出することができる。   According to the output determination apparatus 201 according to the second embodiment, information that is likely to be a malfunction when the source program is executed can be extracted from information output by the static analysis program regarding the source program. it can.

この理由は、本実施形態に係る出力判定装置201が、さらに、第3関数が出力する値の型に基づき、フロー304を出力するか否かを判定するからである。   This is because the output determination apparatus 201 according to the present embodiment further determines whether or not to output the flow 304 based on the type of value output by the third function.

すなわち、本実施形態に係る出力判定装置201は、関数呼び出しに関する関数識別子に加え、さらに、第3関数が出力する値の型に基づいて、フロー304を出力するか否かを判定する。この結果、出力判定装置201が、第1の実施形態に係る出力判定装置101に比べ、さらに、関数を詳細に解析するので、より適切に情報を抽出することができる。   That is, the output determination apparatus 201 according to the present embodiment determines whether or not to output the flow 304 based on the type of the value output from the third function in addition to the function identifier related to the function call. As a result, since the output determination device 201 further analyzes the function in detail compared to the output determination device 101 according to the first embodiment, information can be extracted more appropriately.

<第3の実施形態>
次に、上述した第2の実施形態を基本とする本発明の第3の実施形態について説明する。
<Third Embodiment>
Next, a third embodiment of the present invention based on the above-described second embodiment will be described.

以降の説明においては、本実施形態に係る特徴的な部分を中心に説明すると共に、上述した第2の実施形態と同様な構成については、同一の参照番号を付すことにより、重複する説明を省略する。   In the following description, the description will focus on the characteristic parts according to the present embodiment, and the same components as those in the second embodiment described above will be denoted by the same reference numerals, and redundant description will be omitted. To do.

図8と図9とを参照しながら、第3の実施形態に係る出力判定装置211が有する構成と、出力判定装置211が行う処理とについて説明する。図8は、本発明の第3の実施形態に係る出力判定装置211が有する構成を示すブロック図である。図9は、第3の実施形態に係る出力判定装置211における処理の流れを示すフローチャートである。   The configuration of the output determination device 211 according to the third embodiment and the processing performed by the output determination device 211 will be described with reference to FIGS. 8 and 9. FIG. 8 is a block diagram showing the configuration of the output determination device 211 according to the third embodiment of the present invention. FIG. 9 is a flowchart showing a flow of processing in the output determination device 211 according to the third embodiment.

第3の実施形態に係る出力判定装置211は、処理抽出部102と、関数抽出部103と、型抽出部212と、出力決定部213とを有する。   The output determination apparatus 211 according to the third embodiment includes a process extraction unit 102, a function extraction unit 103, a type extraction unit 212, and an output determination unit 213.

型抽出部212は、出力決定部203が一致すると判定した場合に(ステップS203にてYES、図7)、以降に示す処理を開始する。   If it is determined that the output determining unit 203 matches (YES in step S203, FIG. 7), the type extracting unit 212 starts the processing described below.

型抽出部212は、第1ソースプログラム301において特定された第1関数が出力する値の型、及び、第1ソースプログラム301において特定された第2関数が出力する値の型を特定する(ステップS211)。   The type extraction unit 212 specifies the type of the value output from the first function specified in the first source program 301 and the type of the value output from the second function specified in the first source program 301 (step S211).

説明の便宜上、第1関数が出力する値の型を、「第1の型」と表す。第2関数が出力する値の型を、「第2の型」と表す。すなわち、第1の型は、第1関数の戻り値に関する型を表す。第2の型は、第2関数の戻り値に関する型を表す。   For convenience of explanation, the type of the value output by the first function is represented as “first type”. The type of the value output by the second function is represented as “second type”. That is, the first type represents a type related to the return value of the first function. The second type represents a type related to the return value of the second function.

同様に、型抽出部212は、第2ソースプログラム302において特定された第1関数に関する第1の型、及び、第2ソースプログラム302において特定された第2関数に関する第2の型を特定する(ステップS212)。   Similarly, the type extraction unit 212 specifies the first type related to the first function specified in the second source program 302 and the second type related to the second function specified in the second source program 302 ( Step S212).

たとえば、型抽出部212は、第1ソースプログラム301において、第1関数funcBに関して、命令文「int funcB(char *X)」(図3A)を特定する。型抽出部212は、特定した命令文に基づき、第1関数funcBが出力する値の第1の型が、「int」型であることを特定する。同様に、型抽出部212は、第1ソースプログラム301において、第2関数mainに関して、命令文「int main()」(図3A)を特定する。次に、型抽出部212は、特定した命令文に基づき、該第2関数mainが出力する値の第2の型が、「int」型であることを特定する。   For example, in the first source program 301, the type extraction unit 212 specifies the command sentence “int funcB (char * X)” (FIG. 3A) regarding the first function funcB. The type extraction unit 212 specifies that the first type of the value output by the first function funcB is the “int” type based on the specified statement. Similarly, the type extraction unit 212 identifies the statement “int main ()” (FIG. 3A) for the second function main in the first source program 301. Next, the type extraction unit 212 specifies that the second type of the value output by the second function main is the “int” type based on the specified statement.

同様に、型抽出部212は、第2ソースプログラム302において、第1関数funcBに関して、命令文「int funcB(char *X)」(図4A)を特定する。型抽出部212は、特定した命令文に基づき、第1関数funcBが出力する値の第1の型が、「int」型であることを特定する。型抽出部212は、第2ソースプログラム302において、第2関数mainに関して、命令文「int main()」(図4A)を特定する。次に、型抽出部212は、特定した命令文に基づき、第2関数mainが出力する値の第2の型が、「int」型であることを特定する。   Similarly, the type extraction unit 212 identifies the statement “int funcB (char * X)” (FIG. 4A) for the first function funcB in the second source program 302. The type extraction unit 212 specifies that the first type of the value output by the first function funcB is the “int” type based on the specified statement. In the second source program 302, the type extracting unit 212 identifies the statement “int main ()” (FIG. 4A) regarding the second function main. Next, the type extraction unit 212 specifies that the second type of the value output by the second function main is the “int” type based on the specified statement.

次に、出力決定部213は、第1ソースプログラム301において特定された第1の型と、第2ソースプログラム302において特定された第1の型とが一致するか否かを判定する。また、出力決定部213は、第1ソースプログラム301において特定された第2の型と、第2ソースプログラム302において特定された第2の型とが一致するか否かを判定する(ステップS213)。出力決定部213は、いずれもが一致すると判定する場合に(ステップS213にてYES)、フロー304を出力しないことを決定する(ステップS214)。出力決定部213は、いずれかが一致しないと判定する場合に(ステップS213にてNO)、フロー304を出力することを決定する(ステップS215)。尚、出力決定部213は、ステップS213にてNOである場合に、フロー303を出力することを決定してもよい。   Next, the output determination unit 213 determines whether or not the first type specified in the first source program 301 matches the first type specified in the second source program 302. The output determining unit 213 determines whether the second type specified in the first source program 301 matches the second type specified in the second source program 302 (step S213). . When determining that both match (YES in step S213), the output determining unit 213 determines not to output the flow 304 (step S214). When determining that either does not match (NO in step S213), the output determining unit 213 determines to output the flow 304 (step S215). Note that the output determination unit 213 may determine to output the flow 303 when NO in step S213.

上述した例において、第3の型は、一致していない。説明の便宜上、以降に示す実施形態において、第3の型は、一致しているとする。   In the example described above, the third type does not match. For convenience of explanation, it is assumed that the third type matches in the following embodiments.

第1ソースプログラム301において特定された第1関数funcBに関する第1の型は、「int」型である。また、第2ソースプログラム302において特定された第1関数funcBに関する第1の型は、「int」型である。したがって、該2つの第1の型は一致する。また、第1ソースプログラム301において特定された第2関数mainに関する第2の型は、「int」型である。また、第2ソースプログラム302において特定された第2関数mainに関する第2の型は、「int」型である。したがって、該2つの第2の型は一致する。したがって、第1関数及び第2関数に関して、型がいずれも一致するので、出力決定部213は、ステップS213にてYESと判定する。したがって、この場合に、出力決定部213は、フロー304を出力しないことを決定する。   The first type related to the first function funcB specified in the first source program 301 is an “int” type. The first type related to the first function funcB specified in the second source program 302 is an “int” type. Thus, the two first types match. The second type related to the second function main specified in the first source program 301 is an “int” type. The second type related to the second function main specified in the second source program 302 is an “int” type. Thus, the two second types match. Accordingly, since the types of the first function and the second function match, the output determination unit 213 determines YES in step S213. Therefore, in this case, the output determination unit 213 determines not to output the flow 304.

以降、説明の便宜上、ステップS213にてYESと判定された場合に実行する処理を、「処理e」と表す。また、ステップS213にてNOと判定された場合に実行する処理を、「処理f」と表す。   Hereinafter, for convenience of explanation, the process to be executed when YES is determined in step S213 is referred to as “process e”. In addition, the process executed when NO is determined in step S213 is represented as “process f”.

たとえば、上述した例において、処理eは、フロー304を出力しないことを決定する処理を含む。また、処理fは、フロー304を出力することを決定する処理を含む。   For example, in the above-described example, the process e includes a process for determining that the flow 304 is not output. The process f includes a process for determining that the flow 304 is to be output.

次に、第3の実施形態に係る出力判定装置211に関する効果について説明する。   Next, effects related to the output determination device 211 according to the third embodiment will be described.

本実施形態に係る出力判定装置211によれば、静的解析プログラムによって出力される情報から適切な情報を選択することができる。さらに、本実施形態に係る出力判定装置211によれば、ソースプログラムに関して静的解析プログラムが出力する情報から、該ソースプログラムが実行される場合に不具合である可能性の高い情報を、一層、適切に抽出することができる。   According to the output determination device 211 according to the present embodiment, it is possible to select appropriate information from information output by the static analysis program. Furthermore, according to the output determination device 211 according to the present embodiment, information that is likely to be a malfunction when the source program is executed is more appropriate from the information output by the static analysis program regarding the source program. Can be extracted.

この理由は、理由1及び理由2である。すなわち、
(理由1)第3の実施形態に係る出力判定装置211が有する構成は、第2の実施形態に係る出力判定装置201が有する構成を含むからである、
(理由2)本実施形態に係る出力判定装置211が、さらに、関数に関する型に基づき、出力するか否かを判定するからである。
The reason is Reason 1 and Reason 2. That is,
(Reason 1) The configuration of the output determination device 211 according to the third embodiment includes the configuration of the output determination device 201 according to the second embodiment.
(Reason 2) This is because the output determination device 211 according to the present embodiment further determines whether or not to output based on the function type.

すなわち、本実施形態に係る出力判定装置211は、第1の型乃至第3の型に基づいて、それぞれ、フロー304を出力するか否かを判定する。この結果、出力判定装置211が、第2の実施形態に係る出力判定装置201に比べ、さらに、関数を詳細に解析するので、より適切に情報を抽出することができる。   That is, the output determination device 211 according to the present embodiment determines whether or not to output the flow 304 based on the first type to the third type. As a result, since the output determination device 211 further analyzes the function in more detail than the output determination device 201 according to the second embodiment, information can be extracted more appropriately.

<第4の実施形態>
次に、上述した第2の実施形態を基本とする本発明の第4の実施形態について説明する。
<Fourth Embodiment>
Next, a fourth embodiment of the present invention based on the second embodiment will be described.

以降の説明においては、本実施形態に係る特徴的な部分を中心に説明すると共に、上述した第2の実施形態と同様な構成については、同一の参照番号を付すことにより、重複する説明を省略する。   In the following description, the description will focus on the characteristic parts according to the present embodiment, and the same components as those in the second embodiment described above will be denoted by the same reference numerals, and redundant description will be omitted. To do.

図10と図11とを参照しながら、第4の実施形態に係る出力判定装置221が有する構成と、出力判定装置221が行う処理とについて説明する。図10は、本発明の第4の実施形態に係る出力判定装置221が有する構成を示すブロック図である。図11は、第4の実施形態に係る出力判定装置221における処理の流れを示すフローチャートである。   The configuration of the output determination device 221 according to the fourth embodiment and the processing performed by the output determination device 221 will be described with reference to FIGS. 10 and 11. FIG. 10 is a block diagram showing the configuration of the output determination device 221 according to the fourth embodiment of the present invention. FIG. 11 is a flowchart showing the flow of processing in the output determination device 221 according to the fourth embodiment.

第4の実施形態に係る出力判定装置221は、処理抽出部102と、関数抽出部103と、型抽出部202と、出力決定部222と、変数抽出部223とを有する。   The output determination device 221 according to the fourth embodiment includes a process extraction unit 102, a function extraction unit 103, a type extraction unit 202, an output determination unit 222, and a variable extraction unit 223.

変数抽出部223は、上述した処理c、または、処理eにおいて以降に示す処理を開始する。   The variable extraction unit 223 starts the following process in the process c or the process e described above.

変数抽出部223は、第1ソースプログラム301において特定された第1関数に関して、該第1関数に対する入出力を表す変数を特定する。すなわち、変数抽出部223は、第1関数の引数を表す変数を特定する。たとえば、変数抽出部223は、該入出力を表す変数を識別可能な変数識別子を特定する(ステップS221)。同様に、変数抽出部223は、第2ソースプログラム302において特定された第1関数に関して、該第1関数に対する入出力を表す変数の変数識別子を特定する(ステップS222)。   The variable extraction unit 223 specifies a variable representing input / output with respect to the first function with respect to the first function specified in the first source program 301. That is, the variable extraction unit 223 specifies a variable representing an argument of the first function. For example, the variable extraction unit 223 specifies a variable identifier that can identify the variable representing the input / output (step S221). Similarly, with respect to the first function specified in the second source program 302, the variable extraction unit 223 specifies a variable identifier of a variable representing input / output with respect to the first function (step S222).

たとえば、図3Aに示す例において、変数抽出部223は、第1関数funcBに関して、第1ソースプログラム301のうち、命令文「int funcB(char *X)」を特定する。次に、変数抽出部223は、特定した命令文に基づき、第1関数funcBに対する入出力を表す変数が、変数識別子Xが表す変数であることを特定する。この場合に、変数抽出部223は、さらに、変数識別子Xを表す型が「char *」型であることを特定してもよい。   For example, in the example illustrated in FIG. 3A, the variable extraction unit 223 specifies the instruction sentence “int funcB (char * X)” in the first source program 301 for the first function funcB. Next, the variable extraction unit 223 specifies that the variable representing the input / output with respect to the first function funcB is the variable represented by the variable identifier X based on the identified statement. In this case, the variable extraction unit 223 may further specify that the type representing the variable identifier X is the “char *” type.

同様に、図4Aに示す例において、変数抽出部223は、第1関数funcBに関して、第2ソースプログラム302のうち、命令文「int funcB(char *X)」を特定する。次に、変数抽出部223は、特定した命令文に基づき、第1関数funcBに対する入出力を表す変数が、変数識別子Xが表す変数であることを特定する。この場合に、変数抽出部223は、さらに、変数識別子Xを表す型が「char *」型であることを特定してもよい。   Similarly, in the example illustrated in FIG. 4A, the variable extraction unit 223 specifies an instruction sentence “int funcB (char * X)” in the second source program 302 with respect to the first function funcB. Next, the variable extraction unit 223 specifies that the variable representing the input / output with respect to the first function funcB is the variable represented by the variable identifier X based on the identified statement. In this case, the variable extraction unit 223 may further specify that the type representing the variable identifier X is the “char *” type.

尚、入出力する変数が複数ある場合に、変数抽出部223は、該変数の変数識別子をそれぞれ特定してもよい。   When there are a plurality of variables to be input / output, the variable extraction unit 223 may specify the variable identifier of each variable.

次に、出力決定部222は、第1ソースプログラム301において特定された変数識別子と、第2ソースプログラム302において特定された変数識別子とが一致するか否かを判定する(ステップS223)。出力決定部222は、変数識別子が一致すると判定する場合に(ステップS223にてYES)、フロー304を出力しないことを決定する(ステップS224)。出力決定部222は、変数識別子が一致しないと判定する場合に(ステップS223にてNO)、フロー304を出力することを決定する(ステップS225)。尚、出力決定部222は、ステップS225にてNOである場合に、フロー303を出力することを決定してもよい。   Next, the output determination unit 222 determines whether or not the variable identifier specified in the first source program 301 matches the variable identifier specified in the second source program 302 (step S223). When determining that the variable identifiers match (YES in step S223), the output determining unit 222 determines not to output the flow 304 (step S224). When determining that the variable identifiers do not match (NO in step S223), the output determining unit 222 determines to output the flow 304 (step S225). Note that the output determination unit 222 may determine to output the flow 303 when NO in step S225.

上述した例において、第1ソースプログラム301において特定された変数識別子Xと、第2ソースプログラム302において特定された変数識別子Xとは一致する。この場合に、出力決定部222は、第1関数funcBに関する変数識別子が、第1ソースプログラム301と、第2ソースプログラム302とにおいて一致すると判定する。したがって、出力決定部222は、フロー304を出力しないことを決定する。   In the example described above, the variable identifier X specified in the first source program 301 matches the variable identifier X specified in the second source program 302. In this case, the output determination unit 222 determines that the variable identifiers related to the first function funcB match between the first source program 301 and the second source program 302. Therefore, the output determination unit 222 determines not to output the flow 304.

以降、説明の便宜上、ステップS223にてYESと判定された場合に実行する処理を、「処理g」と表す。また、ステップS223にてNOと判定された場合に実行する処理を、「処理h」と表す。   Hereinafter, for convenience of explanation, the process to be executed when YES is determined in step S223 is represented as “process g”. In addition, the process executed when NO is determined in step S223 is represented as “process h”.

たとえば、上述した例において、処理gは、フロー304を出力しないことを決定する処理を含む。また、処理hは、フロー304を出力することを決定する処理を含む。   For example, in the above-described example, the process g includes a process for determining that the flow 304 is not output. Further, the process h includes a process of determining that the flow 304 is output.

尚、出力決定部222は、変数識別子が一致するか否かを判定するだけでなく、さらに、該変数識別子の型が一致する否かを判定してもよい。この場合に、出力決定部222は、変数識別子、及び、該変数識別子の型がともに一致する場合に、フロー304を出力しないことを決定する。一方、出力決定部222は、変数識別子、及び、該変数識別子の型のうち、いずれかが一致しない場合に、フロー304を出力することを決定する。   The output determination unit 222 may not only determine whether or not the variable identifiers match, but may further determine whether or not the types of the variable identifiers match. In this case, the output determination unit 222 determines not to output the flow 304 when both the variable identifier and the type of the variable identifier match. On the other hand, the output determination unit 222 determines to output the flow 304 when any of the variable identifier and the type of the variable identifier does not match.

または、出力決定部222は、図12に示すように、第1関数に対する入出力を表す変数の値を表す型、第2関数に対する入出力を表す変数の値を表す型、及び、第3関数に対する入出力を表す変数の値を表す型を参照することにより判定してもよい。図12は、出力決定部222が判定する場合に参照する基準の一例を概念的に表す図である。   Alternatively, as illustrated in FIG. 12, the output determination unit 222 includes a type representing a variable value representing input / output to the first function, a type representing a variable value representing input / output to the second function, and a third function. The determination may be made by referring to the type representing the value of the variable representing the input / output for. FIG. 12 is a diagram conceptually illustrating an example of a reference referred to when the output determination unit 222 determines.

図12を参照すると、関数と、該関数の関数識別子と、該関数が出力する値の型と、該関数の引数である変数の型と、該変数の変数識別子とが関連付けされている。図12において、「参照する」は、出力決定部222が判定する基準として参照することを表す。「参照しない」は、出力決定部222が判定する基準として参照しないことを表す。   Referring to FIG. 12, a function, a function identifier of the function, a value type output by the function, a variable type that is an argument of the function, and a variable identifier of the variable are associated with each other. In FIG. 12, “refer” indicates that the output determination unit 222 refers to as a criterion for determination. “Do not reference” indicates that the output determining unit 222 does not refer to the criterion.

すなわち、図12に例示する基準において、出力決定部222は、判定する基準として項目1乃至項目8を参照する。すなわち、
(項目1)第2関数の関数識別子、
(項目2)第1関数の関数識別子、
(項目3)第3関数の関数識別子、
(項目4)第3関数が出力する値の型、
(項目5)第2関数の引数である変数の型、
(項目6)第1関数の引数である変数の型、
(項目7)第3関数の引数である変数の型、
(項目8)第1関数の引数である変数の変数識別子。
That is, in the criteria illustrated in FIG. 12, the output determination unit 222 refers to items 1 to 8 as criteria for determination. That is,
(Item 1) Function identifier of the second function,
(Item 2) Function identifier of the first function,
(Item 3) Function identifier of the third function,
(Item 4) Type of value output by the third function,
(Item 5) The type of the variable that is the argument of the second function,
(Item 6) The type of the variable that is the argument of the first function,
(Item 7) Type of variable that is an argument of the third function,
(Item 8) A variable identifier of a variable that is an argument of the first function.

すなわち、この場合に、出力決定部222は、第1ソースプログラム301と、第2ソースプログラム302とに関して、項目1乃至項目8の観点から比較し、いずれかの項目が一致しない場合に、フロー304を出力することを決定する。また、出力決定部222は、項目1乃至項目8がいずれも一致する場合に、フロー304を出力しないことを決定する。   That is, in this case, the output determination unit 222 compares the first source program 301 and the second source program 302 from the viewpoint of items 1 to 8, and if any item does not match, the flow 304 Is determined to be output. Further, the output determination unit 222 determines not to output the flow 304 when all of the items 1 to 8 match.

次に、第4の実施形態に係る出力判定装置221に関する効果について説明する。   Next, effects related to the output determination device 221 according to the fourth embodiment will be described.

本実施形態に係る出力判定装置221によれば、ソースプログラムに関して静的解析プログラムが出力する情報から、該ソースプログラムが実行される場合に不具合である可能性の高い情報を抽出することができる。さらに、本実施形態に係る出力判定装置221によれば、より一層適切に、情報を抽出することができる。   According to the output determination device 221 according to the present embodiment, information that is likely to be defective when the source program is executed can be extracted from the information output by the static analysis program regarding the source program. Furthermore, according to the output determination device 221 according to the present embodiment, information can be extracted more appropriately.

この理由は、理由1及び理由2である。すなわち、
(理由1)第4の実施形態に係る出力判定装置221が有する構成は、第2の実施形態に係る出力判定装置201が有する構成を含むからである、
(理由2)本実施形態に係る出力判定装置221が、さらに、関数に対する入出力を表す変数の変数識別子に基づき、出力するか否かを判定するからである。
The reason is Reason 1 and Reason 2. That is,
(Reason 1) The configuration of the output determination device 221 according to the fourth embodiment includes the configuration of the output determination device 201 according to the second embodiment.
(Reason 2) This is because the output determination device 221 according to the present embodiment further determines whether or not to output based on the variable identifier of the variable representing the input / output with respect to the function.

すなわち、本実施形態に係る出力判定装置221は、関数呼び出しに関する関数識別子に加え、さらに、上述した情報に基づいて出力するか否かを判定する。この結果、出力判定装置221が、第2の実施形態に係る出力判定装置201に比べ、さらに、関数を詳細に解析するので、より適切に情報を抽出することができる。   That is, the output determination device 221 according to the present embodiment determines whether or not to output based on the above-described information in addition to the function identifier related to the function call. As a result, the output determination device 221 further analyzes the function in more detail than the output determination device 201 according to the second embodiment, so that information can be extracted more appropriately.

尚、上述した例においては、第1関数乃至第3関数の関数識別子、該第1関数乃至第3関数が出力する値の型、第1関数に対する入出力を表す変数の変数識別子、及び、該変数識別子の型等に基づき、フローを出力するか否かを判定した。たとえば、出力判定装置221は、上述したような情報を表すコールグラフ情報(図13、図14に例示)に基づいて、フローを出力するか否か判定してもよい。図13は、第1ソースプログラム301に基づくコールグラフ情報401の一例を概念的に表す図である。図14は、第2ソースプログラム302に基づくコールグラフ情報401の一例を概念的に表す図である。   In the above-described example, the function identifiers of the first function to the third function, the type of value output by the first function to the third function, the variable identifier of the variable representing the input / output to the first function, and the Whether or not to output the flow was determined based on the type of variable identifier. For example, the output determination device 221 may determine whether or not to output a flow based on call graph information (illustrated in FIGS. 13 and 14) representing information as described above. FIG. 13 is a diagram conceptually illustrating an example of the call graph information 401 based on the first source program 301. FIG. 14 is a diagram conceptually illustrating an example of the call graph information 401 based on the second source program 302.

コールグラフ情報401は、関数呼び出しに基づいて、ソースプログラムに記載された関数を表す関数呼び出し情報402と、該関数が出力する値の型、及び、該関数の引数を表す変数識別子を含む変数情報403とを含む。関数呼び出し情報402においては、たとえば、第1関数が第3関数を呼び出すという関数の間の関係が、第1関数及び第3関数を結ぶ矢印線として表される。また、変数情報403においては、関数と、該関数が出力する値の型と、該関数の引数を表す変数識別子と、該変数識別子の値の型とが関連付けされている。尚、関数の引数を表す変数識別子の個数は、複数であってもよい。   The call graph information 401 is variable information including function call information 402 representing a function described in a source program based on the function call, a value type output by the function, and a variable identifier representing an argument of the function. 403. In the function call information 402, for example, the relationship between functions that the first function calls the third function is represented as an arrow line connecting the first function and the third function. In the variable information 403, a function, a value type output by the function, a variable identifier representing an argument of the function, and a value type of the variable identifier are associated with each other. Note that the number of variable identifiers representing function arguments may be plural.

たとえば、図13に例示する関数呼び出し情報402を参照すると、「main→funcB→funcC」なる記載は、関数mainが関数funcBを呼び出し、関数funcBが関数funcCを呼び出すことを表す。図13に例示する変数情報403を参照すると、たとえば、「funcC」と、「unsigned int」と、「U」とが関連付けされている。これは、関数funcCが出力する変数の型が「unsigned int」型であり、関数funcCの引数を表す変数識別子がUであることを表す。   For example, referring to the function call information 402 illustrated in FIG. 13, the description “main → funcB → funcC” indicates that the function main calls the function funcB and the function funcB calls the function funcC. Referring to the variable information 403 illustrated in FIG. 13, for example, “funcC”, “unsigned int”, and “U” are associated with each other. This indicates that the type of the variable output by the function funcC is “unsigned int” type, and the variable identifier representing the argument of the function funcC is U.

出力判定装置221は、たとえば、第1ソースプログラム301に含まれる関数と、第2ソースプログラム302に含まれる関数とを比較し、比較した結果を図15に例示するような差分情報として出力してもよい。図15は、差分情報の一例を概念的に表す図である。あるいは、図15に例示するような差分情報が算出されている場合に、出力判定装置221は、該差分情報に基づき、上述した処理を実行してもよい。   For example, the output determination device 221 compares the function included in the first source program 301 with the function included in the second source program 302, and outputs the comparison result as difference information as illustrated in FIG. Also good. FIG. 15 is a diagram conceptually illustrating an example of difference information. Alternatively, when the difference information illustrated in FIG. 15 is calculated, the output determination device 221 may execute the above-described process based on the difference information.

図15に例示する差分情報においては、図13に例示する変数情報403に示す各項目と、図13及び図14に例示する変数情報403を比較した結果である差分とが関連付けされている。たとえば、図15の5行目において、「funcCの戻り値の型」は、「有」に関連付けされている。これは、「funcCの戻り値の型(int)」に関して、第1ソースプログラム301と、第2ソースプログラム302とに差分があることを表す。また、「funcCの変数識別子(U)」は、「無」に関連付けされている。これは、「funcCの変数識別子(U)」に関して、第1ソースプログラム301と、第2ソースプログラム302とに差分がないことを表す。   In the difference information illustrated in FIG. 15, each item illustrated in the variable information 403 illustrated in FIG. 13 is associated with a difference that is a result of comparing the variable information 403 illustrated in FIGS. 13 and 14. For example, in the fifth line of FIG. 15, “funcC return value type” is associated with “present”. This indicates that there is a difference between the first source program 301 and the second source program 302 with respect to the “funcC return value type (int)”. In addition, “variable identifier (U) of funcC” is associated with “none”. This indicates that there is no difference between the first source program 301 and the second source program 302 with respect to the “funcC variable identifier (U)”.

<第5の実施形態>
次に、上述した第4の実施形態を基本とする本発明の第5の実施形態について説明する。
<Fifth Embodiment>
Next, a fifth embodiment of the present invention based on the above-described fourth embodiment will be described.

以降の説明においては、本実施形態に係る特徴的な部分を中心に説明すると共に、上述した第4の実施形態と同様な構成については、同一の参照番号を付すことにより、重複する説明を省略する。   In the following description, the characteristic part according to the present embodiment will be mainly described, and the same configuration as that of the above-described fourth embodiment will be denoted by the same reference numeral, and redundant description will be omitted. To do.

図16と図17とを参照しながら、第5の実施形態に係る出力判定装置231が有する構成と、出力判定装置231が行う処理とについて説明する。図16は、本発明の第5の実施形態に係る出力判定装置231が有する構成を示すブロック図である。図17は、第5の実施形態に係る出力判定装置231における処理の流れを示すフローチャートである。   The configuration of the output determination device 231 according to the fifth embodiment and the processing performed by the output determination device 231 will be described with reference to FIGS. 16 and 17. FIG. 16 is a block diagram showing the configuration of the output determination device 231 according to the fifth embodiment of the present invention. FIG. 17 is a flowchart showing a flow of processing in the output determination device 231 according to the fifth embodiment.

第5の実施形態に係る出力判定装置231は、処理抽出部102と、関数抽出部103と、型抽出部202と、出力決定部233と、変数抽出部223と、第1変数部232とを有する。出力判定装置231は、さらに、変数情報部234を有してもよい。   The output determination device 231 according to the fifth embodiment includes a process extraction unit 102, a function extraction unit 103, a type extraction unit 202, an output determination unit 233, a variable extraction unit 223, and a first variable unit 232. Have. The output determination device 231 may further include a variable information unit 234.

第1変数部232は、上述した処理hにおいて以降に示す処理を開始する。すなわち、第1変数部232は、第1関数に関する引数を表す変数識別子、第1関数に関する引数の型、第2関数に関する引数の型、または、第3関数に関する引数の型のうち、少なくとも一つの項目に差分がある場合に、以降に示す処理を開始する。   The first variable unit 232 starts the following process in the process h described above. That is, the first variable unit 232 includes at least one of a variable identifier representing an argument related to the first function, an argument type related to the first function, an argument type related to the second function, or an argument type related to the third function. When there is a difference between items, the following processing is started.

説明の便宜上、第1ソースプログラム301と、第2ソースプログラム302との間において、引数を表す変数識別子(または、引数の型)に差分を有する対象である変数を、「差分変数」と表す。   For convenience of explanation, a variable which is a target having a difference in a variable identifier (or argument type) representing an argument between the first source program 301 and the second source program 302 is represented as “difference variable”.

第1変数部232は、第2ソースプログラム302において、命令文306から、差分変数を表す変数識別子が含まれる命令文に至る命令文列を逆順に追跡することにより、差分変数に値を最初に設定する設定命令文を特定する(ステップS231)。   In the second source program 302, the first variable unit 232 first sets a value in the difference variable by tracking the instruction sentence string from the instruction sentence 306 to the instruction sentence including the variable identifier representing the difference variable in reverse order. A setting command statement to be set is specified (step S231).

たとえば、設定命令文は、「=」の左側に変数識別子を含み、「=」の右側に変数識別子、数値、計算式、または、関数等を含む命令文である。   For example, the setting command statement is a command statement including a variable identifier on the left side of “=” and including a variable identifier, a numerical value, a calculation formula, a function, or the like on the right side of “=”.

たとえば、第2ソースプログラム302が図18に例示するようなソースプログラムであるとする。図18は、第2ソースプログラム302の一例を表す図である。また、命令文306は、「printf(“%d”,X)」であるとする。さらに、差分変数を表す変数識別子は、Xであるとする。   For example, assume that the second source program 302 is a source program as illustrated in FIG. FIG. 18 is a diagram illustrating an example of the second source program 302. Further, it is assumed that the command statement 306 is “printf (“% d ”, X)”. Furthermore, it is assumed that the variable identifier representing the difference variable is X.

この場合に、第1変数部232は、まず、命令文「X=D+B」を読み取る。読み取った命令文が、Xに「D+B」の演算結果を設定する命令文であり、さらに、Xが差分変数であるので、第1変数部232は、該命令が、差分変数に最初に値を設定する命令文であると判定する。   In this case, the first variable unit 232 first reads the command sentence “X = D + B”. Since the read command statement is a command statement that sets an operation result of “D + B” to X, and X is a difference variable, the first variable unit 232 first sets a value to the difference variable. It is determined that the command statement is set.

次に、第1変数部232は、特定した命令文において、差分変数に値を設定する基となる変数識別子を特定し、特定した変数識別子を変数情報部234に格納する(ステップS232)。   Next, the first variable unit 232 specifies a variable identifier that is a basis for setting a value for the difference variable in the specified command statement, and stores the specified variable identifier in the variable information unit 234 (step S232).

上述した例の場合に、第1変数部232は、特定した命令文の右側(すなわち、「D+B」)を読み取ることにより、変数識別子Dと、変数識別子Bとを特定し、変数識別子Dと、変数識別子Bと変数情報部234に格納する。   In the case of the above-described example, the first variable unit 232 identifies the variable identifier D and the variable identifier B by reading the right side of the identified statement (ie, “D + B”), the variable identifier D, Stored in the variable identifier B and the variable information section 234.

次に、出力決定部233は、変数情報部234が記憶する変数識別子のうち、差分変数を表す変数識別子に一致する変数識別子があるか否かを判定する(ステップS233)。変数情報部234が、差分変数を含むと判定する場合に(ステップS233にてYES)、出力決定部233は、フロー304を出力することを決定する(ステップS234)。変数情報部234が、差分変数を含まないと判定する場合に(ステップS233にてNO)、出力決定部233は、フロー304を出力しないことを決定する(ステップS235)。   Next, the output determination unit 233 determines whether there is a variable identifier that matches the variable identifier representing the difference variable among the variable identifiers stored in the variable information unit 234 (step S233). When the variable information unit 234 determines that the difference variable is included (YES in step S233), the output determination unit 233 determines to output the flow 304 (step S234). When the variable information unit 234 determines that the difference variable is not included (NO in step S233), the output determination unit 233 determines not to output the flow 304 (step S235).

次に、第5の実施形態に係る出力判定装置231に関する効果について説明する。   Next, effects related to the output determination device 231 according to the fifth embodiment will be described.

本実施形態に係る出力判定装置231によれば、ソースプログラムに関して静的解析プログラムが出力する情報から、該ソースプログラムが実行される場合に不具合である可能性の高い情報を抽出することができる。さらに、本実施形態に係る出力判定装置231によれば、静的解析プログラムによって出力される情報から、さらに、適切に情報を抽出することができる。   According to the output determination device 231 according to the present embodiment, information that is likely to be a malfunction when the source program is executed can be extracted from information output by the static analysis program regarding the source program. Furthermore, according to the output determination device 231 according to the present embodiment, information can be further appropriately extracted from information output by the static analysis program.

この理由は、理由1及び理由2である。すなわち、
(理由1)第5の実施形態に係る出力判定装置231が有する構成は、第4の実施形態に係る出力判定装置221が有する構成を含むからである、
(理由2)静的解析プログラムに従い抽出された命令文306の実行に関して、差分変数が関係しているか否かを、出力決定部233が判定するからである。
The reason is Reason 1 and Reason 2. That is,
(Reason 1) The configuration of the output determination device 231 according to the fifth embodiment includes the configuration of the output determination device 221 according to the fourth embodiment.
(Reason 2) This is because the output determination unit 233 determines whether or not the difference variable is related to the execution of the command statement 306 extracted according to the static analysis program.

出力決定部233は、変数情報部234が差分変数を含むと判定する場合に、差分変数が命令文306の実行に関係すると判定する。この場合に、出力決定部233は、フロー304を出力することを決定する。また、出力決定部233は、変数情報部234が差分変数を含まないと判定する場合に、差分変数が命令文306の実行に関係しないと判定する。この場合に、出力決定部233は、フロー304を出力しないことを決定する。   When determining that the variable information unit 234 includes a difference variable, the output determination unit 233 determines that the difference variable is related to the execution of the command statement 306. In this case, the output determination unit 233 determines to output the flow 304. The output determination unit 233 determines that the difference variable is not related to the execution of the command statement 306 when the variable information unit 234 determines that the variable does not include the difference variable. In this case, the output determination unit 233 determines not to output the flow 304.

したがって、出力判定装置231は、差分変数が命令文306の実行に影響を与えるか否かを判定するので、さらに適切に情報を抽出することができる。   Therefore, since the output determination device 231 determines whether or not the difference variable affects the execution of the command statement 306, information can be extracted more appropriately.

<第6の実施形態>
次に、上述した第4の実施形態を基本とする本発明の第6の実施形態について説明する。
<Sixth Embodiment>
Next, a sixth embodiment of the present invention based on the above-described fourth embodiment will be described.

以降の説明においては、本実施形態に係る特徴的な部分を中心に説明すると共に、上述した第4の実施形態と同様な構成については、同一の参照番号を付すことにより、重複する説明を省略する。   In the following description, the characteristic part according to the present embodiment will be mainly described, and the same configuration as that of the above-described fourth embodiment will be denoted by the same reference numeral, and redundant description will be omitted. To do.

図19と図20とを参照しながら、第6の実施形態に係る出力判定装置241が有する構成と、出力判定装置241が行う処理とについて説明する。図19は、本発明の第6の実施形態に係る出力判定装置241が有する構成を示すブロック図である。図20は、第6の実施形態に係る出力判定装置241における処理の流れを示すフローチャートである。   The configuration of the output determination device 241 according to the sixth embodiment and the processing performed by the output determination device 241 will be described with reference to FIGS. 19 and 20. FIG. 19 is a block diagram showing the configuration of the output determination device 241 according to the sixth embodiment of the present invention. FIG. 20 is a flowchart showing the flow of processing in the output determination device 241 according to the sixth embodiment.

第6の実施形態に係る出力判定装置241は、処理抽出部102と、関数抽出部103と、型抽出部202と、出力決定部243と、変数抽出部223と、第2変数部242とを有する。出力判定装置241は、さらに、変数情報部234と、第1変数部232とを有してもよい。   The output determination device 241 according to the sixth embodiment includes a process extraction unit 102, a function extraction unit 103, a type extraction unit 202, an output determination unit 243, a variable extraction unit 223, and a second variable unit 242. Have. The output determination device 241 may further include a variable information unit 234 and a first variable unit 232.

第2変数部242は、上述した処理hにおいて以降に示す処理を開始する。すなわち、第2変数部242は、第1関数に関する引数を表す変数識別子、第1関数に関する引数の型、第2関数に関する引数の型、または、第3関数に関する引数の型のうち、少なくとも一つが差分を有する場合に、以降に示す処理を開始する。   The second variable unit 242 starts the following process in the process h described above. That is, the second variable unit 242 has at least one of a variable identifier representing an argument related to the first function, an argument type related to the first function, an argument type related to the second function, or an argument type related to the third function. When there is a difference, the following processing is started.

第2変数部242は、第2ソースプログラム302において、命令文306から、差分変数を表す変数識別子が含まれる命令に至る命令文列を逆順に追跡することにより、命令文306を実行するか否かを決める制御命令文を特定する(ステップS241)。   Whether or not the second variable unit 242 executes the command statement 306 by tracking the command statement string from the command statement 306 to the command including the variable identifier representing the difference variable in the second source program 302 in reverse order. A control command statement that determines whether or not is specified (step S241).

たとえば、第2ソースプログラム302が図21に例示するようなソースプログラムであるとする。図21は、第2ソースプログラム302の一例を表す図である。また、命令文306は、「X=W+1」であるとする。さらに、差分変数を表す変数識別子は、Xであるとする。   For example, it is assumed that the second source program 302 is a source program as illustrated in FIG. FIG. 21 is a diagram illustrating an example of the second source program 302. Further, it is assumed that the command statement 306 is “X = W + 1”. Furthermore, it is assumed that the variable identifier representing the difference variable is X.

この場合に、第2変数部242は、まず、命令文306から1つの命令文を逆順に追跡することにより、命令文「if (D!=1)」を読み取る。第2変数部242は、読み取った命令文が、条件分岐を表す「if」命令文であるので、命令文306を実行するか否かに関する制御命令文であると判定する。   In this case, the second variable unit 242 first reads the command statement “if (D! = 1)” by tracing one command statement from the command statement 306 in reverse order. Since the read command statement is an “if” command statement representing a conditional branch, the second variable unit 242 determines that the command statement is a control command statement regarding whether to execute the command statement 306.

たとえば、制御命令文は、上述した「if」命令文、条件を満たすまでの間に処理を繰り返すことを表す「while」命令文、ある回数分、処理を繰り返す「for」命令文等である。   For example, the control command statement is the “if” command statement described above, a “while” command statement indicating that the processing is repeated until the condition is satisfied, a “for” command statement that repeats the processing a certain number of times, or the like.

次に、第2変数部242は、特定した制御命令文において、命令文306を実行するか否かに関する変数識別子と特定し、特定した変数識別子を変数情報部234に格納する(ステップS242)。すなわち、第2変数部242は、特定した制御命令文を構成する条件に含まれる変数識別子を特定する。   Next, the second variable unit 242 specifies a variable identifier related to whether or not to execute the command statement 306 in the specified control command statement, and stores the specified variable identifier in the variable information unit 234 (step S242). In other words, the second variable unit 242 specifies a variable identifier included in the condition that constitutes the specified control command statement.

たとえば、上述した例において、第2変数部242は、命令文「if (D!=1)」における変数識別子Dが、命令文306を実行するか否かに関する変数識別子であることを特定し、特定した変数識別子Dを変数情報部234に格納する。   For example, in the example described above, the second variable unit 242 specifies that the variable identifier D in the command statement “if (D! = 1)” is a variable identifier related to whether or not the command statement 306 is executed, The identified variable identifier D is stored in the variable information unit 234.

次に、出力判定装置241は、変数情報部234が記憶する変数識別子のうち、差分変数を表す変数識別子に一致する変数識別子があるか否かを判定する(ステップS243)。変数情報部234が、差分変数を含むと判定する場合に(ステップS243にてYES)、出力決定部243は、フロー304を出力することを決定する(ステップS244)。変数情報部234が、差分変数を含まないと判定する場合に(ステップS243にてNO)、出力決定部243は、フロー304を出力しないことを決定する(ステップS245)。   Next, the output determination device 241 determines whether there is a variable identifier that matches the variable identifier representing the difference variable among the variable identifiers stored in the variable information unit 234 (step S243). When the variable information unit 234 determines that the difference variable is included (YES in step S243), the output determination unit 243 determines to output the flow 304 (step S244). When the variable information unit 234 determines that the difference variable is not included (NO in step S243), the output determination unit 243 determines not to output the flow 304 (step S245).

次に、第6の実施形態に係る出力判定装置241に関する効果について説明する。   Next, effects related to the output determination device 241 according to the sixth embodiment will be described.

本実施形態に係る出力判定装置241によれば、ソースプログラムに関して静的解析プログラムが出力する情報から、該ソースプログラムが実行される場合に不具合である可能性の高い情報を抽出することができる。さらに、本実施形態に係る出力判定装置241によれば、静的解析プログラムによって出力される情報から、さらに、適切に情報を抽出することができる。   According to the output determination device 241 according to the present embodiment, information that is likely to be a malfunction when the source program is executed can be extracted from information output by the static analysis program regarding the source program. Furthermore, according to the output determination device 241 according to the present embodiment, information can be further appropriately extracted from information output by the static analysis program.

この理由は、理由1及び理由2である。すなわち、
(理由1)第6の実施形態に係る出力判定装置241が有する構成は、第4の実施形態に係る出力判定装置221が有する構成を含むからである、
(理由2)静的解析プログラムに従い抽出された命令文306を実行するか否かを制御する制御命令文を構成する条件に、差分変数が関係するか否かを、出力決定部243が判定するからである。
The reason is Reason 1 and Reason 2. That is,
(Reason 1) The configuration of the output determination device 241 according to the sixth embodiment includes the configuration of the output determination device 221 according to the fourth embodiment.
(Reason 2) The output determination unit 243 determines whether or not the difference variable is related to the condition that constitutes the control command statement that controls whether or not the command statement 306 extracted according to the static analysis program is executed. Because.

出力決定部243は、変数情報部234が差分変数を含むと判定する場合に、差分変数が命令文306の実行に関係すると判定する。この場合に、出力決定部243は、フロー304を出力することを決定する。また、出力決定部243は、変数情報部234が差分変数を含まないと判定する場合に、差分変数が命令文306の実行に関係しないと判定する。この場合に、出力決定部233は、フロー304を出力しないことを決定する。   The output determining unit 243 determines that the difference variable is related to the execution of the command statement 306 when the variable information unit 234 determines that the variable variable includes the difference variable. In this case, the output determination unit 243 determines to output the flow 304. Further, when the variable information unit 234 determines that the variable information unit 234 does not include the difference variable, the output determination unit 243 determines that the difference variable is not related to the execution of the command statement 306. In this case, the output determination unit 233 determines not to output the flow 304.

したがって、出力判定装置241は、差分変数が命令文306の実行に影響を与えるか否かを判定するので、さらに適切に情報を抽出することができる。   Therefore, since the output determination device 241 determines whether or not the difference variable affects the execution of the command statement 306, information can be extracted more appropriately.

<第7の実施形態>
次に、上述した第6の実施形態を基本とする本発明の第7の実施形態について説明する。
<Seventh Embodiment>
Next, a seventh embodiment of the present invention based on the sixth embodiment described above will be described.

以降の説明においては、本実施形態に係る特徴的な部分を中心に説明すると共に、上述した第6の実施形態と同様な構成については、同一の参照番号を付すことにより、重複する説明を省略する。   In the following description, the characteristic parts according to the present embodiment will be mainly described, and the same components as those in the above-described sixth embodiment will be denoted by the same reference numerals, and redundant description will be omitted. To do.

図22と図23とを参照しながら、第7の実施形態に係る出力判定装置251が有する構成と、出力判定装置251が行う処理とについて説明する。図22は、本発明の第7の実施形態に係る出力判定装置251が有する構成を示すブロック図である。図23は、第7の実施形態に係る出力判定装置251における処理の流れを示すフローチャートである。   The configuration of the output determination device 251 according to the seventh embodiment and the processing performed by the output determination device 251 will be described with reference to FIGS. FIG. 22 is a block diagram showing the configuration of the output determination device 251 according to the seventh embodiment of the present invention. FIG. 23 is a flowchart showing the flow of processing in the output determination device 251 according to the seventh embodiment.

第7の実施形態に係る出力判定装置251は、処理抽出部102と、関数抽出部103と、型抽出部202と、第2変数部242と、出力決定部253と、変数抽出部223と、第3変数部252とを有する。出力判定装置241は、さらに、変数情報部234と、第1変数部232とを有してもよい。   The output determination device 251 according to the seventh embodiment includes a process extraction unit 102, a function extraction unit 103, a type extraction unit 202, a second variable unit 242, an output determination unit 253, a variable extraction unit 223, And a third variable unit 252. The output determination device 241 may further include a variable information unit 234 and a first variable unit 232.

第2変数部242が、ステップS242に示す処理に従い、制御命令文に含まれる変数識別子を特定した後に、第3変数部252は、第2変数部242が特定した変数識別子に関連する処理を開始する。   After the second variable unit 242 specifies the variable identifier included in the control command statement in accordance with the process shown in step S242, the third variable unit 252 starts the process related to the variable identifier specified by the second variable unit 242. To do.

第3変数部252は、第2ソースプログラム302において、第2変数部242が特定した制御命令文から、差分変数を表す変数識別子が含まれる命令文に至る命令文列を逆順に追跡する処理を開始する。この場合に、第3変数部252は、第2変数部242が特定した変数識別子が表す変数に値を最初に設定する設定命令文を特定する(ステップS253)。   In the second source program 302, the third variable unit 252 performs a process of tracing in reverse order the command statement string from the control command statement specified by the second variable unit 242 to the command statement including the variable identifier representing the difference variable. Start. In this case, the third variable unit 252 specifies a setting command statement that first sets a value to the variable represented by the variable identifier specified by the second variable unit 242 (step S253).

上述した例において、図21に例示するソースプログラムの場合に、第2変数部242は、変数識別子Dと、制御命令文「if (D!=1)」を特定する。第3変数部252は、制御命令文「if (D!=1)」の1つ前の命令文である「D=Y+B」を読み取る。読み取った命令文が変数識別子Dに値を設定する設定命令文であるので、第3変数部252は、読み取った命令文が変数識別子Dに値を設定する設定命令文であると特定する。   In the example described above, in the case of the source program illustrated in FIG. 21, the second variable unit 242 identifies the variable identifier D and the control command statement “if (D! = 1)”. The third variable unit 252 reads “D = Y + B”, which is the previous command statement of the control command statement “if (D! = 1)”. Since the read command statement is a setting command statement that sets a value in the variable identifier D, the third variable unit 252 specifies that the read command statement is a setting command statement that sets a value in the variable identifier D.

次に、第3変数部252は、特定した設定命令文において、第2変数部242が特定した変数識別子に値を設定する基となる変数識別子を特定し、特定した変数識別子を変数情報部234に格納する(ステップS254)。   Next, the third variable unit 252 identifies a variable identifier that is a basis for setting a value to the variable identifier identified by the second variable unit 242 in the identified setting command statement, and the identified variable identifier is the variable information unit 234. (Step S254).

上述した例の場合に、第3変数部252は、特定した命令文の右側(すなわち、「Y+B」)を読み取ることにより、変数識別子Yと、変数識別子Bとを特定し、変数識別子Yと、変数識別子Bと変数情報部234に格納する。   In the case of the example described above, the third variable unit 252 identifies the variable identifier Y and the variable identifier B by reading the right side of the identified command statement (ie, “Y + B”), the variable identifier Y, Stored in the variable identifier B and the variable information section 234.

次に、出力決定部253は、変数情報部234が記憶する変数識別子のうち、差分変数を表す変数識別子に一致する変数識別子があるか否かを判定する(ステップS255)。変数情報部234が、差分変数を含むと判定する場合に(ステップS255にてYES)、出力決定部253は、フロー304を出力することを決定する(ステップS257)。変数情報部234が、差分変数を含まないと判定する場合に(ステップS255にてNO)、出力決定部253は、フロー304を出力しないことを決定する(ステップS256)。   Next, the output determination unit 253 determines whether there is a variable identifier that matches the variable identifier representing the difference variable among the variable identifiers stored in the variable information unit 234 (step S255). When variable information unit 234 determines that the difference variable is included (YES in step S255), output determination unit 253 determines to output flow 304 (step S257). When the variable information unit 234 determines that the difference variable is not included (NO in step S255), the output determination unit 253 determines not to output the flow 304 (step S256).

次に、第7の実施形態に係る出力判定装置251に関する効果について説明する。   Next, effects related to the output determination device 251 according to the seventh embodiment will be described.

本実施形態に係る出力判定装置251によれば、ソースプログラムに関して静的解析プログラムが出力する情報から、該ソースプログラムが実行される場合に不具合である可能性の高い情報を抽出することができる。さらに、本実施形態に係る出力判定装置251によれば、静的解析プログラムによって出力される情報から、さらに、適切に情報を抽出することができる。   According to the output determination device 251 according to the present embodiment, information that is likely to be defective when the source program is executed can be extracted from information output by the static analysis program regarding the source program. Furthermore, according to the output determination device 251 according to the present embodiment, information can be further appropriately extracted from information output by the static analysis program.

この理由は、理由1及び理由2である。すなわち、
(理由1)第7の実施形態に係る出力判定装置251が有する構成は、第6の実施形態に係る出力判定装置241が有する構成を含むからである、
(理由2)静的解析プログラムに従い抽出された命令文306を実行するか否かを制御する制御命令文を構成する条件に関して、該条件を満たすか否かを判定する基となる変数に、差分変数が関係するか否かを、出力決定部253が判定するからである。
The reason is Reason 1 and Reason 2. That is,
(Reason 1) The configuration of the output determination device 251 according to the seventh embodiment includes the configuration of the output determination device 241 according to the sixth embodiment.
(Reason 2) Regarding a condition constituting a control command statement for controlling whether or not to execute the command statement 306 extracted according to the static analysis program, a difference is added to a variable serving as a basis for determining whether or not the condition is satisfied. This is because the output determination unit 253 determines whether or not variables are related.

出力決定部253は、変数情報部234が差分変数を含むと判定する場合に、差分変数が制御命令文の条件に関係すると判定する。この結果、出力決定部253は、差分変数が命令文306の実行に関係すると判定する。この場合に、出力決定部253は、フロー304を出力することを決定する。   When determining that the variable information unit 234 includes a difference variable, the output determination unit 253 determines that the difference variable is related to the condition of the control command statement. As a result, the output determination unit 253 determines that the difference variable is related to the execution of the command statement 306. In this case, the output determination unit 253 determines to output the flow 304.

また、出力決定部253は、変数情報部234が差分変数を含まないと判定する場合に、差分変数が制御命令文の条件に関係しないと判定する。この結果、出力決定部253は、差分変数が命令文306の実行に関係しないと判定する。この場合に、出力決定部233は、フロー304を出力しないことを決定する。   The output determining unit 253 determines that the difference variable is not related to the condition of the control command statement when the variable information unit 234 determines that the variable variable does not include the difference variable. As a result, the output determination unit 253 determines that the difference variable is not related to the execution of the command statement 306. In this case, the output determination unit 233 determines not to output the flow 304.

したがって、出力判定装置251は、差分変数が命令文306の実行に影響を与えるか否かを判定するので、さらに適切に情報を抽出することができる。   Therefore, the output determination device 251 determines whether or not the difference variable affects the execution of the command statement 306, so that information can be extracted more appropriately.

(ハードウェア構成例)
上述した本発明の各実施形態における出力判定装置を、1つの計算処理装置(情報処理装置、コンピュータ)を用いて実現するハードウェア資源の構成例について説明する。但し、係る出力判定装置は、物理的または機能的に少なくとも2つの計算処理装置を用いて実現してもよい。また、係る出力判定装置は、専用の装置として実現してもよい。
(Hardware configuration example)
A configuration example of hardware resources for realizing the output determination device in each embodiment of the present invention described above using one calculation processing device (information processing device, computer) will be described. However, the output determination device may be realized using at least two calculation processing devices physically or functionally. The output determination device may be realized as a dedicated device.

図24は、第1の実施形態乃至第7の実施形態に係る出力判定装置を実現可能な計算処理装置のハードウェア構成例を概略的に示す図である。計算処理装置20は、中央処理演算装置(Central Processing Unit、以降「CPU」と表す)21、メモリ22、ディスク23、及び、不揮発性記録媒体24を有する。計算処理装置20は、さらに、入力装置25、出力装置26、通信インターフェース(以降、「通信IF」と表す。)27、及び、ディスプレー28を有する。計算処理装置20は、通信IF27を介して、他の計算処理装置、及び、通信装置と情報を送受信することができる。   FIG. 24 is a diagram schematically illustrating a hardware configuration example of a calculation processing apparatus capable of realizing the output determination apparatus according to the first to seventh embodiments. The computing device 20 includes a central processing unit (Central Processing Unit, hereinafter referred to as “CPU”) 21, a memory 22, a disk 23, and a nonvolatile recording medium 24. The calculation processing device 20 further includes an input device 25, an output device 26, a communication interface (hereinafter referred to as “communication IF”) 27, and a display 28. The calculation processing device 20 can transmit / receive information to / from other calculation processing devices and communication devices via the communication IF 27.

不揮発性記録媒体24は、コンピュータが読み取り可能な、たとえば、コンパクトディスク(Compact Disc)、デジタルバーサタイルディスク(Digital_Versatile_Disc)である。また、不揮発性記録媒体24は、ユニバーサルシリアルバスメモリ(USBメモリ)、ソリッドステートドライブ(Solid_State_Drive)等であってもよい。不揮発性記録媒体24は、電源を供給しなくても係るプログラムを保持し、持ち運びを可能にする。不揮発性記録媒体24は、上述した媒体に限定されない。また、不揮発性記録媒体24の代わりに、通信IF27を介して、通信ネットワークを介して係るプログラムを持ち運びしてもよい。   The nonvolatile recording medium 24 is, for example, a compact disc (Compact Disc) or a digital versatile disc (Digital_Versatile_Disc) that can be read by a computer. The nonvolatile recording medium 24 may be a universal serial bus memory (USB memory), a solid state drive (Solid_State_Drive), or the like. The non-volatile recording medium 24 retains such a program without being supplied with power, and can be carried. The nonvolatile recording medium 24 is not limited to the above-described medium. Further, the program may be carried via the communication network via the communication IF 27 instead of the nonvolatile recording medium 24.

すなわち、CPU21は、ディスク23が記憶するソフトウェア・プログラム(コンピュータ・プログラム:以下、単に「プログラム」と称する)を、実行する際にメモリ22にコピーし、演算処理を実行する。CPU21は、プログラム実行に必要なデータをメモリ22から読み取る。表示が必要な場合には、CPU21は、ディスプレー28に出力結果を表示する。外部への出力が必要な場合には、CPU21は、出力装置26に出力結果を出力する。外部からプログラムを入力する場合、CPU21は、入力装置25からプログラムを読み取る。CPU21は、上述した図1、図6、図8、図10、図16、図19、または、図22に示す各部が表す機能(処理)に対応するところのメモリ22にある出力判定プログラム(図2、図7、図9、図11、図17、図20、または、図23)を解釈し実行する。CPU21は、上述した本発明の各実施形態において説明した処理を順次行う。   That is, the CPU 21 copies a software program (computer program: hereinafter simply referred to as “program”) stored in the disk 23 to the memory 22 when executing it, and executes arithmetic processing. The CPU 21 reads data necessary for program execution from the memory 22. When the display is necessary, the CPU 21 displays the output result on the display 28. When output to the outside is necessary, the CPU 21 outputs an output result to the output device 26. When inputting a program from the outside, the CPU 21 reads the program from the input device 25. The CPU 21 outputs an output determination program (shown in FIG. 1) in the memory 22 corresponding to the function (process) represented by each unit shown in FIG. 1, FIG. 6, FIG. 8, FIG. 10, FIG. 2, FIG. 7, FIG. 9, FIG. 11, FIG. 17, FIG. 20, or FIG. The CPU 21 sequentially performs the processes described in the above-described embodiments of the present invention.

すなわち、このような場合、本発明は、係る出力判定プログラムによっても成し得ると捉えることができる。更に、係る出力判定プログラムが記録されたコンピュータ読み取り可能な不揮発性の記録媒体によっても、本発明は成し得ると捉えることができる。   That is, in such a case, it can be understood that the present invention can also be achieved by such an output determination program. Furthermore, it can be understood that the present invention can also be realized by a computer-readable non-volatile recording medium in which the output determination program is recorded.

以上、上述した実施形態を模範的な例として本発明を説明した。しかし、本発明は、上述した実施形態には限定されない。すなわち、本発明は、本発明のスコープ内において、当業者が理解し得る様々な態様を適用することができる。   The present invention has been described above using the above-described embodiment as an exemplary example. However, the present invention is not limited to the above-described embodiment. That is, the present invention can apply various modes that can be understood by those skilled in the art within the scope of the present invention.

尚、上述した各実施形態の一部又は全部は、以下の付記のようにも記載されうる。しかし、上述した各実施形態により例示的に説明した本発明は、以下には限られない。すなわち、
(付記1)
ソースプログラムを静的に解析する静的解析手段が、前記ソースプログラムから抽出したフローと、前記フローから抽出した命令文とに基づき、前記ソースプログラムにおいて前記命令文を含む第1関数を特定し、特定した前記第1関数に関して、関数を一意に識別可能な関数識別子を第1関数識別子として抽出する処理抽出手段と、
前記ソースプログラムにおいて、前記第1関数識別子が表す前記関数を呼び出す第2関数を特定し、特定した前記第2関数を表す第2関数識別子を抽出するとともに、前記ソースプログラムにおいて前記第1関数識別子が表す前記関数が呼び出す第3関数を特定し、特定した前記第3関数を表す第3関数識別子を抽出する関数抽出手段と、
第1ソースプログラムにおいて抽出された前記第1関数識別子と、第2ソースプログラムにおいて抽出された前記第1関数識別子とが一致するか否か、前記第1ソースプログラムにおいて抽出された前記第2関数識別子と、前記第2ソースプログラムにおいて抽出された前記第2関数識別子とが一致するか否か、及び、前記第1ソースプログラムにおいて抽出された前記第3関数識別子と、前記第2ソースプログラムにおいて抽出された前記第3関数識別子とが一致するか否かを判定し、(a)いずれも一致すると判定する場合に、前記静的解析手段が前記第2ソースプログラムにおいて抽出した第2フローを出力せず、(b)いずれかが一致しないと判定した場合に、前記第2フローを出力することを決定する出力決定手段と
備える出力判定装置。
In addition, a part or all of each embodiment mentioned above can be described also as the following additional remarks. However, the present invention described by way of example with the above-described embodiments is not limited to the following. That is,
(Appendix 1)
Static analysis means for statically analyzing a source program specifies a first function including the instruction sentence in the source program based on the flow extracted from the source program and the instruction sentence extracted from the flow, A process extracting means for extracting, as the first function identifier, a function identifier that can uniquely identify the function with respect to the identified first function;
In the source program, a second function that calls the function represented by the first function identifier is identified, a second function identifier representing the identified second function is extracted, and in the source program, the first function identifier is A function extracting means for identifying a third function called by the function to be represented and extracting a third function identifier representing the identified third function;
Whether the first function identifier extracted in the first source program matches the first function identifier extracted in the second source program, whether the second function identifier extracted in the first source program And the second function identifier extracted in the second source program, the third function identifier extracted in the first source program, and the second source program extracted in the second source program Whether or not the third function identifier matches, and (a) does not output the second flow extracted by the static analysis means in the second source program when it is determined that both match. , (B) output determination means for determining to output the second flow when it is determined that either of them does not match. Fixed device.

(付記2)
前記ソースプログラムにおいて、前記第3関数が出力する値の型を抽出する型抽出手段
をさらに備え、
前記出力決定手段は、前記(a)である場合に、前記第3関数に関して、前記第1ソースプログラムにおいて抽出された前記型と、前記第2ソースプログラムにおいて抽出された前記型とが一致するか否かを判定し、(c)一致すると判定する場合に、前記第2フローを出力せず、(d)一致しないと判定する場合に、前記第2フローを出力する
付記1に記載の出力判定装置。
(Appendix 2)
The source program further comprises type extracting means for extracting the type of the value output by the third function,
In the case of (a), the output determining means, for the third function, does the type extracted in the first source program match the type extracted in the second source program? (C) If it is determined that they match, the second flow is not output, and (d) if it is determined that they do not match, the second flow is output. Output determination according to appendix 1 apparatus.

(付記3)
前記型抽出手段は、前記(c)である場合に、さらに、前記ソースプログラムにおいて、前記第1関数が出力する値の型、及び、前記第2関数が出力する値の型を抽出し、
前記出力決定手段は、前記第1ソースプログラムにおいて特定された前記第1関数に関する前記型と、前記第2ソースプログラムにおいて特定された前記第1関数に関する前記型とが一致するか否か、及び、前記第1ソースプログラムにおいて特定された前記第2関数に関する前記型と、前記第2ソースプログラムにおいて特定された前記第2関数に関する前記型とが一致するか否かを判定し、(e)いずれもが一致すると判定する場合に、前記第2フローを出力せず、(f)いずれかが一致しないと判定する場合に前記第2フローを出力する
付記2に記載の出力判定装置。
(Appendix 3)
In the case of (c), the type extracting means further extracts a value type output from the first function and a value type output from the second function in the source program,
The output determining means determines whether the type related to the first function specified in the first source program matches the type related to the first function specified in the second source program; and It is determined whether or not the type related to the second function specified in the first source program matches the type related to the second function specified in the second source program. The output determination device according to claim 2, wherein the second flow is not output when it is determined that they match, and (f) the second flow is output when it is determined that either does not match.

(付記4)
前記(c)または前記(e)である場合に、前記ソースプログラムにおいて、前記第1関数に対する入出力に関する変数を表す変数識別子を抽出する変数抽出手段
をさらに備え、
前記出力決定手段は、前記第1ソースプログラムにおいて抽出された前記変数識別子と、前記第2ソースプログラムにおいて抽出された前記変数識別子とが一致するか否かを判定し、(g)一致すると判定する場合に、前記第2フローを出力せず、(h)一致しないと判定する場合に前記第2フローを出力する
付記2または付記3に記載の出力判定装置。
(Appendix 4)
In the case of (c) or (e), the source program further comprises variable extraction means for extracting a variable identifier representing a variable related to input / output with respect to the first function,
The output determining means determines whether or not the variable identifier extracted in the first source program matches the variable identifier extracted in the second source program, and (g) determines that they match. In this case, the second flow is not output, and (h) the second flow is output when it is determined that they do not coincide with each other.

(付記5)
前記変数抽出手段は、さらに、前記ソースプログラムにおいて、前記第1関数乃至前記第3関数に関して、それぞれ、入出力に関する変数の型を抽出し、
前記出力決定手段は、
前記第1ソースプログラムにおいて抽出された前記第1関数に関する各変数の型と、前記第2ソースプログラムにおいて抽出された前記第1関数に関する各変数の型とが一致するか否か、
前記第1ソースプログラムにおいて抽出された前記第2関数に関する各変数の型と、前記第2ソースプログラムにおいて抽出された前記第2関数に関する各変数の型とが一致するか否か、
前記第1ソースプログラムにおいて抽出された前記第3関数に関する各変数の型と、前記第2ソースプログラムにおいて抽出された前記第3関数に関する各変数の型とが一致するか否か
を判定し、いずれも一致すると判定する場合に前記第2フローを出力せず、いずれかが一致しないと判定する場合に、前記第2フローを出力する
付記4に記載の出力判定装置。
(Appendix 5)
The variable extraction unit further extracts a variable type related to input / output with respect to the first function to the third function in the source program,
The output determining means includes
Whether the type of each variable related to the first function extracted in the first source program matches the type of each variable related to the first function extracted in the second source program;
Whether the type of each variable related to the second function extracted in the first source program matches the type of each variable related to the second function extracted in the second source program;
It is determined whether the type of each variable related to the third function extracted in the first source program matches the type of each variable related to the third function extracted in the second source program. The output determination device according to claim 4, wherein the second flow is not output when it is determined that they match, and the second flow is output when any of them does not match.

(付記6)
前記(h)である場合に、前記ソースプログラムを逆順に追跡することにより、前記フローから抽出された前記命令文から、前記(h)において一致しない前記変数を表す前記変数識別子が含まれる命令文のうち、最初に前記変数識別子を含む命令文に至る命令文列において、一致しない前記変数に値を設定する命令文を特定し、前記設定する命令文を構成する前記変数を特定し、特定した前記変数を表す前記変数識別子を変数情報手段に格納する第1変数手段
をさらに備え、
前記出力決定手段は、前記(h)において一致しない前記変数を表す前記変数識別子が、前記変数情報手段に含まれるか否かを判定し、含まれる場合に、前記第2フローを出力し、含まれない場合に、前記第2フローを出力しない
付記4または付記5に記載の出力判定装置。
(Appendix 6)
In the case of (h), by tracing the source program in reverse order, the statement including the variable identifier representing the variable that does not match in (h) is extracted from the statement extracted from the flow. In the command statement string that first reaches the command statement including the variable identifier, the command statement that sets a value to the variable that does not match is specified, and the variable that constitutes the command statement to be set is specified and specified. First variable means for storing the variable identifier representing the variable in variable information means;
The output determining means determines whether or not the variable identifier representing the variable that does not match in (h) is included in the variable information means, and if included, outputs the second flow and includes If not, the output determination device according to Supplementary Note 4 or Supplementary Note 5, wherein the second flow is not output.

(付記7)
前記(h)である場合に、前記ソースプログラムを逆順に追跡することにより、前記フローから抽出された命令文から、前記(h)において一致しない前記変数を表す前記変数識別子が含まれる命令文のうち、最初に前記変数識別子を含む命令文に至る命令文列において、前記命令文が実行されるか否かを制御する制御命令文を特定し、前記制御命令文に含まれる前記変数を表す前記変数識別子を抽出し、抽出した前記変数識別子を前記変数情報手段に格納する第2変数手段
をさらに備え
前記出力決定手段は、一致しない前記変数を表す前記変数識別子が、前記変数情報手段に含まれるか否かを判定する
付記6に記載の出力判定装置。
(Appendix 7)
In the case of (h), by tracing the source program in reverse order, the instruction sentence including the variable identifier representing the variable that does not match in (h) is extracted from the instruction sentence extracted from the flow. Among them, in a command statement string that first reaches a command statement including the variable identifier, a control command statement that controls whether or not the command statement is executed is specified, and the variable that is included in the control command statement is represented. The variable information means further includes second variable means for extracting the variable identifier and storing the extracted variable identifier in the variable information means. The output determining means includes the variable identifier representing the variable that does not match. The output determination apparatus according to appendix 6.

(付記8)
前記(h)である場合に、前記ソースプログラムを逆順に追跡することにより、前記第2変数手段が抽出した前記変数識別子に、値を設定する設定命令文を特定し、該特定した前記設定命令文にて前記値を算出する基となる前記変数識別子を特定し、特定した前記変数識別子を前記変数情報手段に格納する第3変数手段
をさらに備える
付記7に記載の出力判定装置。
(Appendix 8)
In the case of (h), by tracing the source program in reverse order, a setting command statement for setting a value is specified in the variable identifier extracted by the second variable means, and the specified setting command The output determination device according to claim 7, further comprising: third variable means for specifying the variable identifier that is a basis for calculating the value by a sentence and storing the specified variable identifier in the variable information means.

(付記9)
前記静的解析手段と、
付記1乃至付記8のいずれかに記載の出力判定装置と
を備える静的解析装置。
(Appendix 9)
The static analysis means;
A static analysis device comprising: the output determination device according to any one of supplementary notes 1 to 8.

(付記10)
情報処理装置が、
ソースプログラムを静的に解析する静的解析手段が、前記ソースプログラムから抽出したフローと、前記フローから抽出した命令文とに基づき、前記ソースプログラムにおいて前記命令文を含む第1関数を特定し、特定した前記第1関数に関して、関数を一意に識別可能な関数識別子を第1関数識別子として抽出し、
前記ソースプログラムにおいて、前記第1関数識別子が表す前記関数を呼び出す第2関数を特定し、特定した前記第2関数を表す第2関数識別子を抽出するとともに、前記ソースプログラムにおいて前記第1関数識別子が表す前記関数が呼び出す第3関数を特定し、特定した前記第3関数を表す第3関数識別子を抽出し、
第1ソースプログラムにおいて抽出された前記第1関数識別子と、第2ソースプログラムにおいて抽出された前記第1関数識別子とが一致するか否か、前記第1ソースプログラムにおいて抽出された前記第2関数識別子と、前記第2ソースプログラムにおいて抽出された前記第2関数識別子とが一致するか否か、及び、前記第1ソースプログラムにおいて抽出された前記第3関数識別子と、前記第2ソースプログラムにおいて抽出された前記第3関数識別子とが一致するか否かを判定し、(a)いずれも一致すると判定した場合に、前記静的解析手段が前記第2ソースプログラムにおいて抽出した第2フローを出力せず、(b)いずれかが一致しないと判定した場合に、前記第2フローを出力することを決定する出力判定方法。
(Appendix 10)
Information processing device
Static analysis means for statically analyzing a source program specifies a first function including the instruction sentence in the source program based on the flow extracted from the source program and the instruction sentence extracted from the flow, With respect to the identified first function, a function identifier that can uniquely identify the function is extracted as a first function identifier,
In the source program, a second function that calls the function represented by the first function identifier is identified, a second function identifier representing the identified second function is extracted, and in the source program, the first function identifier is Identifying a third function called by the function to be represented, extracting a third function identifier representing the identified third function;
Whether the first function identifier extracted in the first source program matches the first function identifier extracted in the second source program, whether the second function identifier extracted in the first source program And the second function identifier extracted in the second source program, the third function identifier extracted in the first source program, and the second source program extracted in the second source program Whether or not the third function identifier matches, and (a) does not output the second flow extracted by the static analysis means in the second source program when it is determined that both match. , (B) An output determination method for determining to output the second flow when it is determined that any of them does not match.

(付記11)
ソースプログラムを静的に解析する静的解析手段が、前記ソースプログラムから抽出したフローと、前記フローから抽出した命令文とに基づき、前記ソースプログラムにおいて前記命令文を含む第1関数を特定し、特定した前記第1関数に関して、関数を一意に識別可能な関数識別子を第1関数識別子として抽出する処理抽出機能と、
前記ソースプログラムにおいて、前記第1関数識別子が表す前記関数を呼び出す第2関数を特定し、特定した前記第2関数を表す第2関数識別子を抽出するとともに、前記ソースプログラムにおいて前記第1関数識別子が表す前記関数が呼び出す第3関数を特定し、特定した前記第3関数を表す第3関数識別子を抽出する関数抽出機能と、
第1ソースプログラムにおいて抽出された前記第1関数識別子と、前記第2ソースプログラムにおいて抽出された前記第1関数識別子とが一致するか否か、前記第1ソースプログラムにおいて抽出された前記第2関数識別子と、前記第2ソースプログラムにおいて抽出された前記第2関数識別子とが一致するか否か、及び、前記第1ソースプログラムにおいて抽出された前記第3関数識別子と、前記第2ソースプログラムにおいて抽出された前記第3関数識別子とが一致するか否かを判定し、(a)いずれも一致すると判定した場合に、前記静的解析手段が第2ソースプログラムにおいて抽出した第2フローを出力せず、(b)いずれかが一致しないと判定した場合に、前記第2フローを出力することを決定する出力決定機能と
をコンピュータに実現させる出力判定プログラム。
(Appendix 11)
Static analysis means for statically analyzing a source program specifies a first function including the instruction sentence in the source program based on the flow extracted from the source program and the instruction sentence extracted from the flow, A process extraction function for extracting, as the first function identifier, a function identifier that can uniquely identify the function with respect to the identified first function;
In the source program, a second function that calls the function represented by the first function identifier is identified, a second function identifier representing the identified second function is extracted, and in the source program, the first function identifier is A function extraction function for identifying a third function called by the function to be represented and extracting a third function identifier representing the identified third function;
Whether the first function identifier extracted in the first source program matches the first function identifier extracted in the second source program, whether the second function extracted in the first source program Whether the identifier matches the second function identifier extracted in the second source program, and the third function identifier extracted in the first source program, and extracted in the second source program It is determined whether or not the third function identifier matches, and (a) when it is determined that both match, the second flow extracted by the static analysis means in the second source program is not output. , (B) an output determination function for determining that the second flow is output when it is determined that either of them does not match. Output judgment program to be realized

101 出力判定装置
102 処理抽出部
103 関数抽出部
104 出力決定部
301 第1ソースプログラム
302 第2ソースプログラム
303 フロー
304 フロー
305 命令文
306 命令文
307 フロー
201 出力判定装置
202 型抽出部
203 出力決定部
211 出力判定装置
212 型抽出部
213 出力決定部
221 出力判定装置
222 出力決定部
223 変数抽出部
231 出力判定装置
232 第1変数部
233 出力決定部
234 変数情報部
241 出力判定装置
242 第2変数部
243 出力決定部
251 出力判定装置
252 第3変数部
253 出力決定部
401 コールグラフ情報
402 関数呼び出し情報
403 変数情報
20 計算処理装置
21 CPU
22 メモリ
23 ディスク
24 不揮発性記録媒体
25 入力装置
26 出力装置
27 通信IF
28 ディスプレー
DESCRIPTION OF SYMBOLS 101 Output determination apparatus 102 Process extraction part 103 Function extraction part 104 Output determination part 301 1st source program 302 2nd source program 303 Flow 304 Flow 305 Instruction sentence 306 Instruction sentence 307 Flow 201 Output determination apparatus 202 Type extraction part 203 Output determination part 211 output determination device 212 type extraction unit 213 output determination unit 221 output determination device 222 output determination unit 223 variable extraction unit 231 output determination device 232 first variable unit 233 output determination unit 234 variable information unit 241 output determination device 242 second variable unit 243 output determination unit 251 output determination device 252 third variable unit 253 output determination unit 401 call graph information 402 function call information 403 variable information 20 calculation processing device 21 CPU
22 Memory 23 Disk 24 Non-volatile recording medium 25 Input device 26 Output device 27 Communication IF
28 Display

Claims (10)

ソースプログラムを静的に解析する静的解析手段が、前記ソースプログラムから抽出したフローと、前記フローから抽出した命令文とに基づき、前記ソースプログラムにおいて前記命令文を含む第1関数を特定し、特定した前記第1関数に関して、関数を一意に識別可能な関数識別子を第1関数識別子として抽出する処理抽出手段と、
前記ソースプログラムにおいて、前記第1関数識別子が表す前記関数を呼び出す第2関数を特定し、特定した前記第2関数を表す第2関数識別子を抽出するとともに、前記ソースプログラムにおいて前記第1関数識別子が表す前記関数が呼び出す第3関数を特定し、特定した前記第3関数を表す第3関数識別子を抽出する関数抽出手段と、
第1ソースプログラムにおいて抽出された前記第1関数識別子と、第2ソースプログラムにおいて抽出された前記第1関数識別子とが一致するか否か、前記第1ソースプログラムにおいて抽出された前記第2関数識別子と、前記第2ソースプログラムにおいて抽出された前記第2関数識別子とが一致するか否か、及び、前記第1ソースプログラムにおいて抽出された前記第3関数識別子と、前記第2ソースプログラムにおいて抽出された前記第3関数識別子とが一致するか否かを判定し、(a)いずれも一致すると判定した場合に、前記静的解析手段が前記第2ソースプログラムにおいて抽出した第2フローを出力せず、(b)いずれかが一致しないと判定した場合に、前記第2フローを出力することを決定する出力決定手段と
備える出力判定装置。
Static analysis means for statically analyzing a source program specifies a first function including the instruction sentence in the source program based on the flow extracted from the source program and the instruction sentence extracted from the flow, A process extracting means for extracting, as the first function identifier, a function identifier that can uniquely identify the function with respect to the identified first function;
In the source program, a second function that calls the function represented by the first function identifier is identified, a second function identifier representing the identified second function is extracted, and in the source program, the first function identifier is A function extracting means for identifying a third function called by the function to be represented and extracting a third function identifier representing the identified third function;
Whether the first function identifier extracted in the first source program matches the first function identifier extracted in the second source program, whether the second function identifier extracted in the first source program And the second function identifier extracted in the second source program, the third function identifier extracted in the first source program, and the second source program extracted in the second source program Whether or not the third function identifier matches, and (a) does not output the second flow extracted by the static analysis means in the second source program when it is determined that both match. , (B) output determination means for determining to output the second flow when it is determined that either of them does not match. Fixed device.
前記ソースプログラムにおいて、前記第3関数が出力する値の型を抽出する型抽出手段
をさらに備え、
前記出力決定手段は、前記(a)である場合に、前記第3関数に関して、前記第1ソースプログラムにおいて抽出された前記型と、前記第2ソースプログラムにおいて抽出された前記型とが一致するか否かを判定し、(c)一致すると判定する場合に、前記第2フローを出力せず、(d)一致しないと判定する場合に、前記第2フローを出力する
請求項1に記載の出力判定装置。
The source program further comprises type extracting means for extracting the type of the value output by the third function,
In the case of (a), the output determining means, for the third function, does the type extracted in the first source program match the type extracted in the second source program? 2. The output according to claim 1, wherein (2) the second flow is output when (c) it is determined that they do not match, and (d) when it is determined that they do not match. Judgment device.
前記型抽出手段は、前記(c)である場合に、さらに、前記ソースプログラムにおいて、前記第1関数が出力する値の型、及び、前記第2関数が出力する値の型を抽出し、
前記出力決定手段は、前記第1ソースプログラムにおいて特定された前記第1関数に関する前記型と、前記第2ソースプログラムにおいて特定された前記第1関数に関する前記型とが一致するか否か、及び、前記第1ソースプログラムにおいて特定された前記第2関数に関する前記型と、前記第2ソースプログラムにおいて特定された前記第2関数に関する前記型とが一致するか否かを判定し、(e)いずれもが一致すると判定する場合に、前記第2フローを出力せず、(f)いずれかが一致しないと判定する場合に前記第2フローを出力する
請求項2に記載の出力判定装置。
In the case of (c), the type extracting means further extracts a value type output from the first function and a value type output from the second function in the source program,
The output determining means determines whether the type related to the first function specified in the first source program matches the type related to the first function specified in the second source program; and It is determined whether or not the type related to the second function specified in the first source program matches the type related to the second function specified in the second source program. 3. The output determination device according to claim 2, wherein the second flow is not output when it is determined that the two match, and (f) the second flow is output when it is determined that either does not match.
前記(c)または前記(e)である場合に、前記ソースプログラムにおいて、前記第1関数に対する入出力に関する変数を表す変数識別子を抽出する変数抽出手段
をさらに備え、
前記出力決定手段は、前記第1ソースプログラムにおいて抽出された前記変数識別子と、前記第2ソースプログラムにおいて抽出された前記変数識別子とが一致するか否かを判定し、(g)一致すると判定する場合に、前記第2フローを出力せず、(h)一致しないと判定する場合に前記第2フローを出力する
請求項2または請求項3に記載の出力判定装置。
In the case of (c) or (e), the source program further comprises variable extraction means for extracting a variable identifier representing a variable related to input / output with respect to the first function,
The output determining means determines whether or not the variable identifier extracted in the first source program matches the variable identifier extracted in the second source program, and (g) determines that they match. The output determination apparatus according to claim 2 or 3, wherein the second flow is not output, and (h) the second flow is output when it is determined that they do not match.
前記変数抽出手段は、さらに、前記ソースプログラムにおいて、前記第1関数乃至前記第3関数に関して、それぞれ、入出力に関する変数の型を抽出し、
前記出力決定手段は、
前記第1ソースプログラムにおいて抽出された前記第1関数に関する各変数の型と、前記第2ソースプログラムにおいて抽出された前記第1関数に関する各変数の型とが一致するか否か、
前記第1ソースプログラムにおいて抽出された前記第2関数に関する各変数の型と、前記第2ソースプログラムにおいて抽出された前記第2関数に関する各変数の型とが一致するか否か、
前記第1ソースプログラムにおいて抽出された前記第3関数に関する各変数の型と、前記第2ソースプログラムにおいて抽出された前記第3関数に関する各変数の型とが一致するか否か
を判定し、いずれも一致すると判定する場合に前記第2フローを出力せず、いずれかが一致しないと判定する場合に、前記第2フローを出力する
請求項4に記載の出力判定装置。
The variable extraction unit further extracts a variable type related to input / output with respect to the first function to the third function in the source program,
The output determining means includes
Whether the type of each variable related to the first function extracted in the first source program matches the type of each variable related to the first function extracted in the second source program;
Whether the type of each variable related to the second function extracted in the first source program matches the type of each variable related to the second function extracted in the second source program;
It is determined whether the type of each variable related to the third function extracted in the first source program matches the type of each variable related to the third function extracted in the second source program. 5. The output determination device according to claim 4, wherein the second flow is not output when it is determined that they match, and the second flow is output when any of them does not match.
前記(h)である場合に、前記ソースプログラムを逆順に追跡することにより、前記フローから抽出された前記命令文から、前記(h)において一致しない前記変数を表す前記変数識別子が含まれる命令文のうち、最初に前記変数識別子を含む命令文に至る命令文列において、一致しない前記変数に値を設定する命令文を特定し、前記設定する命令文を構成する前記変数を特定し、特定した前記変数を表す前記変数識別子を変数情報手段に格納する第1変数手段
をさらに備え、
前記出力決定手段は、前記(h)において一致しない前記変数を表す前記変数識別子が、前記変数情報手段に含まれるか否かを判定し、含まれる場合に、前記第2フローを出力し、含まれない場合に、前記第2フローを出力しない
請求項4または請求項5に記載の出力判定装置。
In the case of (h), by tracing the source program in reverse order, the statement including the variable identifier representing the variable that does not match in (h) is extracted from the statement extracted from the flow. In the command statement string that first reaches the command statement including the variable identifier, the command statement that sets a value to the variable that does not match is specified, and the variable that constitutes the command statement to be set is specified and specified. First variable means for storing the variable identifier representing the variable in variable information means;
The output determining means determines whether or not the variable identifier representing the variable that does not match in (h) is included in the variable information means, and if included, outputs the second flow and includes The output determination device according to claim 4 or 5, wherein the second flow is not output when the second flow is not detected.
前記(h)である場合に、前記ソースプログラムを逆順に追跡することにより、前記フローから抽出された命令文から、前記(h)において一致しない前記変数を表す前記変数識別子が含まれる命令文のうち、最初に前記変数識別子を含む命令文に至る命令文列において、前記命令文が実行されるか否かを制御する制御命令文を特定し、前記制御命令文に含まれる前記変数を表す前記変数識別子を抽出し、抽出した前記変数識別子を前記変数情報手段に格納する第2変数手段
をさらに備え
前記出力決定手段は、一致しない前記変数を表す前記変数識別子が、前記変数情報手段に含まれるか否かを判定する
請求項6に記載の出力判定装置。
In the case of (h), by tracing the source program in reverse order, the instruction sentence including the variable identifier representing the variable that does not match in (h) is extracted from the instruction sentence extracted from the flow. Among them, in a command statement string that first reaches a command statement including the variable identifier, a control command statement that controls whether or not the command statement is executed is specified, and the variable that is included in the control command statement is represented. The variable information means further includes second variable means for extracting the variable identifier and storing the extracted variable identifier in the variable information means. The output determining means includes the variable identifier representing the variable that does not match. The output determination apparatus according to claim 6.
前記(h)である場合に、前記ソースプログラムを逆順に追跡することにより、前記第2変数手段が抽出した前記変数識別子に、値を設定する設定命令文を特定し、該特定した前記設定命令文にて前記値を算出する基となる前記変数識別子を特定し、特定した前記変数識別子を前記変数情報手段に格納する第3変数手段
をさらに備える
請求項7に記載の出力判定装置。
In the case of (h), by tracing the source program in reverse order, a setting command statement for setting a value is specified in the variable identifier extracted by the second variable means, and the specified setting command The output determination device according to claim 7, further comprising third variable means for specifying the variable identifier that is a basis for calculating the value in a sentence and storing the specified variable identifier in the variable information means.
情報処理装置が、
ソースプログラムを静的に解析する静的解析手段が、前記ソースプログラムから抽出したフローと、前記フローから抽出した命令文とに基づき、前記ソースプログラムにおいて前記命令文を含む第1関数を特定し、特定した前記第1関数に関して、関数を一意に識別可能な関数識別子を第1関数識別子として抽出し、
前記ソースプログラムにおいて、前記第1関数識別子が表す前記関数を呼び出す第2関数を特定し、特定した前記第2関数を表す第2関数識別子を抽出するとともに、前記ソースプログラムにおいて前記第1関数識別子が表す前記関数が呼び出す第3関数を特定し、特定した前記第3関数を表す第3関数識別子を抽出し、
第1ソースプログラムにおいて抽出された前記第1関数識別子と、第2ソースプログラムにおいて抽出された前記第1関数識別子とが一致するか否か、前記第1ソースプログラムにおいて抽出された前記第2関数識別子と、前記第2ソースプログラムにおいて抽出された前記第2関数識別子とが一致するか否か、及び、前記第1ソースプログラムにおいて抽出された前記第3関数識別子と、前記第2ソースプログラムにおいて抽出された前記第3関数識別子とが一致するか否かを判定し、(a)いずれも一致すると判定した場合に、前記静的解析手段が前記第2ソースプログラムにおいて抽出した第2フローを出力せず、(b)いずれかが一致しないと判定した場合に、前記第2フローを出力することを決定する出力判定方法。
Information processing device
Static analysis means for statically analyzing a source program specifies a first function including the instruction sentence in the source program based on the flow extracted from the source program and the instruction sentence extracted from the flow, With respect to the identified first function, a function identifier that can uniquely identify the function is extracted as a first function identifier,
In the source program, a second function that calls the function represented by the first function identifier is identified, a second function identifier representing the identified second function is extracted, and in the source program, the first function identifier is Identifying a third function called by the function to be represented, extracting a third function identifier representing the identified third function;
Whether the first function identifier extracted in the first source program matches the first function identifier extracted in the second source program, whether the second function identifier extracted in the first source program And the second function identifier extracted in the second source program, the third function identifier extracted in the first source program, and the second source program extracted in the second source program Whether or not the third function identifier matches, and (a) does not output the second flow extracted by the static analysis means in the second source program when it is determined that both match. , (B) An output determination method for determining to output the second flow when it is determined that any of them does not match.
ソースプログラムを静的に解析する静的解析手段が、前記ソースプログラムから抽出したフローと、前記フローから抽出した命令文とに基づき、前記ソースプログラムにおいて前記命令文を含む第1関数を特定し、特定した前記第1関数に関して、関数を一意に識別可能な関数識別子を第1関数識別子として抽出する処理抽出機能と、
前記ソースプログラムにおいて、前記第1関数識別子が表す前記関数を呼び出す第2関数を特定し、特定した前記第2関数を表す第2関数識別子を抽出するとともに、前記ソースプログラムにおいて前記第1関数識別子が表す前記関数が呼び出す第3関数を特定し、特定した前記第3関数を表す第3関数識別子を抽出する関数抽出機能と、
第1ソースプログラムにおいて抽出された前記第1関数識別子と、前記第2ソースプログラムにおいて抽出された前記第1関数識別子とが一致するか否か、前記第1ソースプログラムにおいて抽出された前記第2関数識別子と、前記第2ソースプログラムにおいて抽出された前記第2関数識別子とが一致するか否か、及び、前記第1ソースプログラムにおいて抽出された前記第3関数識別子と、前記第2ソースプログラムにおいて抽出された前記第3関数識別子とが一致するか否かを判定し、(a)いずれも一致すると判定した場合に、前記静的解析手段が第2ソースプログラムにおいて抽出した第2フローを出力せず、(b)いずれかが一致しないと判定した場合に、前記第2フローを出力することを決定する出力決定機能と
をコンピュータに実現させる出力判定プログラム。
Static analysis means for statically analyzing a source program specifies a first function including the instruction sentence in the source program based on the flow extracted from the source program and the instruction sentence extracted from the flow, A process extraction function for extracting, as the first function identifier, a function identifier that can uniquely identify the function with respect to the identified first function;
In the source program, a second function that calls the function represented by the first function identifier is identified, a second function identifier representing the identified second function is extracted, and in the source program, the first function identifier is A function extraction function for identifying a third function called by the function to be represented and extracting a third function identifier representing the identified third function;
Whether the first function identifier extracted in the first source program matches the first function identifier extracted in the second source program, whether the second function extracted in the first source program Whether the identifier matches the second function identifier extracted in the second source program, and the third function identifier extracted in the first source program, and extracted in the second source program It is determined whether or not the third function identifier matches, and (a) when it is determined that both match, the second flow extracted by the static analysis means in the second source program is not output. , (B) an output determination function for determining that the second flow is output when it is determined that either of them does not match. Output judgment program to be realized
JP2015002765A 2015-01-09 2015-01-09 Output determination device, output determination method, output determination program, and static analysis device Pending JP2016128941A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015002765A JP2016128941A (en) 2015-01-09 2015-01-09 Output determination device, output determination method, output determination program, and static analysis device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015002765A JP2016128941A (en) 2015-01-09 2015-01-09 Output determination device, output determination method, output determination program, and static analysis device

Publications (1)

Publication Number Publication Date
JP2016128941A true JP2016128941A (en) 2016-07-14

Family

ID=56384325

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015002765A Pending JP2016128941A (en) 2015-01-09 2015-01-09 Output determination device, output determination method, output determination program, and static analysis device

Country Status (1)

Country Link
JP (1) JP2016128941A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018003531A1 (en) 2016-06-29 2018-01-04 三菱瓦斯化学株式会社 Pyrroloquinone quinone monosodium, method for manufacturing same, and composition including same.
US11281566B2 (en) 2018-07-23 2022-03-22 Mitsubishi Electric Corporation Scoring device, computer readable medium, and scoring method
JP7331679B2 (en) 2018-12-21 2023-08-23 富士通株式会社 Determining Information Leakage in Computer Readable Programs

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018003531A1 (en) 2016-06-29 2018-01-04 三菱瓦斯化学株式会社 Pyrroloquinone quinone monosodium, method for manufacturing same, and composition including same.
US11281566B2 (en) 2018-07-23 2022-03-22 Mitsubishi Electric Corporation Scoring device, computer readable medium, and scoring method
JP7331679B2 (en) 2018-12-21 2023-08-23 富士通株式会社 Determining Information Leakage in Computer Readable Programs

Similar Documents

Publication Publication Date Title
US11579856B2 (en) Multi-chip compatible compiling method and device
US20110126179A1 (en) Method and System for Dynamic Patching Software Using Source Code
JP6268029B2 (en) Test case generation apparatus and test case generation method
US20110145799A1 (en) Path-sensitive dataflow analysis including path refinement
CN111090433A (en) Data processing method, device and storage medium
JP5303795B2 (en) Application analysis method, analysis system, and analysis program
US9396097B2 (en) Methods, circuits, devices, systems and associated computer executable code for testing software code
JP2016128941A (en) Output determination device, output determination method, output determination program, and static analysis device
JP6759851B2 (en) Program generation program, program generation method, program generator and compilation program
US8839217B2 (en) Efficiently solving the “use-def” problem involving label variables
JP6567212B2 (en) Equivalence verification device and equivalence verification program
JP6945768B2 (en) Detection device, detection method, and detection program
US9396239B2 (en) Compiling method, storage medium and compiling apparatus
JP4888790B2 (en) Contract definition function verification apparatus, method and program thereof
US20150082278A1 (en) Clone detection method and clone function commonalizing method
JP5811859B2 (en) Source code static analysis device, system, method, and program therefor
JP6665576B2 (en) Support device, support method, and program
JP2014126900A (en) Program analysis device, program analysis method, and program analysis program
JP2018124901A (en) Program analyzing apparatus, program analyzing method, and program analyzing program
JP5595304B2 (en) Program test apparatus, program test apparatus program test method, and program test program
JP5755861B2 (en) Test case generation apparatus, test case generation method, and test case generation program
JP2009129133A (en) Software partial test system, software partial test method, and program for software partial test
CN111143229A (en) Software testing method and device, computer equipment and computer readable storage medium
JP2018147114A (en) Test case generation method, computer, and program
CN116774988B (en) Method and device for releasing frame package mode symbol dependence