JP2016071774A - Verification support device, verification support method, and computer program - Google Patents
Verification support device, verification support method, and computer program Download PDFInfo
- Publication number
- JP2016071774A JP2016071774A JP2014202868A JP2014202868A JP2016071774A JP 2016071774 A JP2016071774 A JP 2016071774A JP 2014202868 A JP2014202868 A JP 2014202868A JP 2014202868 A JP2014202868 A JP 2014202868A JP 2016071774 A JP2016071774 A JP 2016071774A
- Authority
- JP
- Japan
- Prior art keywords
- group
- groups
- information
- defect candidate
- source code
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Abstract
Description
本発明は、開発中のコンピュータプログラム(ソフトウェア)を検査する技術に関する。 The present invention relates to a technique for inspecting a computer program (software) under development.
近年のソフトウェア(コンピュータプログラム)開発において、開発規模の拡大により、ソフトウェア(ソースプログラム)におけるソースコードの論理的な誤り(不具合)を摘出する作業は多大な手間と時間を要するようになってきている。このため、その摘出作業を補助するために、ソフトウェアを実行せずにソースコードを解析することによって、ソースコードの不具合を指摘するツール(以下、静的解析ツールとも記載する)が開発されている。そのようなツールは、例えば、検査対象のソースプログラムのソースコードが入力すると、当該ツール(システム)内部で独自のプログラムフローを構築し、バグやセキュリティ脆弱性について検査し、検査結果を出力する。 In recent software (computer program) development, with the expansion of development scale, the work of extracting logical errors (problems) in the source code in software (source program) has become very time-consuming and time-consuming. . For this reason, in order to assist the extraction work, a tool that points out a bug in the source code by analyzing the source code without executing the software (hereinafter also referred to as a static analysis tool) has been developed. . For example, when the source code of a source program to be inspected is input, such a tool constructs a unique program flow inside the tool (system), inspects for bugs and security vulnerabilities, and outputs inspection results.
このような静的解析ツールを利用することにより、ソフトウェアの開発時間の短縮化を図ることができる。しかしながら、汎用の静的解析ツールは、検査対象のソースプログラムにおいて、実際には不具合が発生しないのに不具合が発生する虞があるとの指摘(検査結果)を数多く出力してしまう。このため、プログラム開発者は、その指摘(検査結果)の検証(確認)に無用な時間を取られる場合がある。 By using such a static analysis tool, it is possible to shorten the software development time. However, the general-purpose static analysis tool outputs a large number of indications (inspection results) that there is a possibility that a problem may occur in the source program to be inspected even though the problem does not actually occur. For this reason, the program developer may take unnecessary time for verification (confirmation) of the indication (inspection result).
このようなプログラム開発者の負担を軽減するために、例えば、特許文献1には、次のような技術が開示されている。その技術とは、不具合発生の虞があると静的解析ツールにより指摘(判断)されたプログラム部分の位置情報や種別情報に基づいて、不具合を指摘された複数のプログラム部分をグループ分けする技術である。また、特許文献2には、ソースコードの構文情報を基に、不具合を指摘された複数のプログラム部分間の類似度を算出し、類似度の高いプログラム部分の対(ペア)を提示する技術が開示されている。
In order to reduce the burden on such a program developer, for example,
特許文献1に開示されている技術では、不具合を指摘されたプログラム部分がグループ分けされた状態で提示される。そのグループ分けの判断基準となる情報は、プログラム部分の位置情報や種別情報である。これら情報は不具合が発生するか否かの検証に役立つ情報ではないことから、不具合を指摘されたプログラム部分がグループ分けされた状態で提示されても、それらプログラム部分の検証作業の時間短縮化を図ることは難しい。
In the technique disclosed in
また、特許文献2の技術では、類似度の高いプログラム部分の対が提示されるが、それら対のうちの一方が、検証により不具合が発生しない正常なプログラム部分であると判断されても、他方も不具合が発生しないとは言い切れない。このため、対を成すプログラム部分の両方共に検証する必要があり、特許文献2に開示されている技術も、検証作業の時間短縮化を図ることは難しい。
Further, in the technique of
本発明は上記課題を解決するために考え出された。すなわち、本発明の主な目的は、静的解析ツールによる検査結果を検証する作業に要する時間を短縮化する技術を提供することにある。 The present invention has been devised to solve the above problems. That is, the main object of the present invention is to provide a technique for shortening the time required for the work of verifying the inspection result by the static analysis tool.
上記目的を達成するために、本発明の検証支援装置は、
コンピュータにより実行される複数の処理のそれぞれの処理手順を表す複数のソースコード行が配列されている検査済みのソースプログラムに付加されている検査結果情報に基づいて、前記検査済みのソースプログラムに従って実行可能な複数の前記処理のうち、不具合が発生する虞がある前記処理に関連する前記ソースコード行のグループを不具合候補コード群として前記検査済みのソースプログラムから抽出し、また、前記不具合候補コード群を構成する複数の前記ソースコード行を、不具合が発生する前記ソースコード行である発現行を含む発現グループと、その不具合の要因となる前記ソースコード行である要因行を含む要因グループとに分けるデータ作成部と、
前記データ作成部により抽出された前記不具合候補コード群が複数であった場合に、それら抽出された前記不具合候補コード群における前記発現グループ同士および前記要因グループ同士の類似度を算出する算出部と、
前記算出部により算出された前記類似度の情報を含む情報を提示する支援部と
を備える。
In order to achieve the above object, the verification support apparatus of the present invention provides:
Execution according to the inspected source program based on inspection result information added to the inspected source program in which a plurality of source code lines representing respective processing steps of the plurality of processes executed by the computer are arranged Among the plurality of possible processes, a group of the source code lines related to the process that may cause a defect is extracted as a defect candidate code group from the inspected source program, and the defect candidate code group Are divided into an expression group including an expression line that is the source code line in which a defect occurs and a factor group including a factor line that is the source code line that causes the defect. A data creation unit;
When there are a plurality of defect candidate code groups extracted by the data creation unit, a calculation unit that calculates the similarity between the expression groups and the factor groups in the extracted defect candidate code groups,
A support unit that presents information including information on the similarity calculated by the calculation unit.
また、本発明の検証支援方法は、
コンピュータにより実行される複数の処理のそれぞれの処理手順を表す複数のソースコード行が配列されている検査済みのソースプログラムに付加されている検査結果情報に基づいて、前記検査済みのソースプログラムに従って実行可能な複数の前記処理のうち、不具合が発生する虞がある前記処理に関連する前記ソースコード行のグループを不具合候補コード群として前記検査済みのソースプログラムから抽出し、
また、前記不具合候補コード群を構成する複数の前記ソースコード行を、不具合が発生する前記ソースコード行である発現行を含む発現グループと、その不具合の要因となる前記ソースコード行である要因行を含む要因グループとに分け、
前記抽出された前記不具合候補コード群が複数であった場合に、それら抽出された前記不具合候補コード群における前記発現グループ同士および前記要因グループ同士の類似度を算出し、
その算出された前記類似度の情報を含む情報を提示する。
Further, the verification support method of the present invention includes:
Execution according to the inspected source program based on inspection result information added to the inspected source program in which a plurality of source code lines representing respective processing steps of the plurality of processes executed by the computer are arranged Among the plurality of possible processes, a group of the source code lines related to the process that may cause a defect is extracted from the inspected source program as a defect candidate code group,
A plurality of source code lines constituting the defect candidate code group, an expression group including an expression line that is the source code line in which the defect occurs, and a factor line that is the source code line that causes the defect Divided into factor groups including
When there are a plurality of the extracted defect candidate code groups, calculate the similarity between the expression groups and the factor groups in the extracted defect candidate code groups,
Information including the calculated similarity information is presented.
さらに、本発明のコンピュータプログラムは、
コンピュータにより実行される複数の処理のそれぞれの処理手順を表す複数のソースコード行が配列されている検査済みのソースプログラムに付加されている検査結果情報に基づいて、前記検査済みのソースプログラムに従って実行可能な複数の前記処理のうち、不具合が発生する虞がある前記処理に関連する前記ソースコード行のグループを不具合候補コード群として前記検査済みのソースプログラムから抽出する処理と、
また、前記不具合候補コード群を構成する複数の前記ソースコード行を、不具合が発生する前記ソースコード行である発現行を含む発現グループと、その不具合の要因となる前記ソースコード行である要因行を含む要因グループとに分ける処理と、
前記抽出された前記不具合候補コード群が複数であった場合に、それら抽出された前記不具合候補コード群における前記発現グループ同士および前記要因グループ同士の類似度を算出する処理と、
その算出された前記類似度の情報を含む情報を提示する処理と
をコンピュータに実行させる処理手順が表されている。
Furthermore, the computer program of the present invention is
Execution according to the inspected source program based on inspection result information added to the inspected source program in which a plurality of source code lines representing respective processing steps of the plurality of processes executed by the computer are arranged A process of extracting from the inspected source program a group of source code lines related to the process that may cause a failure among the plurality of possible processes as a defect candidate code group;
A plurality of source code lines constituting the defect candidate code group, an expression group including an expression line that is the source code line in which the defect occurs, and a factor line that is the source code line that causes the defect Processing to be divided into factor groups including
When there are a plurality of the extracted defect candidate code groups, a process of calculating the similarity between the expression groups and the factor groups in the extracted defect candidate code groups;
A processing procedure for causing a computer to execute a process of presenting information including the calculated similarity information is shown.
なお、本発明の前記主な目的は、本発明の検証支援装置に対応する本発明の検証支援方法によっても達成される。また、本発明の前記主な目的は、本発明の検証支援装置および検証支援方法に対応するコンピュータプログラムによっても達成される。 The main object of the present invention is also achieved by the verification support method of the present invention corresponding to the verification support apparatus of the present invention. The main object of the present invention is also achieved by a computer program corresponding to the verification support apparatus and verification support method of the present invention.
本発明によれば、コンピュータプログラムのソースコードに対する検査の結果を検証する作業に要する時間を短縮化できる。 ADVANTAGE OF THE INVENTION According to this invention, the time which the operation | work which verifies the result of the test | inspection with respect to the source code of a computer program can be shortened.
以下に、本発明に係る実施形態を図面を参照しつつ説明する。 Embodiments according to the present invention will be described below with reference to the drawings.
<第1実施形態>
図1は、本発明に係る検証支援装置の構成を簡略化して表すブロック図である。この第1実施形態の検証支援装置1は、検査対象のソースプログラム(コンピュータプログラム)に対する検査結果が正しいか否かを検証する作業を支援する装置である。すなわち、ソースプログラムとは、コンピュータにより実行される複数の処理のそれぞれの処理手順(処理フロー)を表す複数のソースコード行が配列されているものである。第1実施形態の検証支援装置1は、例えば静的解析ツールによる検査結果の情報が付加された検査済みのソースプログラムが入力すると、当該ソースプログラムの検査結果に対する検証作業を支援する情報を作成し、当該情報を提示する。
<First Embodiment>
FIG. 1 is a block diagram showing a simplified configuration of a verification support apparatus according to the present invention. The
この検証支援装置1は、例えばCPU(Central Processing Unit)を備えたコンピュータ装置であり、記憶装置6から読み出したコンピュータプログラム(以下、プログラムとも記載する)7を実行することにより、次のような機能を持つ。なお、記憶装置7は、検証支援装置1に内蔵されている場合もあるし、外付けである場合もある。
The
すなわち、第1実施形態では、検証支援装置1は、機能部として、データ作成部2と、算出部3と、支援部4とを有している。
That is, in the first embodiment, the
データ作成部2は、検査済みのソースプログラムに付加されている検査結果情報に基づいて、不具合が発生する虞があると判断された処理(処理フロー)に関連するソースコード行のグループを検査済みのソースプログラムから抽出する機能を備えている。ここでは、その抽出されたソースコード行のグループを不具合候補コード群と呼ぶ。
The
また、データ作成部2は、不具合候補コード群を構成する複数のソースコード行を、不具合が発生するソースコード行である発現行を含む発現グループと、その要因となるソースコード行である要因行を含む要因グループとに分ける機能を備えている。
In addition, the
算出部3は、データ作成部2により複数の不具合候補コード群が抽出された場合に、それら抽出された不具合候補コード群における発現グループ同士および要因グループ同士の類似度を算出する機能を備えている。
The
支援部4は、算出部3により算出された類似度の情報を含む情報を提示する機能を備えている。例えば、支援部4は、算出部3により算出された類似度の情報を表示要求と共にディスプレイ装置(表示装置)に出力する。これにより、その類似度の情報がディスプレイ装置に表示されることにより、当該類似度の情報を例えばプログラム開発者に提示できる。また、支援部4は、その類似度の情報を印刷要求と共にプリンタに出力する。これにより、類似度の情報がプリンタにより印刷されることによって、当該類似度の情報を例えばプログラム開発者に提示できる。
The
この第1実施形態の検証支援装置1は上記のような構成を備えていることにより、ソースプログラムの検査結果に対する検証作業の効率化を図ることができる。すなわち、この第1実施形態の検証支援装置1は、不具合候補コード群をさらに発現グループと要因グループに分け、発現グループ同士および要因グループ同士の類似度を算出している。
Since the
不具合候補コード群による処理手順(処理フロー)が一部でも正当でない(換言すれば、静的解析ツールの性能の限界に起因する、有り得ないソースコードの実行過程(処理フロー)が不具合候補コード群に含まれる)場合には、その不具合候補コード群に対する検査結果は正当ではない。このことから、発現グループと要因グループの検査結果(不具合が発生する虞があるという結果)が両方共に正当である場合にのみ、その発現グループと要因グループを含む不具合候補コード群の検査結果(不具合が発生する虞があるという結果)は正当であると判断でき、その不具合候補コード群は、より重点的に検証すべき対象であると判断できる。換言すれば、発現グループと要因グループの少なくとも一方の検査結果が正当でない場合には、不具合候補コード群に対する検査結果は正当でない。つまり、不具合候補コード群に対する検査結果は誤りであって不具合が発生する確率が低いと想定されるから、当該不具合候補コード群は、プログラム開発者による検証作業の必要性が低い。 Even if a part of the processing procedure (processing flow) by the defect candidate code group is not valid (in other words, the impossible source code execution process (processing flow) due to the performance limit of the static analysis tool is the defect candidate code group. In the case of the error candidate code group, the inspection result for the defect candidate code group is not valid. Therefore, only when the test result of the expression group and the factor group (result that there is a possibility of occurrence of a defect) are both valid, the test result of the defect candidate code group including the expression group and the factor group (defects) As a result, the defect candidate code group can be determined to be an object to be verified more carefully. In other words, when the test result of at least one of the expression group and the factor group is not valid, the test result for the defect candidate code group is not valid. That is, since the inspection result for the defect candidate code group is assumed to be erroneous and the probability of occurrence of the defect is low, the defect candidate code group is less required to be verified by the program developer.
例えば、不具合候補コード群の発現グループと、検査結果が正当であることが分かっている発現グループとの類似度が高い(似ていている)場合には、その不具合候補コード群の発現グループの検査結果は正当である可能性(正当性)が高いと想定される。また同様に、不具合候補コード群の要因グループと、検査結果が正当であることが分かっている要因グループとの類似度が高い(似ていている)場合には、その不具合候補コード群の要因グループの検査結果は正当である可能性(正当性)が高いと想定される。このようなことから、検査結果が正当であることが分かっている発現グループと要因グループとの類似度の情報に基づいて、不具合候補コード群の発現グループと要因グループに対する検査結果の正当性を判断することが可能である。そして、このような類似度を利用した正当性判断により、不具合候補コード群の発現グループおよび要因グループの検査結果が共に正当であると判断した場合には、その不具合候補コード群のソースコードは検証すべき対象であると判断することができる。反対に、不具合候補コード群の発現グループと要因グループの少なくとも一方の検査結果が正当でない場合には、その不具合候補コード群は検証作業の対象から外すことができる。これにより、第1実施形態の検証支援装置1により提示される情報によって、検証作業は軽減されることから、第1実施形態の検証支援装置1は、検証作業に要する時間の短縮化を図ることができる。
For example, if the similarity between the expression group of the defect candidate code group and the expression group whose test result is known to be valid is high (similar), the test of the expression group of the defect candidate code group It is assumed that the result is likely to be valid (validity). Similarly, if the similarity between the factor group of the defect candidate code group and the factor group whose test result is known to be valid is high (similar), the factor group of the defect candidate code group It is assumed that there is a high possibility (validity) that the test result is valid. For this reason, the validity of the test results for the expression group and the factor group of the defect candidate code group is determined based on the similarity information between the expression group and the factor group whose test results are known to be valid. Is possible. If it is determined by the validity judgment using such similarity that the inspection results of the defect candidate code group and the cause group are both valid, the source code of the defect candidate code group is verified. It can be determined that it is a target. On the other hand, when the test result of at least one of the expression group and the factor group of the defect candidate code group is not valid, the defect candidate code group can be excluded from the verification work. As a result, the verification work is reduced by the information presented by the
<第2実施形態>
以下に、本発明に係る第2実施形態を説明する。
Second Embodiment
The second embodiment according to the present invention will be described below.
図2は、第2実施形態の検証支援装置の構成を簡略化して表すブロック図である。この検証支援装置10は、第1実施形態の検証支援装置1と同様に、静的解析ツール25によるソースプログラム(アプリケーションプログラム)の検査結果に対する検証作業を支援する情報を提示する装置である。また、検証支援装置10は、第1実施形態の検証支援装置1と同様に、コンピュータ装置により構成されており、記憶装置11から読み出したコンピュータプログラム12を実行することにより、次のような機能を持つことができる。なお、記憶装置11は、検証支援装置10に内蔵されている場合もあるし、外付けである場合もある。
FIG. 2 is a block diagram illustrating a simplified configuration of the verification support apparatus according to the second embodiment. Similar to the
すなわち、検証支援装置10は、機能部として、取得部14と、抽出部15と、算出部16と、確率計算部17と、出力部18と、記憶部19とを備えている。
That is, the
記憶部19は、各種の情報(データやプログラム)を格納する記憶媒体を有して構成されている。記憶部19には、取得部14と抽出部15と算出部16と確率計算部17と出力部18により、情報が書き込まれ、また、それら取得部14と抽出部15と算出部16と確率計算部17と出力部18により、記憶部19から情報が読み出される。
The
取得部14は、静的解析ツール25による検査の実行結果の情報(検査結果情報)が付加されている検査済みのソースプログラムを例えば静的解析ツール25から取得する機能を備えている。さらに、取得部14は、次のような指摘情報一覧を作成し、記憶部19に書き込む機能を備えている。指摘情報一覧とは、不具合候補コード群(指摘フロー)と、当該不具合候補コード群を識別するために当該不具合候補コード群に付与された識別番号(指摘番号)とが関連付けられている情報である。なお、不具合候補コード群とは、第1実施形態でも述べた不具合候補コード群と同様に、静的解析ツール25により不具合発生の虞があると指摘(判断)された処理(処理フロー)を表すソースコード行のグループである。
The
図3は、検査対象のソースプログラムの具体例と、そのソースプログラムが静的解析ツール25により検査された結果に基づいて取得部14が作成する指摘情報一覧の具体例とを表す図である。
FIG. 3 is a diagram illustrating a specific example of a source program to be inspected and a specific example of an indication information list created by the
図3に表されている例では、静的解析ツール25により検査が実行されたソースプログラムには、“発現”と“要因”の情報が静的解析ツール25による検査結果情報(付加情報)として付加されている。“発現”の情報は、付加されているソースコード行(図3の例では、行番号7,10のソースコード行)が、不具合が発生する虞があるソースコード行(発現行)であることを表す情報である。“要因”の情報は、付加されているソースコード行(図3の例では、行番号2のソースコード行)が、その不具合発生の要因となるソースコード行(要因行)であることを表す情報である。
In the example shown in FIG. 3, information on “expression” and “factor” is included as test result information (additional information) by the
抽出部15は、不具合候補コード群を構成する複数のソースコード行を要因グループと発現グループに分ける機能を備えている。発現グループとは、不具合を発生する処理手順(処理フロー)を表すソースコード行のグループであり、発現行を含んでいる。要因グループとは、その不具合の要因となる処理手順(処理フロー)を表すソースコード行のグループであり、要因行を含んでいる。
The
図4は、不具合候補コード群の具体例と、その不具合候補コード群を抽出部15がグループ分けした具体例とを表す図である。この具体例に表されているように、例えば、抽出部15は、不具合候補コード群が表す処理手順を開始するソースコード行から要因行(“要因”の情報が付加されているソースコード行)までの処理手順を表すソースコード行のグループを要因グループとして抽出する。また、抽出部15は、要因行の次の処理手順を表すソースコード行から発現行(“発現”の情報が付加されているソースコード行)に至るまでのソースコード行のグループを発現グループとして抽出する。換言すれば、抽出部15は、不具合候補コード群を要因行に基づいて2つのグループに分ける。
FIG. 4 is a diagram illustrating a specific example of a defect candidate code group and a specific example in which the
抽出部15は、さらに、そのようにグループ分けした情報を含めた不具合候補コード群を表す情報を更新指摘情報一覧22として記憶部19に書き込む機能を備えている。
The
さらに、抽出部15は、グループ分けの結果情報に基づいて、図5(a)に表されるような正当性判断情報一覧23を作成する機能を備えている。正当性判断情報一覧23とは、不具合候補コード群の要因グループおよび発現グループのそれぞれに対する検査結果の正当性についてプログラム開発者が検証し、当該検証の結果が書き込まれる例えばテーブルデータである。なお、抽出部15が作成する正当性判断情報一覧23は、プログラム開発者が正当性判断結果を入力する前に作成される。このため、抽出部15が作成する正当性判断情報一覧23において、図5(a)のように、全てのグループにそれぞれ関連付けられている正当性判断結果の情報は、“未判断”を表す情報(横棒(−))である。
Further, the
この第2実施形態では、取得部14および抽出部15が、静的解析ツール25による検査済みのソースプログラムから不具合候補コード群を抽出し、さらに、不具合候補コード群を要因グループと発現グループに分けるデータ作成部を構成する。
In the second embodiment, the
算出部16は、全ての不具合候補コード群における要因グループ同士および発現グループ同士の類似度を算出する機能を備えている。図6(a)は、算出部16により算出された要因グループ同士の類似度の具体例を表すテーブルデータである。図6(b)は、算出部16により算出された発現グループ同士の類似度の具体例を表すテーブルデータである。
The
算出部16が類似度を算出する手法には様々な手法が有り、ここでは、何れの手法を採用してもよいが、その一例を挙げると、例えば、最長共通部分列を行単位で利用する算出手法が有る。この算出手法は、例えば、参考文献:T.コルメン、他8名著、「アルゴリズムの設計と解析手法 (アルゴリズムイントロダクション)」、株式会社近代科学社、2007年3月に示されている。図6(a)、(b)は、その最長共通部分列を利用して算出された類似度の算出例である。
There are various methods by which the
あるいは、算出部16は、編集距離(レーベンシュタイン距離)やn-グラム頻度に基づいて類似度を算出する手法により、グループ同士の類似度を算出してもよい。このように、算出部16が類似度を算出する手法には様々な手法が有り、これら手法の中から、不具合候補コード群の特徴に応じた分析が可能な手法が適宜選択され算出部16が類似度を算出する手法として採用してよい。なお、類似度を算出する手法を選択する際の参考文献として、竹田正幸、福田智子著、「古典和歌からの知識発見 モビルスーツを着た国文学者」、情報処理学会論文誌、Vol.43、No.9、2002年9月、p.941−949がある。
Alternatively, the
算出部16は、上記のように算出した類似度の情報を例えば記憶部19に保持されている図6(a)および(b)のようなテーブルデータに書き込む機能を有する。なお、記憶部19が保持する類似度の情報の形態はテーブルデータの態様に限定されない。
The
出力部18は、記憶部19に格納されている情報や、当該検証支援装置10の制御動作に必要な情報の入力をプログラム開発者に促す情報を、例えばディスプレイ装置(図示せず)に出力する機能を備えている。そのディスプレイ装置は、出力部18から受けた情報を表示する機能を備えている。
The
例えば、出力部18は、プログラム開発者に向けて、正当性判断情報を例えばキーボード等の入力装置を利用して入力することを促す情報をディスプレイ装置(表示装置)に出力する機能を備えている。この出力部18の機能によってディスプレイ装置に表示された情報に基づいて、プログラム開発者が入力装置により入力した正当性判断情報は、書き込み部(図示せず)によって、記憶部19における図5(a)のような正当性判断情報一覧23に書き込まれる。
For example, the
図5(b)は、正当性判断情報一覧23に正当性判断情報が入力された(書き込まれた)状態の一例を表す図である。この図5(b)において、プログラム開発者が実際に問題が発生し得るソースコードの実行過程であると判断したグループ(例えば、識別番号“1”の要因グループを参照)には、静的解析ツール25の検査結果が正しい、つまり、“正当性有り”を表す情報(丸印(○))が正当性判断情報として関連付けられている。また、プログラム開発者が、静的解析ツール25の検査結果は有り得ないソースコードの実行過程である、つまり、検査結果が誤りで検証作業が不要であると判断したグループ(例えば、識別番号“1”の発現グループなどを参照)には、検査結果の“正当性無し”を表す情報(バツ印(×))が正当性判断情報として関連付けられている。さらに、前述したように、プログラム開発者が検証していないグループには、“未判断”を表す情報(横棒(−))が正当性判断情報として関連付けられている。
FIG. 5B is a diagram illustrating an example of a state in which the validity determination information is input (written) in the validity
確率計算部17は、要因グループおよび発現グループに対して、算出部16により算出された類似度の情報と、プログラム開発者による正当性判断情報とに基づいて、静的解析ツール25による検査結果の信頼性の度合い(信頼度)を算出する機能を備えている。ここでは、確率計算部17は、プログラム開発者が検証していない要因グループあるいは発現グループ(つまり、正当性判断情報として“未判断”が関連付けられているグループ)について、検査結果の信頼度を算出する。例えば、図5(b)に表されている例では、識別番号“2”を持つ不具合候補コード群の要因グループと発現グループおよび識別番号“3”を持つ不具合候補コード群の要因グループについて、確率計算部17は、算出動作を実行する。例えば、確率計算部17は、要因グループと発現グループのそれぞれにおいて、識別番号“i”を持つ不具合候補コード群における信頼度P(i)を次の数式(1)に従って算出する。
The
なお、数式(1)におけるNは、全ての不具合候補コード群の数を表す。F(i,j)は、識別番号“i”の不具合候補コード群と識別番号“j”の不具合候補コード群の要因グループ同士あるいは発現グループ同士の、算出部16により算出された類似度を表す。B(j)は、次に表される条件に従った数値を表す。
Note that N in Equation (1) represents the number of all defect candidate code groups. F (i, j) represents the similarity calculated by the
さらに、確率計算部17は、算出した結果(検査結果の信頼度)を記憶部19に書き込む機能を備えている。図7は、記憶部19が保持する、算出結果を表す信頼度一覧24の一例を表す図である。出力部18が、例えば、その信頼度一覧24をディスプレイ装置に出力することにより、当該信頼度一覧24がディスプレイ装置に表示され、プログラム開発者に提示される。なお、この第2実施形態では、確率計算部17と出力部18により、静的解析ツール25による検査結果に対する検証作業を支援する情報を提示する支援部が構成される。
Further, the
この第2実施形態の検証支援装置10は、上記のように構成されている。次に、この検証支援装置10における動作の一例を図8を利用して説明する。なお、図8は、検証支援装置10における動作の一例を表すフローチャートであり、このフローチャートは、検証支援装置(コンピュータ装置)10が実行するコンピュータプログラムの処理手順を表す。
The
例えば、検証支援装置10の取得部14は、静的解析ツール25により検査された検査結果情報を含む検査済みのソースプログラムを取得すると(ステップS101)、当該ソースプログラムから不具合候補コード群を抽出する(ステップS102)。そして、取得部14は、例えば図3に表されるような指摘情報一覧21を作成し、当該指摘情報一覧21の情報を記憶部19に書き込む。
For example, when the
然る後に、抽出部15が、静的解析ツール25による検査結果情報(付加情報)に基づいて、各不具合候補コード群を、要因グループと発現グループにグループ分けする(ステップS103)。そして、抽出部15は、図4に表されるような更新指摘情報一覧22を作成し、この情報を記憶部19に書き込む。
Thereafter, the
その後、算出部16は、その更新指摘情報一覧22によるグループ分け情報に基づいた要因グループ同士および発現グループ同士の類似度を算出する(ステップS104)。そして、算出部16は、例えば図6(a)、(b)のような算出結果の情報を記憶部19に書き込む。
Thereafter, the
一方、抽出部15は、図5(a)に表されるような正当性判断情報一覧23を作成し、当該正当性判断情報一覧23の情報を記憶部19に書き込む。
On the other hand, the
その後、出力部18が、不具合候補コード群の情報と、例えばキーボード等の入力装置を利用して正当性判断情報を入力することを促す情報とをディスプレイ装置(表示装置)に出力する。これにより、ディスプレイ装置が、不具合候補コード群の情報と、正当性判断情報の入力を促す情報とを表示する。これにより、プログラム開発者が正当性判断情報を入力したことにより、正当性判断情報を取得すると(ステップS105)、検証支援装置10は、取得した正当性判断情報を記憶部19の正当性判断情報一覧23に図5(b)のように書き込む。
Thereafter, the
その後、確率計算部17は、予め定められたタイミングでもって、正当性判断情報一覧23に、“未判断”の情報が関連付けられているグループが有るか否かを判断する(ステップS106)。その予め定められたタイミングとは、例えば、正当性判断情報一覧23に情報が書き込まれ、かつ、計算実行の指令が例えばプログラム開発者により入力装置を利用して検証支援装置10に入力されたときである。
After that, the
そして、確率計算部17は、“未判断”のグループが有ると判断した場合には、算出部16による類似度の情報と、プログラム開発者による正当性判断結果の情報とに基づき、“未判断”のグループに対する検査結果の信頼度を算出する(ステップS107)。確率計算部17は、その算出結果を記憶部19に書き込む。
If the
然る後に、出力部18が、その算出結果および当該算出結果の表示要求を、ディスプレイ装置(表示装置)に出力する(ステップS108)。これにより、ディスプレイ装置が、算出結果を表示する。この際、例えば、“未判断”のグループに対する正当性判断情報の入力をプログラム開発者に促す情報もディスプレイ装置に表示されるようにする。これにより、例えば、正当性判断情報が記憶部19に新たに書き込まれたことを検知すると、確率計算部17は、ステップS106以降の動作を繰り返す。
Thereafter, the
また、確率計算部17は、ステップS106の判断動作により、“未判断”のグループが無いと判断した場合には、動作を終了する。これにより、検証支援装置10は、検証済みのソートプログラムの取得から信頼度の算出および出力に関連する一連の動作を終了する。
If the
この第2実施形態の検証支援装置10は、第1実施形態と同様に、静的解析ツール25による検査結果の検証作業の効率化に寄与することができる。特に、この第2実施形態の検証支援装置10は、確率計算部17を備え、静的解析ツール25による検査結果の信頼度を数値化して表示することを実現する構成を備えている。この構成は、不具合候補コード群の検証作業が実際に必要か否かの判断に有効な情報をプログラム開発者に提供できるので、より一層の検証作業の効率化に寄与するものである。
Similar to the first embodiment, the
<第3実施形態>
以下に、本発明に係る実施形態を説明する。なお、この第3実施形態の説明において、第2実施形態の検証支援装置の構成部分と同一名称部分には同一符号を付し、その共通部分の重複説明は省略する。
<Third Embodiment>
Embodiments according to the present invention will be described below. In the description of the third embodiment, the same reference numerals are given to the same names as the components of the verification support apparatus of the second embodiment, and the duplicate description of the common parts is omitted.
前述した第2実施形態では、抽出部15は、各不具合候補コード群のソースコード行をグループ分けした後に、図4に表されるように、それらグループ分けした情報の一部としてソースコード行がそのまま含まれている態様である。これに代えて、この第3実施形態では、抽出部15は、不具合候補コード群における各グループのソースコードを構文解析し、この構文解析に基づき、各グループに含まれるソースコードの一部を抽象化する構成を備えている。つまり、ソースプログラムに分岐構造を表す構文(例えばC言語では、if文やfor文)が含まれていない場合、そのソースプログラムにおいて、分岐条件の違いによる類似した不具合(指摘の亜種)が発生することは無い。つまり、分岐構造を含まない範囲でソースコードを抽象化しても、第2実施形態で述べたようなグループ同士の類似度には悪影響が及ばない。このことから、この第3実施形態では、抽出部15は、各グループにおいて、分岐構造を含まないソースプログラム部分の一部を、例えばハッシュ関数を用いた符号化により抽象化する。
In the second embodiment described above, the
この第3実施形態における上記以外の構成は、第2実施形態と同様である。 The other configuration of the third embodiment is the same as that of the second embodiment.
この第3実施形態の検証支援装置10は、第2実施形態と同様に、静的解析ツール25の検査に基づいた不具合候補コード群の中から、実際に検証する不具合候補コード群の絞り込みに有効な情報を例えばプログラム開発者に提供できる。これにより、第3実施形態の検証支援装置10も、検証作業に要する時間の短縮化を図ることができる。
As in the second embodiment, the
また、この第3実施形態の検証支援装置10は、類似度の算出に悪影響が及ばないように、各グループにおけるソースプログラムの一部を抽象化している。このため、この第3実施形態の検証支援装置10は、類似度の算出の効率化を図ることができる。
Also, the
<その他の実施形態>
なお、本発明は第1〜第3の実施形態に限定されず、様々な実施の形態を採り得る。例えば、第2と第3の実施形態では、検証支援装置10の出力部18は、確率計算部17による検査結果の信頼度を出力している。これに対し、出力部18は、検査結果の信頼度ではなく、算出部16により算出される各グループ同士の類似度を出力してもよい。この場合には、その出力された情報に基づいて、ディスプレイ装置は、各グループ同士の類似度を表示する。このような場合には、検証支援装置10における確率計算部17が省略されていてもよい。また、出力部18は、例えば装置操作者(プログラム開発者)が入力装置を利用して入力した指示情報に応じて、確率計算部17による検査結果の信頼度と、算出部16による類似度との一方を出力する構成としてもよい。
<Other embodiments>
In addition, this invention is not limited to the 1st-3rd embodiment, Various embodiment can be taken. For example, in the second and third embodiments, the
1,10 検証支援装置
2 データ作成部
3,16 算出部
4 支援部
15 抽出部
17 確率計算部
DESCRIPTION OF
Claims (6)
前記データ作成部により抽出された前記不具合候補コード群が複数であった場合に、それら抽出された前記不具合候補コード群における前記発現グループ同士および前記要因グループ同士の類似度を算出する算出部と、
前記算出部により算出された前記類似度の情報を含む情報を提示する支援部と
を備える検証支援装置。 Execution according to the inspected source program based on inspection result information added to the inspected source program in which a plurality of source code lines representing respective processing steps of the plurality of processes executed by the computer are arranged Among the plurality of possible processes, a group of the source code lines related to the process that may cause a defect is extracted as a defect candidate code group from the inspected source program, and the defect candidate code group Are divided into an expression group including an expression line that is the source code line in which a defect occurs and a factor group including a factor line that is the source code line that causes the defect. A data creation unit;
When there are a plurality of defect candidate code groups extracted by the data creation unit, a calculation unit that calculates the similarity between the expression groups and the factor groups in the extracted defect candidate code groups,
A verification support apparatus comprising: a support unit that presents information including information on the similarity calculated by the calculation unit.
また、前記不具合候補コード群を構成する複数の前記ソースコード行を、不具合が発生する前記ソースコード行である発現行を含む発現グループと、その不具合の要因となる前記ソースコード行である要因行を含む要因グループとに分け、
前記抽出された前記不具合候補コード群が複数であった場合に、それら抽出された前記不具合候補コード群における前記発現グループ同士および前記要因グループ同士の類似度を算出し、
その算出された前記類似度の情報を含む情報を提示する
検証支援方法。 Execution according to the inspected source program based on inspection result information added to the inspected source program in which a plurality of source code lines representing respective processing steps of the plurality of processes executed by the computer are arranged Among the plurality of possible processes, a group of the source code lines related to the process that may cause a defect is extracted from the inspected source program as a defect candidate code group,
A plurality of source code lines constituting the defect candidate code group, an expression group including an expression line that is the source code line in which the defect occurs, and a factor line that is the source code line that causes the defect Divided into factor groups including
When there are a plurality of the extracted defect candidate code groups, calculate the similarity between the expression groups and the factor groups in the extracted defect candidate code groups,
A verification support method for presenting information including the calculated similarity information.
また、前記不具合候補コード群を構成する複数の前記ソースコード行を、不具合が発生する前記ソースコード行である発現行を含む発現グループと、その不具合の要因となる前記ソースコード行である要因行を含む要因グループとに分ける処理と、
前記抽出された前記不具合候補コード群が複数であった場合に、それら抽出された前記不具合候補コード群における前記発現グループ同士および前記要因グループ同士の類似度を算出する処理と、
その算出された前記類似度の情報を含む情報を提示する処理と
をコンピュータに実行させる処理手順が表されているコンピュータプログラム。 Execution according to the inspected source program based on inspection result information added to the inspected source program in which a plurality of source code lines representing respective processing steps of the plurality of processes executed by the computer are arranged A process of extracting from the inspected source program a group of source code lines related to the process that may cause a failure among the plurality of possible processes as a defect candidate code group;
A plurality of source code lines constituting the defect candidate code group, an expression group including an expression line that is the source code line in which the defect occurs, and a factor line that is the source code line that causes the defect Processing to be divided into factor groups including
When there are a plurality of the extracted defect candidate code groups, a process of calculating the similarity between the expression groups and the factor groups in the extracted defect candidate code groups;
A computer program in which a processing procedure for causing a computer to execute processing for presenting information including information on the calculated similarity is represented.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014202868A JP6369269B2 (en) | 2014-10-01 | 2014-10-01 | Verification support apparatus, verification support method, and computer program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014202868A JP6369269B2 (en) | 2014-10-01 | 2014-10-01 | Verification support apparatus, verification support method, and computer program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2016071774A true JP2016071774A (en) | 2016-05-09 |
JP6369269B2 JP6369269B2 (en) | 2018-08-08 |
Family
ID=55867066
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014202868A Active JP6369269B2 (en) | 2014-10-01 | 2014-10-01 | Verification support apparatus, verification support method, and computer program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6369269B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2019114154A (en) * | 2017-12-26 | 2019-07-11 | 三菱電機株式会社 | Element similarity determination device, element similarity determination method, and element similarity determination program |
WO2022118627A1 (en) * | 2020-12-01 | 2022-06-09 | 株式会社日立製作所 | Calculator and method for selecting correction location of software |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008021244A (en) * | 2006-07-14 | 2008-01-31 | Toshiba Corp | Source code correction priority setting system and its priority setting method |
JP2010079447A (en) * | 2008-09-24 | 2010-04-08 | Fujitsu Ltd | Bug detection support program, program for outputting list of resembling sentence structure identification information, bug detection support device, and bug detection support method |
JP2011113298A (en) * | 2009-11-26 | 2011-06-09 | Canon Inc | Shared source code analysis system, program, and recording medium |
JP2012164211A (en) * | 2011-02-08 | 2012-08-30 | Hitachi Ltd | Software similarity evaluation method |
JP2012248050A (en) * | 2011-05-30 | 2012-12-13 | Nec Commun Syst Ltd | Static analysis support device, static analysis support method, and program |
-
2014
- 2014-10-01 JP JP2014202868A patent/JP6369269B2/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008021244A (en) * | 2006-07-14 | 2008-01-31 | Toshiba Corp | Source code correction priority setting system and its priority setting method |
JP2010079447A (en) * | 2008-09-24 | 2010-04-08 | Fujitsu Ltd | Bug detection support program, program for outputting list of resembling sentence structure identification information, bug detection support device, and bug detection support method |
JP2011113298A (en) * | 2009-11-26 | 2011-06-09 | Canon Inc | Shared source code analysis system, program, and recording medium |
JP2012164211A (en) * | 2011-02-08 | 2012-08-30 | Hitachi Ltd | Software similarity evaluation method |
JP2012248050A (en) * | 2011-05-30 | 2012-12-13 | Nec Commun Syst Ltd | Static analysis support device, static analysis support method, and program |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2019114154A (en) * | 2017-12-26 | 2019-07-11 | 三菱電機株式会社 | Element similarity determination device, element similarity determination method, and element similarity determination program |
WO2022118627A1 (en) * | 2020-12-01 | 2022-06-09 | 株式会社日立製作所 | Calculator and method for selecting correction location of software |
Also Published As
Publication number | Publication date |
---|---|
JP6369269B2 (en) | 2018-08-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8627290B2 (en) | Test case pattern matching | |
US9208451B2 (en) | Automatic identification of information useful for generation-based functional verification | |
EP2960799A1 (en) | Defect localization in software integration tests | |
JP6440895B2 (en) | Software analysis apparatus and software analysis method | |
JP2016115175A (en) | Software test apparatus and software test program | |
JP2020126603A (en) | Automatic candidate correction patch generation | |
JP2018092361A (en) | Test script correction apparatus and test script correction program | |
US8589734B2 (en) | Verifying correctness of processor transactions | |
JP6369269B2 (en) | Verification support apparatus, verification support method, and computer program | |
CN103365772B (en) | Software test automatic evaluation device and method | |
JP4477054B2 (en) | Counterexample analysis support device | |
US20140281719A1 (en) | Explaining excluding a test from a test suite | |
JP6169302B2 (en) | Specification configuration apparatus and method | |
JP6451417B2 (en) | Debug support device, debug support system, debug support method, and debug support program | |
JPWO2018154657A1 (en) | Equivalence verification device and equivalence verification program | |
US20200257613A1 (en) | Automated software program repair | |
JP5578625B2 (en) | Program analysis apparatus, program analysis method, and program | |
JP6731366B2 (en) | Source code verification system | |
JP2013206310A (en) | Model inspection device, model inspection method, and program | |
JP5910410B2 (en) | Schematic program test data generation apparatus and method, and program | |
JP2015072576A (en) | Test item selection device | |
JP2008204187A (en) | Information processor and information processing method | |
JPH11282722A (en) | Program verification method | |
US8479167B1 (en) | Detecting indexing errors in declarative languages | |
US8560986B2 (en) | Computer product, apparatus, and method for correcting assertion |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20170915 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20180510 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20180612 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20180625 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6369269 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |