JP6954806B2 - Defect detection device and defect detection method - Google Patents
Defect detection device and defect detection method Download PDFInfo
- Publication number
- JP6954806B2 JP6954806B2 JP2017213735A JP2017213735A JP6954806B2 JP 6954806 B2 JP6954806 B2 JP 6954806B2 JP 2017213735 A JP2017213735 A JP 2017213735A JP 2017213735 A JP2017213735 A JP 2017213735A JP 6954806 B2 JP6954806 B2 JP 6954806B2
- Authority
- JP
- Japan
- Prior art keywords
- defect
- rule
- defect detection
- detection device
- pattern
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Description
本発明は、不具合検出装置、及び不具合検出方法に関する。 The present invention relates to a defect detection device and a defect detection method.
特許文献1には「データを共有する複数のプログラムに潜在する類似のバグを検出するために、第一に、プログラムと潜在するバグの関係を明確にすること、第二に、プログラムと潜在するバグとデータ項目の関係を明確にする。」、「データを共有する複数のプログラムに潜在するバグを検出するバグ検出システムにおいて、各プログラムとそれらの参照するデータの関係を記憶する記憶手段と、バグの種類とそのバグの発生したデータとの関係を入力する入力手段と、当該入力内容と記憶手段の内容に基づき、プログラムとバグの関係を出力する出力手段とから構成する。」と記載されている。
ソフトウェアは一般に複数の機能を実現するプログラムや関数によって構成されており、これらの機能がデータベースやファイル等への入出力を介してデータを受け渡しながら動作する。各機能を実現するソースコードの作成に際しては、ソースコードに含まれている不具合(バグ)を検出して修正するデバッグ(Debug)を行うことにより不具合を取り
除く。
Software is generally composed of programs and functions that realize multiple functions, and these functions operate while passing data via input / output to a database or file. When creating the source code that realizes each function, the defect is removed by performing debugging (Debug) that detects and corrects the defect (bug) contained in the source code.
ここで上記の特許文献1では、あるデータ(変数)を参照もしくは更新する機能に不具合が検出されたとき、同じデータを参照もしくは更新する機能を特定することで、同じ不具合を含む可能性の高い機能を特定している。
Here, in the above-mentioned
しかし特許文献1では、データの具体的な値までは考慮していないため、例えば、同じ値を取る別のデータ(変数)を参照もしくは更新する機能については特定することができない。また不具合に関係する機能とデータ(変数)が特定されるだけでは、どのような条件の下で不具合が発生するかがわからないため修正箇所の特定に時間を要する。
However, in
本発明は、こうした背景に鑑みてなされたものであり、ソフトウェアの不具合の検出を効率よく行うことを可能とする、不具合検出装置及び不具合検出方法を提供することを目的とする。 The present invention has been made in view of such a background, and an object of the present invention is to provide a defect detection device and a defect detection method capable of efficiently detecting software defects.
上記課題を解決するための本発明のうちの一つは、不具合検出装置であって、ソフトウェアの仕様を、入力変数についての条件を示す情報と出力変数の値を示す情報とを含む一つ以上のルールにより記述した情報である、ルール仕様と、検出しようとする不具合の特徴を、ルール仕様の構文上のパターンにより表した情報を含む、不具合パターンリストと、を記憶する情報記憶部と、前記ルール仕様と前記不具合パターンリストとを照合し、前記ルール仕様から前記パターンを満たす前記ルールを抽出した情報である不具合の発生条件リストを生成する不具合検出部と、を備える。 One of the present inventions for solving the above problems is a defect detection device, which includes one or more software specifications including information indicating conditions for input variables and information indicating values of output variables. is information describing the rules, and rule specification, a problem characteristic to be detected, including information representing a pattern of syntactic rule specification, an information storage unit for storing the defect pattern list, and the It is provided with a defect detection unit that collates the rule specification with the defect pattern list and generates a defect occurrence condition list that is information obtained by extracting the rule satisfying the pattern from the rule specification.
その他、本願が開示する課題、及びその解決方法は、発明を実施するための形態の欄、
及び図面により明らかにされる。
In addition, the problems disclosed in the present application and the solutions thereof are described in the column of forms for carrying out the invention.
And the drawings reveal.
本発明によれば、ソフトウェアの不具合の検出を効率よく行うことができる。 According to the present invention, it is possible to efficiently detect software defects.
以下、図面を参照しつつ実施形態について説明する。以下の説明において、同一の又は類似する構成について同一の符号を付して重複した説明を省略することがある。 Hereinafter, embodiments will be described with reference to the drawings. In the following description, the same or similar configurations may be designated by the same reference numerals and duplicate description may be omitted.
[第1実施形態]
図1に第1実施形態として示す不具合検出装置100のハードウェア構成を、図2に不具合検出装置100が備える機能及び不具合検出装置100が記憶するデータを、夫々示している。
[First Embodiment]
FIG. 1 shows the hardware configuration of the
不具合検出装置100は、ソフトウェア(例えば、金融、保険、製造、流通、通信、教育、医療等の業務に関するもの)の開発や保守に際して利用される情報処理装置(コンピュータ)である。不具合検出装置10は、例えば、クラウドシステムにより提供されるクラウドサーバのように仮想的な情報処理資源を用いて実現されるものであってもよい。
The
ソフトウェアは、商品やサービス等に関する法的な規制、業務上の規則、基準等。ビジネスルール、システムルール、チェックルール等(以下、これらをルールと総称する。)に従ってその仕様が決定され設計がなされる。上記ルールは、例えば「もし〜ならば〜である」といった自然文による記述や「IF A=1 AND B=2 THEN R=1」というようにコンピュータにより解釈可能な所定の規則に従った記述、条件と結果の対応関係を表形式で定義した決定表による記述などの様々な形で表現される。以下、ソフトウェアの仕様をルールの集まりとして記述したものをルール仕様と称する。ルール仕様は、例えば、記号実行などのソースコード解析技術により、ソースコードから自動的に生成することができる。 Software is legal regulations, business rules, standards, etc. regarding products and services. The specifications are determined and designed according to business rules, system rules, check rules, etc. (hereinafter, these are collectively referred to as rules). The above rule is, for example, a description in a natural sentence such as "If ... If ..." or a description according to a predetermined rule that can be interpreted by a computer such as "IF A = 1 AND B = 2 THEN R = 1". It is expressed in various forms such as a description in a decision table that defines the correspondence between conditions and results in a tabular format. Hereinafter, a software specification described as a set of rules is referred to as a rule specification. Rule specifications can be automatically generated from source code by, for example, source code analysis techniques such as symbol execution.
不具合検出装置100は、ルール仕様に含まれている不具合を検出する。不具合検出装置100は、ルール仕様と、検出しようとする不具合の特徴をルール仕様の構文(syntax)上及び意味(semantics)上のパターンにより表した情報を含む不具合パターンリスト
(後述する不具合パターンリスト260)とを記憶し、ルール仕様のルールと不具合パターンリストとを照合し、ルール仕様から不具合パターンリストのパターン(条件)を満たすルールを抽出した情報(発生条件リスト)を含む不具合検出結果(後述する不具合検出結果270)を生成する。
The
不具合検出装置100が生成する不具合検出結果には、不具合の有無を表す不具合サマリ(後述する不具合サマリ510)と、検出された不具合の一覧(後述する、検出された
不具合の発生条件リスト520)とが含まれる。
The defect detection results generated by the
図1に示すように、不具合検出装置100は、プロセッサ110、主記憶装置120、補助記憶装置130、入力装置140、出力装置150、及び通信装置160を備える。これらは図示しないバス等の通信手段を介して互いに通信可能に接続されている。
As shown in FIG. 1, the
プロセッサ110は、例えば、CPU(Central Processing Unit)やMPU(Micro Processing Unit)を用いて構成されている。プロセッサ110が、主記憶装置120に格納されているプログラムを読み出して実行することにより、不具合検出装置100の様々な機能が実現される。
The
主記憶装置120は、プログラムやデータを記憶する装置であり、例えば、ROM(Read Only Memory)、RAM(Random Access Memory)、不揮発性半導体メモリ(NVRAM(Non Volatile RAM))等である。
The
補助記憶装置130は、例えば、ハードディスクドライブ、SSD(Solid State Drive)、光学式記憶装置(CD(Compact Disc)、DVD(Digital Versatile Disc)等)、
ストレージシステム、ICカード、SDメモリカードや光学式記録媒体等の記録媒体の読取/書込装置、クラウドサーバの記憶領域等である。補助記憶装置130に格納されているプログラムやデータは主記憶装置120に随時読み込まれる。
The
A storage system, an IC card, a reading / writing device for a recording medium such as an SD memory card or an optical recording medium, a storage area of a cloud server, and the like. Programs and data stored in the
入力装置140は、例えば、キーボード、マウス、タッチパネル、カードリーダ、音声入力装置等である。出力装置150は、ユーザに処理経過や処理結果等の各種情報を提供するユーザインタフェースであり、例えば、画面表示装置(液晶モニタ、LCD(Liquid
Crystal Display)、グラフィックカード等)、音声出力装置(スピーカ等)、印字装置等である。尚、例えば、不具合検出装置100が通信装置160を介して他の装置との間で情報の入力や出力を行う構成としてもよい。
The
Crystal Display), graphic cards, etc.), audio output devices (speakers, etc.), printing devices, etc. In addition, for example, the
通信装置160は、LANやインターネット等の通信手段を介した他の装置との間の通信を実現する有線方式又は無線方式の通信インタフェースであり、例えば、NIC(Network Interface Card)、無線通信モジュール、USB(Universal Serial Interface)モジュール、シリアル通信モジュール等である。
The
図2に示すように、不具合検出装置100は、ルール仕様生成部210、不具合検出部220、情報記憶部230の各機能を備える。また不具合検出装置100は、ソースコード240、ルール仕様250、不具合パターンリスト260、不具合検出結果270を、補助記憶装置130に記憶する。
As shown in FIG. 2, the
ルール仕様生成部210は、記号実行等のソースコード解析技術により、ソースコード240からルール仕様250を生成する。
The rule
不具合検出部220は、事前に定義された不具合パターンリスト260に基づきルール仕様250の不具合を検出する。
The
情報記憶部230は、不具合検出部220がルール仕様250の不具合を検出した結果を不具合検出結果270として補助記憶装置130に記憶する。不具合検出部220が行う処理の詳細については後述する。
The
図3は、ルール仕様生成部210により生成され情報記憶部230が記憶するルール仕様250の一例である。ルール仕様250は、識別子(以下、機能IDと称する)で識別
される機能ごとにまとめられた1つ以上のルール群から構成される。尚、以下の説明において、各機能を、機能1、機能2、・・・のように表記する。各ルール群は、1つ以上のIF−THEN形式で記述されたルールを含む。各ルールは識別子(以下、ルールIDと称する。)で識別される。以下、上記ルール群のことをルールセットとも称する。
FIG. 3 is an example of the
同図に示すルール仕様250は、機能1のルールセット310、機能2のルールセット320、及び機能3のルールセット330の3つのルールセットを含む。このうちルールセット310は、ルールIDが1〜4の4つのルールを含む。またルールセット320は、ルールID1〜3の3つのルールを含む。またルールセット330は、ルールIDが1〜2の2つのルールを含む。尚、以下の説明において、各ルールを、ルール1、ルール2、・・・のように表記する。
The
各ルールは、条件部と結果部とを含む。IF−THEN形式の記述においては、条件部と結果部は夫々、IF節とTHEN節に相当する。例えば、図3に例示するルールセット310のルール1の場合、条件部は「p=1 and q>r」であり、結果部は「x=1」である。
Each rule includes a condition part and a result part. In the IF-THEN format description, the condition part and the result part correspond to the IF clause and the THEN clause, respectively. For example, in the case of
以下の説明において、各ルールセットに対し、そのルールセットに含まれるルールの条件部に記述されている変数を入力変数と称し、結果部に記述されている変数を出力変数と称する。例えば、図3に例示するルールセット310において、入力変数はp、q、rであり、出力変数はxである。 In the following description, for each rule set, the variable described in the condition part of the rule included in the rule set is referred to as an input variable, and the variable described in the result part is referred to as an output variable. For example, in the rule set 310 illustrated in FIG. 3, the input variables are p, q, r and the output variables are x.
各ルールセットにおいて、入力変数の具体的な値を定めると、各ルールの条件部が充足するか(条件部の論理式が真となるか)一意に定まる。ルールの条件部が充足すると、当該ルールの結果部が真となるように出力変数の値が定まる。例えば、図3に例示するルールセット310において、入力変数p、q、rの具体的な値が夫々、1、2、3であるときルール2の条件部が充足し、出力変数xの具体的な値が2に定まる。
When the specific value of the input variable is defined in each rule set, it is uniquely determined whether the condition part of each rule is satisfied (whether the logical expression of the condition part is true). When the condition part of the rule is satisfied, the value of the output variable is determined so that the result part of the rule is true. For example, in the rule set 310 illustrated in FIG. 3, when the specific values of the input variables p, q, and r are 1, 2, and 3, respectively, the condition part of the
例えば、ルール仕様250において、2つの機能がデータベースやファイル等への入出力を介してデータを受け渡す場合には、一方のルールセットの出力変数が他方のルールセットの入力変数に含まれる。例えば、図3に例示するルール仕様250において、機能1のルールセット310の出力変数xは、機能2のルールセット320の入力変数に含まれる。これは、機能1が変数xの値をデータベースやファイルに書き出し、機能2が変数xの値を同じデータベースやファイルから読み込んで参照等することを意味する。以下では、同じ変数を読み書きする複数の機能において、当該変数をルールセットの出力変数にもつ機能を「出力側機能」、当該変数をルールセットの入力変数にもつ機能を「入力側機能」と称する。
For example, in the
尚、2つの機能について、一方のルールセットの出力変数と他方のルールセットの入力変数が異なる場合に、入力変数と出力変数の対応関係の情報を別に用意し、データベースやファイル等への入出力を介してデータが受け渡されていることを表してもよい。例えば、図3に例示するルール仕様250において、機能3のルールセット330の出力変数nと、機能2のルールセット320の入力変数zとが対応している(データベースやファイル上では同じ値を指している)という別の情報により、これら機能間にデータの受け渡しがあることを表現してもよい。
For the two functions, when the output variable of one rule set and the input variable of the other rule set are different, the information on the correspondence between the input variable and the output variable is prepared separately and input / output to the database, file, etc. It may indicate that the data is being passed via. For example, in the
図4は、情報記憶部230が記憶する不具合パターンリスト260の一例である。不具合パターンリスト260には、不具合検出装置100が検出する不具合ごとの、その不具合の特長を記述した不具合パターンを示す情報を含む。尚、不具合パターンリスト260は、例えば、ユーザが作成する
FIG. 4 is an example of the
同図に示す不具合パターンリスト260は、不具合A(ゼロ除算)の不具合パターン410と、不具合B(関数fの引数不正)の不具合パターン420とを含む。各不具合パターンは、種別と条件式の各項目を有する1つ以上の判定条件から構成される。種別には、「構文」又は「意味」のいずれかが設定される。条件式には、不具合検出装置100がルール仕様250に不具合を含むと判断するパターンが設定される。種別に「構文」が設定されている場合、条件式にはルール仕様250の構文(syntax)上の(変数に設定される具体的な値は考慮しない)パターンが設定される。種別に「意味」が設定されている場合、条件式にはルール仕様250の意味(semantics)上の(変数に設定される具体的な値
を考慮する)パターンが設定される。
The
例えば、図4に例示する不具合Aの不具合パターン410は2つの判定条件を含む。1つ目の判定条件は構文上のパターンであり、条件式は「引数に出現(出力変数、/、2)」である。2つ目の判定条件は意味上のパターンであり、条件式は「出力変数=0」である。
For example, the
条件式に記載されている「出力変数」は、不具合判定中の出力変数が格納されるプレースホルダである。また条件式に記載されている「引数に出現(式、関数、N)」は、式が関数に渡される第N引数に構文上含まれることを表す関数で、Nには正整数が設定される。つまり、条件式「引数に出現(出力変数、/、2)」は、出力変数が、関数「/」(除算)の第2引数(除数)に構文上含まれることを表す。尚、本例ではプレースホルダ「出力変数」と関数「引数に出現」とを使用するが、これらを使用しないことも、またこれら以外のプレースホルダや関数を定義して使用することも可能である。 The "output variable" described in the conditional expression is a placeholder in which the output variable during the defect determination is stored. In addition, "appearing in argument (expression, function, N)" described in the conditional expression is a function indicating that the expression is syntactically included in the Nth argument passed to the function, and a positive integer is set in N. NS. That is, the conditional expression "appears in the argument (output variable, / 2)" indicates that the output variable is syntactically included in the second argument (divisor) of the function "/" (division). In this example, the placeholder "output variable" and the function "appear in the argument" are used, but it is possible not to use these or to define and use other placeholders and functions. ..
図5は、図3に例示したルール仕様250及び図4に例示した不具合パターンリスト260に基づき、不具合検出装置100が生成した不具合検出結果270の例である。不具合検出結果270は、不具合サマリ510、検出された不具合の発生条件リスト520を含む。図5に示す不具合サマリ510の各行は、夫々、ルール仕様250中のルールセットの出力変数ごとに、その変数に関する不具合が含まれるか否かを示している。ユーザは不具合サマリ510を参照することで、出力変数ごとの不具合の有無を容易に把握することができる。
FIG. 5 is an example of the
不具合サマリ510は、出力変数と、不具合パターンリスト260中の各不具合の有無とを含む。出力変数には、ルール仕様250中のルールセットの出力変数から一つが設定される。不具合の有無は、不具合パターンリスト260に設定されている不具合ごとに設定される。図5に例示する不具合サマリ510は、出力変数xに関して、不具合パターンリスト260中の不具合Aと不具合Bが含まれることを示している。また出力変数mやnに関して、不具合パターンリスト260中の不具合Aや不具合Bが含まれていないことを示している。尚、本例では不具合があることを「●」、不具合がないことを「‐」で表しているが、これら以外の文字や記号により表現してもよい。
The
検出された不具合の発生条件リスト520は、不具合サマリ510で不具合を含むと示された出力変数と不具合ごとに、その不具合の発生条件を有する。図5に例示する、検出された不具合の発生条件リスト520は、出力変数xに関する不具合Aの発生条件530、及び出力変数xに関する不具合Bの発生条件540を含む。
The detected defect
各不具合の発生条件は、ルール仕様250に含まれるルールのうち、不具合パターンリスト260で定義された不具合パターンを満たすルールを含む。例えば、図3に例示する機能1のルールセット310のルール4の条件部が充足する時、出力変数xの具体的な値が0となり、かつ、機能2のルールセット320のルール1又はルール2では条件部の除
数に出力変数xが出現する。つまり、出力変数xに関して、図4に例示する不具合Aの不具合パターン410が満たされ、図5に示すように、出力変数xに関する不具合Aの発生条件530は、ルールセット310のルール4と、ルールセット320のルール1及びルール2とを含む。
Each defect occurrence condition includes a rule that satisfies the defect pattern defined in the
図5に示す、出力変数xに関する不具合Aの発生条件530と、出力変数xに関する不具合Bの発生条件540は、いずれも複数の機能のルールを含むが、単一の機能のみに依存する不具合である場合、不具合の発生条件を当該機能のルールのみとすることも可能である。例えば、図5に例示する出力変数xに関する不具合Bの発生条件540には、図3に例示するルール仕様250における、機能3のルールセット330のルールが全て含まれる。これは、不具合Bの発生条件は機能3に依存せず、機能1のみに依存することを意味しており、不具合Bの発生条件540は、機能1のルールセット310のルール4のみとしてもよい。
The
検出された不具合の発生条件リスト520には、不具合の発生条件のほかに、その不具合の発生条件を満たす入力変数・出力変数の具体的な値の例を出力してもよい。例えば、図5に示す出力変数xに関する不具合Bの発生条件540について、この不具合の発生条件を満たす入力変数と出力変数の具体的な値の例として「p=2、q=0、r=0、x=0、n=1」を出力してもよい。
In the detected defect
図6は、不具合の検出に際して不具合検出装置100が行う処理(以下、不具合検出処理S600と称する。)を説明するフローチャートである。以下、同図とともに不具合検出処理S600について説明する。尚、不具合検出部220は、例えば、ユーザからの指示を契機として不具合検出処理S600を開始する。また不具合検出部220は、例えば、スケジュールされたタイミングでバッチ処理等により自動的に不具合検出処理S600を実行する。尚、以下において、符号の前に付している文字「S」は処理ステップを意味する。
FIG. 6 is a flowchart illustrating a process (hereinafter, referred to as a defect detection process S600) performed by the
まず不具合検出装置100は、情報記憶部230が記憶しているルール仕様250を読み込むとともに(S601)、情報記憶部230が記憶している不具合パターンリスト260を読み込む(S602)。
First, the
続いて、不具合検出装置100は、S601で読み込んだルール仕様250に基づきルールペアを生成する。ここでルールペアとは、データベースやファイル等への入出力を介してデータの受け渡しを行う2つの機能について、出力側機能のルールセットと入力側機能のルールセットの夫々からルールを1つずつ選択して組み合わせたものである。以下では、出力側機能のルールセットから選ばれたルールを「出力側ルール」と、また入力側機能のルールセットから選ばれたルールを「入力側ルール」と、夫々称する。例えば、図3に示すルール仕様250では、機能1と機能2、及び機能1と機能3が、夫々変数xの値を受け渡す出力側機能と入力側機能の組となっている。従って、この例の場合、不具合検出装置100は、機能1と機能2の組から4×3=12個、機能1と機能3の組から4×2=8個、合計20個のルールペアを生成する。
Subsequently, the
尚、S603において、不具合検出装置100が、ルール仕様250から直接ルールペアを生成する代わりに、ルール仕様250に基づき出力側機能と入力側機能のペアを全て生成した後、各機能ペアからルールペアを生成するようにしてもよい。
In S603, instead of generating the rule pair directly from the
図6に戻り、S604では、不具合検出装置100は、S603で生成した全てのルールペアについてS605〜S609の処理を実行する。
Returning to FIG. 6, in S604, the
S605では、不具合検出装置100は、S602で読み込んだ不具合パターンリスト260の全ての不具合についてS606〜S609の処理を実行する。
In S605, the
S606では、不具合検出装置100は、現在処理中の不具合の不具合パターンにおいて「構文」を種別にもつ判定条件を、現在処理中のルールペアが満たしているか否かを判定する。不具合検出装置100は、判定条件の条件式中にプレースホルダ「出力変数」がある場合、現在処理中のルールペアにおける出力側ルールの出力変数をプレースホルダに格納して判定を行う。ルールペアが構文上のパターンを満たしているか否かは、例えば、パターンマッチングにより判定することができる。「構文」を種別にもつ全ての判定条件をルールペアが満たしている場合(S606:YES)、処理はS607に進み、満たしていない場合(S606:NO)、処理はS605のループに戻る。
In S606, the
続いて、不具合検出装置100は、現在処理中の不具合の不具合パターンにおいて「意味」を種別にもつ判定条件を、現在処理中のルールペアが満たしているか否かを判定する(S607)。IF−THEN形式で記述されたルール仕様の場合、ルールペアが意味上のパターンを満たしているか否かは、例えば、SMTソルバ(Satisfiability Modulo Theories solver)を用いて判定することができる。「意味」を種別にもつ全ての判定条件
をルールペアが満たしている場合(S607:YES)、処理はS608に進み、そうでない場合(S607:NO)、処理はS605のループに戻る。
Subsequently, the
尚、本例では、S606で構文上のパターンを判定した後にS607で意味上のパターンを判定しているが、これらの処理の順序は逆にしてもよい。構文上のパターンの判定処理に時間がかかる場合、先に意味上のパターンの判定処理を行って構文上のパターンを判定するルールペアの数を減らすことで、不具合検出の処理時間を短縮することができる。 In this example, the syntactic pattern is determined in S606 and then the semantic pattern is determined in S607, but the order of these processes may be reversed. If it takes time to determine the syntactic pattern, reduce the number of rule pairs that determine the syntactic pattern by first performing the semantic pattern determination process to shorten the defect detection processing time. Can be done.
S608では、不具合検出装置100は、現在処理中のルールペアにおける出力側ルールの出力変数に現在処理中の不具合が含まれていることを、不具合検出結果270中の不具合サマリ510に記録する。例えば、不具合検出装置100は、図5に例示する不具合サマリ510において、当該出力変数の行の当該不具合の欄に「●」を記録する。
In S608, the
S609では、不具合検出装置100は、S608で不具合が含まれていると記録した出力変数と不具合に関する発生条件として、検出された不具合の発生条件リスト520に現在処理中のルールペアを構成している2つのルールを追加する。尚、既に検出された不具合の発生条件リスト520に同じルールが含まれている場合、そのルールは検出された不具合の発生条件リスト520に追加しなくてもよい。
In S609, the
以上に説明したように、不具合検出装置100は、データベースやファイル等への入出力を介してデータを共有する機能を有するソフトウェアについて、ルール仕様と不具合パターンリストとに基づき、データの具体的な値(意味上のパターン)を考慮して不具合を検出するので、ソフトウェアの不具合を効率よく確実に検出することができる。また不具合検出装置100は、不具合の発生条件を発生条件リスト520として明確な形で出力するので、ユーザがデバッグ時の修正箇所の特定に要する時間を短縮することができる。このように不具合検出装置100によれば、データを受け渡しながら動作するソフトウェアの不具合を効率よく検出することができる。そのため、ユーザはソフトウェアの修正箇所の特定や不具合の除去等の作業を効率よく行うことができる。
As described above, the
[第2実施形態]
第1実施形態では、ルール仕様250及び不具合検出結果270において、夫々が含むルールをIF−THEN形式で記述しているが、第2実施形態の不具合検出装置100は、ルール仕様250及び不具合検出結果270の夫々が含むルールを決定表形式で記述す
る。尚、第2実施形態の不具合検出装置100のハードウェア構成及び基本的なソフトウェア構成については、第1実施形態の不具合検出装置100と同様である。以下では、主として第1実施形態と異なる構成について説明する。
[Second Embodiment]
In the first embodiment, the rules included in the
図7は、第2実施形態の不具合検出装置100のルール仕様生成部210により生成され情報記憶部230が記憶する、決定表形式で記述されたルール仕様250の例である。同図に示すように、このルール仕様250は、機能1のルールセット710、機能2のルールセット720、及び機能3のルールセット730を含む。
FIG. 7 is an example of the
同図に示すように、各ルールセットは、ルールID、条件部、及び結果部の各列を含む一つ以上のルールの行で構成される。各列には列ラベルが付され、条件部の列ラベルには条件式が、結果部の列ラベルには結果変数が設定される。例えば、同図におけるルールセット710の場合、2列の条件部と1列の結果部とを含み、条件部の各列ラベルには夫々、p、q>rが、結果部の各列ラベルにはxが設定されている。 As shown in the figure, each rule set is composed of one or more rule rows including each column of rule ID, condition part, and result part. A column label is attached to each column, a conditional expression is set in the column label of the condition part, and a result variable is set in the column label of the result part. For example, in the case of the rule set 710 in the figure, the condition part of two columns and the result part of one column are included, and p and q> r are added to the label of each column of the condition part, respectively. Is set to x.
各ルールの条件部と結果部には、列ラベルに設定された条件式や結果変数の値、又は値の範囲が設定される。ルールの条件部の全ての列において、条件式の具体的な値がルールに設定された値、又は値の範囲である時、そのルールの条件部が充足する。例えば、図7に例示するルールセット710のルール1は、条件式pの値が1、かつ、条件式q>rの値がTrue(真)の時に条件部が充足し、結果変数xの値が1となることを意味する。またルールセット720のルール2は、条件式zの値がz>10の範囲、かつ、条件式y/xの値が2以外の時に条件部が充足し、結果変数mの値が2となることを意味する。
The conditional expression set in the column label, the value of the result variable, or the range of values is set in the conditional part and the result part of each rule. In all columns of the conditional part of a rule, when the specific value of the conditional expression is the value set in the rule or the range of values, the conditional part of the rule is satisfied. For example, in
図8は、図7に例示したルール仕様250、及び図4に例示した不具合パターンリスト260に基づき、第2実施形態の不具合検出装置100の不具合検出部220が生成した不具合検出結果270の例である。同図に示す不具合検出結果270は、図5に示した不具合検出結果270における発生条件リスト520において、不具合の発生条件の各ルールを決定表形式で記述したものに相当する。
FIG. 8 is an example of the
第2実施形態の不具合検出装置100は、第1実施形態の不具合検出装置100と同様に不具合検出処理S600を実行する。尚、第2実施形態の不具合検出装置100が実行する不具合検出処理S600は、以下の点で第1実施形態の不具合検出装置100と同様に不具合検出処理S600と相違する。
The
まずS606では、不具合検出装置100は、現在処理中の不具合(不具合パターン)において「構文」を種別にもつ判定条件を現在処理中のルールペアが満たしているか否かを判定する。ルールペアが構文上のパターンを満たしているか否かは、ルールペアに含まれるルールを決定表形式からIF−THEN形式に変換した上で、第1実施形態と同様にパターンマッチングを行うことにより判定することができる。またルールの決定表形式からIF−THEN形式への変換は、例えば、以下のようにして行うことができる。即ち、まず列ラベルに設定された条件式や結果変数を、ルールの対応する行に設定された値と等号(=)で連結するか、又は値の範囲と連結する。続いて、条件部の列をすべて論理積(and)で連結し、「IF 条件部 THEN 結果部」の形に並べる。必要ならば適宜括弧を追加してもよい。例えば、図7に例示するルールセット710のルール1をIF−THEN形式に変換すると「IF p=1 and (q>r)=True THEN x=1」となる。
First, in S606, the
またS607では、不具合検出装置100は、現在処理中の不具合の不具合パターンにおいて「意味」を種別にもつ判定条件を、現在処理中のルールペアが満たしているか否かを判定する。ルールペアが意味上のパターンを満たしているか否かは、S606と同様の
方法でルールを決定表形式からIF−THEN形式に変換した上で判定することができる。
Further, in S607, the
尚、S606とS607において、ルールを決定表形式からIF−THEN形式に変換する代わりに、S601等で事前にルール形式をIF−THEN形式に変換してもよい。またS606でIF−THEN形式に変換せず、決定表形式のまま構文上のパターンを判定するようにしてもよい。 In S606 and S607, instead of converting the rule from the decision table format to the IF-THEN format, the rule format may be converted to the IF-THEN format in advance by S601 or the like. Further, the syntactic pattern may be determined in the decision table format without converting to the IF-THEN format in S606.
以上のように変更することで、不具合検出装置100は、不具合の発生条件を決定表形式で出力するため、IF−THEN形式よりも不具合の発生条件の可読性が上がり、デバッグ時の修正箇所の特定に要する時間を更に短縮することができる。
By making the above changes, the
以上、本発明について実施の形態に基づき具体的に説明したが、本発明は上記の実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。例えば、上記の実施の形態は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また上記実施形態の構成の一部について、他の構成の追加・削除・置換をすることが可能である。 Although the present invention has been specifically described above based on the embodiments, it goes without saying that the present invention is not limited to the above embodiments and can be variously modified without departing from the gist thereof. No. For example, the above-described embodiment has been described in detail in order to explain the present invention in an easy-to-understand manner, and is not necessarily limited to the one including all the described configurations. Further, it is possible to add / delete / replace a part of the configuration of the above embodiment with another configuration.
また上記の各構成、機能部、処理部、処理手段等は、それらの一部または全部を、例えば、集積回路で設計する等によりハードウェアで実現してもよい。また上記の各構成、機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリやハードディスク、SSD(Solid State Drive)等の記録装置、また
はICカード、SDカード、DVD等の記録媒体に置くことができる。
Further, each of the above configurations, functional units, processing units, processing means and the like may be realized by hardware by designing a part or all of them by, for example, an integrated circuit. Further, each of the above configurations, functions, and the like may be realized by software by the processor interpreting and executing a program that realizes each function. Information such as programs, tables, and files that realize each function can be placed in a memory, a hard disk, a recording device such as an SSD (Solid State Drive), or a recording medium such as an IC card, an SD card, or a DVD.
また上記の各図において、制御線や情報線は説明上必要と考えられるものを示しており、必ずしも実装上の全ての制御線や情報線を示しているとは限らない。例えば、実際にはほとんど全ての構成が相互に接続されていると考えてもよい。 Further, in each of the above figures, the control lines and information lines are shown as necessary for explanation, and not all the control lines and information lines in the implementation are necessarily shown. For example, in practice almost all configurations may be considered interconnected.
また以上に説明した不具合検出装置100の各種機能部、各種処理部、各種データベースの配置形態は一例に過ぎない。各種機能部、各種処理部、各種データベースの配置形態は、不具合検出装置100が備えるハードウェアやソフトウェアの性能、処理効率、通信効率等の観点から最適な配置形態に変更し得る。
Further, the arrangement form of the various functional units, the various processing units, and the various databases of the
また前述した各種データベースの構成(スキーマ(Schema)等)は、リソースの効率的な利用、処理効率向上、アクセス効率向上、検索効率向上等の観点から柔軟に変更し得る。 Further, the above-mentioned configurations of various databases (schema, etc.) can be flexibly changed from the viewpoints of efficient use of resources, improvement of processing efficiency, improvement of access efficiency, improvement of search efficiency, and the like.
100 不具合検出装置、210 ルール仕様生成部、220 不具合検出部、230 情報記憶部、240 ソースコード、250 ルール仕様、260 不具合パターンリスト、270 不具合検出結果、520 検出された不具合の発生条件リスト、S600 不具合検出処理 100 Defect detection device, 210 Rule specification generator, 220 Defect detection unit, 230 Information storage unit, 240 Source code, 250 Rule specifications, 260 Defect pattern list, 270 Defect detection result, 520 Defect detection condition list, S600 Defect detection process
Claims (13)
検出しようとする不具合の特徴を、ルール仕様の構文上のパターンにより表した情報を含む、不具合パターンリストと、
を記憶する情報記憶部と、
前記ルール仕様と前記不具合パターンリストとを照合し、前記ルール仕様から前記パターンを満たす前記ルールを抽出した情報である不具合の発生条件リストを生成する不具合検出部と、
を備える、不具合検出装置。 A rule specification, which is information that describes a software specification by one or more rules including information indicating a condition for an input variable and information indicating a value of an output variable.
The failure of the features to be detected, including information expressed by the pattern on the syntax of the rule specification, and defect pattern list,
Information storage unit that stores
A defect detection unit that collates the rule specification with the defect pattern list and generates a defect occurrence condition list that is information obtained by extracting the rule that satisfies the pattern from the rule specification.
A defect detection device equipped with.
前記不具合パターンリストは、検出しようとする不具合の特徴を、ルール仕様の意味上のパターンにより表した情報を含み、 The defect pattern list includes information representing the characteristics of the defect to be detected by the semantic pattern of the rule specification.
前記不具合パターンリストは、 The defect pattern list is
種別と条件式の各項目を有する1つ以上の判定条件を含み、 Includes one or more determination conditions with each item of type and conditional expression
前記種別には、当該判定条件が構文または意味のいずれについての判定条件であるかを示す情報が設定され、 Information indicating whether the judgment condition is a judgment condition in terms of syntax or meaning is set in the type.
前記条件式には、前記ルール仕様が不具合を含むと判断するパターンが設定される、 In the conditional expression, a pattern for determining that the rule specification includes a defect is set.
不具合検出装置。 Defect detection device.
前記不具合検出部は、前記出力変数についての不具合の有無を示す情報である不具合サマリを生成する、
不具合検出装置。 The defect detection device according to claim 1 or 2.
The defect detection unit generates a defect summary which is information indicating the presence or absence of a defect in the output variable.
Defect detection device.
前記不具合検出部は、
前記ルール仕様に基づき、データの出力側となる機能を構成する前記ルールと前記データの入力側となる機能を構成する前記ルールとの組み合わせである複数のルールペアを生成し、
前記ルールペアと前記不具合パターンリストとを照合し、前記パターンを満たす前記ルールペアを抽出した情報を前記不具合の発生条件リストとして生成する、
不具合検出装置。 The defect detection device according to claim 2.
The defect detection unit
Based on the rule specifications, a plurality of rule pairs that are a combination of the rule that constitutes the function that is the output side of the data and the rule that constitutes the function that is the input side of the data are generated.
The rule pair is collated with the defect pattern list, and the information obtained by extracting the rule pair satisfying the pattern is generated as the defect occurrence condition list.
Defect detection device.
前記不具合検出部は、前記ルールペアが前記意味上のパターンを満たしているか否かをSMTソルバ(Satisfiability Modulo Theories solver)により判定する、
不具合検出装置。 The defect detection device according to claim 4.
The defect detection unit determines whether or not the rule pair satisfies the semantic pattern by using an SMT solver (Satisfiability Modulo Theories solver).
Defect detection device.
前記ルール仕様はIF−THEN形式で記述される、
不具合検出装置。 The defect detection device according to any one of claims 1 to 5.
The rule specifications are described in IF-THEN format.
Defect detection device.
前記ルール仕様は、決定表形式で記述される、
不具合検出装置。 The defect detection device according to any one of claims 1 to 5.
The rule specifications are described in a decision table format.
Defect detection device.
前記不具合の発生条件リストは、IF−THEN形式で記述される、
不具合検出装置。 The defect detection device according to any one of claims 1 to 5.
The defect occurrence condition list is described in IF-THEN format.
Defect detection device.
前記不具合の発生条件リストは、決定表形式で記述される、
不具合検出装置。 The defect detection device according to any one of claims 1 to 5.
The list of conditions for occurrence of the defect is described in a decision table format.
Defect detection device.
ソフトウェアの仕様を、入力変数についての条件を示す情報と出力変数の値を示す情報とを含む一つ以上のルールにより記述した情報である、ルール仕様と、
検出しようとする不具合の特徴を、ルール仕様の構文上のパターンにより表した情報を含む、不具合パターンリストと、
を記憶するステップ、及び、
前記ルール仕様と前記不具合パターンリストとを照合し前記ルール仕様から前記パターンを満たす前記ルールを抽出した情報である不具合の発生条件リストを生成するステップ、
を実行する、不具合検出方法。 Information processing device
A rule specification, which is information that describes a software specification by one or more rules including information indicating a condition for an input variable and information indicating a value of an output variable.
The failure of the features to be detected, including information expressed by the pattern on the syntax of the rule specification, and defect pattern list,
Steps to memorize, and
A step of collating the rule specification with the defect pattern list and generating a defect occurrence condition list which is information obtained by extracting the rule satisfying the pattern from the rule specification.
How to detect defects.
前記不具合パターンリストは、検出しようとする不具合の特徴を、ルール仕様の意味上のパターンにより表した情報を含み、 The defect pattern list includes information representing the characteristics of the defect to be detected by the semantic pattern of the rule specification.
前記不具合パターンリストは、種別と条件式の各項目を有する1つ以上の判定条件を含み、前記種別には、当該判定条件が構文または意味のいずれについての判定条件であるかを示す情報が設定され、前記条件式には、前記ルール仕様が不具合を含むと判断するパターンが設定される、 The defect pattern list includes one or more judgment conditions having each item of a type and a conditional expression, and the type is set with information indicating whether the judgment condition is a judgment condition for syntax or meaning. Then, in the conditional expression, a pattern for determining that the rule specification includes a defect is set.
不具合検出方法。Defect detection method.
前記情報処理装置が、前記出力変数についての不具合の有無を示す情報である不具合サマリを生成するステップをさらに実行する、
不具合検出方法。 The defect detection method according to claim 10 or 11.
The information processing apparatus further executes a step of generating a defect summary which is information indicating the presence or absence of a defect in the output variable.
Defect detection method.
前記情報処理装置が、
前記ルール仕様に基づき、データの出力側となる機能を構成する前記ルールと前記データの入力側となる機能を構成する前記ルールとの組み合わせである複数のルールペアを生成するステップ、及び
前記ルールペアと前記不具合パターンリストとを照合し、前記パターンを満たす前記ルールペアを抽出した情報を前記不具合の発生条件リストとして生成するステップ、
を実行する、不具合検出方法。 The defect detection method according to claim 11.
The information processing device
Based on the rule specifications, a step of generating a plurality of rule pairs which are a combination of the rule constituting the function of the data output side and the rule constituting the function of the data input side, and the rule pair. And the defect pattern list, and the information obtained by extracting the rule pair satisfying the pattern is generated as the defect occurrence condition list.
How to detect defects.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017213735A JP6954806B2 (en) | 2017-11-06 | 2017-11-06 | Defect detection device and defect detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017213735A JP6954806B2 (en) | 2017-11-06 | 2017-11-06 | Defect detection device and defect detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2019086953A JP2019086953A (en) | 2019-06-06 |
JP6954806B2 true JP6954806B2 (en) | 2021-10-27 |
Family
ID=66764204
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017213735A Active JP6954806B2 (en) | 2017-11-06 | 2017-11-06 | Defect detection device and defect detection method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6954806B2 (en) |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08272623A (en) * | 1995-04-03 | 1996-10-18 | Toshiba Corp | Device and method for program analysis |
US20120017119A1 (en) * | 2010-07-16 | 2012-01-19 | Fujitsu Limited | Solving Hybrid Constraints to Generate Test Cases for Validating a Software Module |
-
2017
- 2017-11-06 JP JP2017213735A patent/JP6954806B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2019086953A (en) | 2019-06-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102464222B1 (en) | Configurable annotations for privacy-sensitive user content | |
US6442684B1 (en) | Determining a current machine state of software | |
EP3616066B1 (en) | Human-readable, language-independent stack trace summary generation | |
JP5665128B2 (en) | Static analysis support device, static analysis support method, and program | |
US9135591B1 (en) | Analysis and assessment of software library projects | |
TW200527229A (en) | Learning and using generalized string patterns for information extraction | |
CN108595187A (en) | Method, device and the storage medium of Android installation kit integrated software development kit | |
US20150074045A1 (en) | Business Rule Management System | |
JP2017041171A (en) | Test scenario generation support device and test scenario generation support method | |
JP6440895B2 (en) | Software analysis apparatus and software analysis method | |
JP2018005535A (en) | Software development assist method and system | |
JP6692281B2 (en) | Test case generation device and test case generation method | |
JP2009205523A (en) | Automatic property generator | |
CN113434542A (en) | Data relation identification method and device, electronic equipment and storage medium | |
JP2019219848A (en) | Source code analysis method and source code analysis device | |
JP6954806B2 (en) | Defect detection device and defect detection method | |
JP2018106556A (en) | Screen information generating apparatus, screen information generating method, and program | |
CN110737642B (en) | Database information analysis method, database information analysis device, computer device and storage medium | |
CN113900956A (en) | Test case generation method and device, computer equipment and storage medium | |
JP6870454B2 (en) | Analytical equipment, analytical programs and analytical methods | |
JP5808264B2 (en) | Code generation apparatus, code generation method, and program | |
JP2017151594A (en) | Supporting device, supporting method, and program | |
JP6983693B2 (en) | Stub generation support device, stub generation support method, and program | |
JP7456843B2 (en) | Program modification device, program modification method, and program modification program | |
JP2014174921A (en) | Information processing system, and name-identification determination method and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200316 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210302 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210405 |
|
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: 20210928 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210930 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6954806 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |