JP6572190B2 - Software verification system and software verification method - Google Patents
Software verification system and software verification method Download PDFInfo
- Publication number
- JP6572190B2 JP6572190B2 JP2016186189A JP2016186189A JP6572190B2 JP 6572190 B2 JP6572190 B2 JP 6572190B2 JP 2016186189 A JP2016186189 A JP 2016186189A JP 2016186189 A JP2016186189 A JP 2016186189A JP 6572190 B2 JP6572190 B2 JP 6572190B2
- Authority
- JP
- Japan
- Prior art keywords
- variable
- conditional expression
- variables
- state
- state variable
- 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 embodiments described below relate to a software verification system and a software verification method.
ソフトウエアのソースコードを読み解いて検証するための検証システムでは一般に、ソフトウエアからグラフなどを生成し可視化することで、システムの理解を助けようとする研究が行われている。 In general, a verification system for reading and verifying a software source code has been studied to generate a graph and the like from the software and visualize the graph to help understanding the system.
しかし、従来の研究の多くは、例えば制御をモード毎に纏めたり切り離したりする際に起点となる変数(状態変数)を人手で指定したり、検証に必要な各種データを人手で選択し入力する必要がある。そのため、適切な検証結果を得るためには、検証対象のシステムやソフトウエアについて深い理解が必要であるとともに、人手による分析が必要である。 However, many of the conventional researches, for example, manually specify variables (state variables) that are the starting points when summarizing and separating controls by mode, and manually select and input various data necessary for verification. There is a need. Therefore, in order to obtain an appropriate verification result, a deep understanding of the system and software to be verified is required, and manual analysis is also required.
以下に記載の実施形態は、状態変数を自動的にかつ的確に特定することができるソフトウエア検証用システム及びソフトウエア検証方法を提供するものである。 The embodiments described below provide a software verification system and a software verification method capable of automatically and accurately specifying a state variable.
一の実施形態に係るソフトウエア検証用システムは、状態変数の候補となる変数を抽出する状態変数候補抽出部と、変数が含まれる条件式を抽出する条件式抽出部と、条件式における変数の現れ方を数値化し、その数値化の結果に基づいて、状態変数候補抽出部で抽出された変数の中から状態変数を決定する状態変数決定部とを備えたことを特徴とする。 A software verification system according to an embodiment includes a state variable candidate extraction unit that extracts a variable that is a candidate for a state variable, a conditional expression extraction unit that extracts a conditional expression including the variable, and a variable in the conditional expression It is characterized by comprising a state variable determining unit that digitizes the appearance and determines a state variable from the variables extracted by the state variable candidate extracting unit based on the numerical result.
以下、図面を参照して実施形態に係るソフトウエア検証システムについて説明する。このソフトウエア検証システムは、例えばハイブリッドシステムなどの物理情報システムを制御するためのソフトウエアを検証するためのシステムである。以下では、ハイブリッドシステム用のソフトウエアの検証システムを例として説明するが、これはあくまでも一例である。他の種類の物理情報システムを対象とした場合でも、ソフトウエア検証システムの構成は略同一である。したがって、本実施の形態の適用範囲は、ハイブリッドシステムに限定されるものではない。 Hereinafter, a software verification system according to an embodiment will be described with reference to the drawings. This software verification system is a system for verifying software for controlling a physical information system such as a hybrid system. Hereinafter, a software verification system for a hybrid system will be described as an example, but this is merely an example. Even when other types of physical information systems are targeted, the configuration of the software verification system is substantially the same. Therefore, the application range of the present embodiment is not limited to the hybrid system.
[第1の実施形態]
図1は、いわゆるハイブリッドシステムの構成を示す概念図である。ハイブリッドシステムとは、物理情報システムの一例であり、例えば速度や温度のような物理量を表す連続値と、レジスタの値やメモリアドレスのようなソフトウエアの動作に関わる離散値とが相互に影響し、連続値による制御が、ある条件に従って離散値による制御に切り替わることで制御が実現されるシステムである。
図1の左側に示すように、ハイブリッドシステムは、複数のモード(例えばモード0〜3)を有しており、モードの各々において異なる連続値による制御が実行されるように構成される。そして、各モードは、図1の右側に示すように、ある条件に従って離散的に切り替わる。
[First Embodiment]
FIG. 1 is a conceptual diagram showing a configuration of a so-called hybrid system. A hybrid system is an example of a physical information system. For example, continuous values representing physical quantities such as speed and temperature and discrete values related to software operations such as register values and memory addresses interact with each other. In this system, the control is realized by switching the control by the continuous value to the control by the discrete value according to a certain condition.
As shown on the left side of FIG. 1, the hybrid system has a plurality of modes (for example,
このようなハイブリッドシステムを制御するソフトウエアのソースコードは、図2に示すように、ある1つのモードの実行時に実行される演算がソースコード上の複数の箇所に散在していたり、あるいは、図2に示すように、異なる複数のモードで実行される演算が、1つのサブルーチンの中に束ねられていたりすることもある。このようなソースコードを読み解くには、複数の箇所に散在した演算をモードと対応させて纏めたり、又は束ねられた演算をモード毎に切り離したりすることにより、個々のモード毎に実行される制御がグラフなどにより表現されることにより、視覚的に確認できる(可視化)ことが望ましい。こうすることで、ハイブリッドシステムの理解を助けることができる。 As shown in FIG. 2, the software source code for controlling such a hybrid system has operations executed at the time of execution of a certain mode scattered in a plurality of locations on the source code. As shown in FIG. 2, operations executed in a plurality of different modes may be bundled in one subroutine. In order to read and understand such source code, control that is executed for each mode is performed by grouping operations scattered in multiple locations in correspondence with modes, or by separating bundled operations for each mode. It is desirable that can be visually confirmed (visualized) by being represented by a graph or the like. This can help understand the hybrid system.
このようなソースコードの検証を行う場合に重要となるのが、モードを切り替える場合において起点となる変数(状態変数)の特定である。従来の各種研究では、この状態変数を人手で判断し、指定する必要がある。本実施の形態では、この状態変数を以下に説明する方法により、人手によらずに自動的に特定することができる。 What is important when verifying such source code is the identification of a variable (state variable) that is the starting point when switching modes. In various conventional studies, it is necessary to manually determine and specify this state variable. In the present embodiment, this state variable can be automatically specified by a method described below without depending on human hands.
図3は、第1の実施の形態に係るソフトウエア検証システムの動作を示す機能ブロック図である。このシステムは、状態変数候補抽出部21、条件式抽出部22、数値化部23、及び状態変数決定部24を備えている。また、図4は、このシステムの動作の手順の概略を示すフローチャートである。以下、各部21〜24の役割及び動作を順に説明する。
FIG. 3 is a functional block diagram showing the operation of the software verification system according to the first embodiment. This system includes a state variable
状態変数候補抽出部21は、ソースコード中に含まれる変数の各々に着目し、その変数が何らかの定数と比較されている場合、その比較されている箇所の数を計数する。そして、その比較されている箇所の数が閾値を超えた場合、状態変数候補抽出部21は、その変数を状態変数候補と認定し、その認定された変数を「状態変数候補情報」として出力し記憶する(図4のステップS1)。なお、閾値との比較は省略し、発見された変数はすべて状態変数候補とすることも可能である。あるいは、閾値を設定する代わりに、定数と比較されている箇所の数を変数ごとに記憶しておき、その数の大小を変数間で比較することで、状態変数候補となる変数を特定することもできる。
The state variable
条件式抽出部22は、状態変数候補である変数が現れる条件式(if文、else節など)を抽出するとともに、それら抽出された条件式において当該変数がどのような形で現れるかに関する情報を「条件式情報」として出力する(ステップS2)。
The conditional
数値化部23は、条件式抽出部22で抽出された条件式情報に基づき、状態変数候補である変数のそれぞれにつき数値化を行い、その数値を数値化情報として出力する(ステップS3)。そして、状態変数決定部24は、数値化情報に基づき、状態変数候補である変数の中から状態変数となるべき変数を決定する(ステップS4)。
Based on the conditional expression information extracted by the conditional
図5は、このソフトウエア検証システムを実現するためのハードウエア構成を示すブロック図である。このソフトウエア検証システムは、一例として、CPU11、データ入力部12、インタフェース(I/O)13、14、出力装置15、ROM16、RAM17、及びハードディスクドライブ18を備えたコンピュータにより実現され得る。例えばハードディスクドライブ18に、図3に示すシステムを実現するためのコンピュータプログラムを格納することができる。ソースコードはデータ入力部12から入力され、前述の状態変数候補情報、条件式情報、数値化情報、及び決定された状態変数は、RAM17等に記憶された後、出力装置15から出力され得る。
なお、図5のハードウエア構成はあくまでも一例である。また、図5のようなハードウエア構成が単体の装置により実現される必要は無く、物理的に分割された複数の装置や、ネットワークにより接続された装置により、図3及び図4の動作が実現されてもよい。
FIG. 5 is a block diagram showing a hardware configuration for realizing the software verification system. As an example, this software verification system can be realized by a computer including a
Note that the hardware configuration in FIG. 5 is merely an example. 5 does not have to be realized by a single device, and the operations of FIGS. 3 and 4 are realized by a plurality of physically divided devices or devices connected by a network. May be.
次に、図6を参照して、状態変数候補抽出部21の機能について詳しく説明する。図6は、一例として、通常モード制御、省エネモード制御、緊急時モード制御などを備えたエアコン制御用のソフトウエアを例として示している。それぞれの制御は、更に複数の制御に分割されている。
図6に示すように、状態変数候補抽出部21は、ソースコード中から、1つの変数、例えば変数aを抽出する。そして、図5の左側に示すように、変数aが何等かの定数と比較されている箇所の数をすべて特定する。この変数aは、ソースコード中の条件式に多数含まれているとともに、各種制御を切り替える場合の判断に用いられている。変数aが定数と比較されている箇所の数が閾値よりも多い場合には、その変数aを状態変数候補として抽出する。以下、ソースコード中の全ての変数について同様の判定を行い、状態変数候補を抽出する。以下の説明では、5種類の変数a〜eが抽出された場合を例として説明するが、これはあくまでも一例である。
Next, the function of the state variable
As shown in FIG. 6, the state variable
条件式抽出部22は、状態変数候補抽出部21で抽出された状態変数候補としての各種変数が含まれる条件式を抽出する。そして、その抽出された条件式において、状態変数候補としての各種変数がどのような現れ方をするのかに関する情報を抽出する。
The conditional
図7は、抽出された条件式の番号、その条件式に含まれる変数a〜e、及び各条件式における変数a〜eの現れ方(どのような形で定数と比較されているか)を示す条件式テーブルである。このようなテーブルを生成するのが、条件式抽出部22の役割である。1つの条件式において、演算子ORで接続された複数の行が存在する場合、その条件式は複数行に分割して表示されている。図7の例では、条件式5及び15が2行に分割して表示され、合計で18個の条件式(行)が表示されている。なお、図7は、説明の簡略化のため、条件式の数を18個としているが、これはあくまでも一例であることは言うまでもない。
FIG. 7 shows the number of the extracted conditional expression, the variables a to e included in the conditional expression, and the appearance of the variables a to e in each conditional expression (in what form is compared with a constant). It is a conditional expression table. It is the role of the conditional
図7の例の場合、抽出された条件式1〜16において、状態変数候補としての5種類の変数a〜eが含まれ、それぞれの条件式においてそれら変数a〜eの「現れ方」が互いに異なっている。この第1の実施の形態では、この現れ方を以下の方法で数値化することで、複数の変数の中から状態変数を決定する。
例えば、ある条件式では、1つの変数のみが現れる場合もある一方、他の式では複数種類の変数が現れる場合がある。図8を参照して具体的に説明する。この例では、ソフトウエアに含まれる制御として制御A、B、Cがあり、条件式に基づく判定により制御A、B、Cのいずれかに切り替わる場合を示している。この場合、制御Aへの切り替えは、変数a及びbを含む条件式1が真(True)となった場合に行われる。この条件式1は、変数aの影響のみで真とされるのではなく、bの値にも依存して真となり、変数aの影響は相対的に小さい。同様に、制御Cへの切り替えは、変数a、cを含む条件式3が真となった場合に行われる。この条件式3は、変数aの影響のみで真とされるのではなく、cの値にも依存して真となり、変数aの影響は相対的に小さい。
In the case of the example of FIG. 7, the extracted
For example, in some conditional expressions, only one variable may appear, while in other expressions, multiple types of variables may appear. This will be specifically described with reference to FIG. In this example, there are the controls A, B, and C included in the software, and the control is switched to one of the controls A, B, and C based on the determination based on the conditional expression. In this case, switching to the control A is performed when the
これに対し、条件式2では、変数aのみによって条件式2が真となり、その意味で変数aの影響力が大きい。このような、ある変数(例えば変数a)が条件式の中で他の変数(例えば変数b〜e)に影響されず存在感を示しているか、それとも埋没しているのかを示す数値を、本実施の形態では「埋没度」と称する。埋没度は、数値化部23で数値化され、状態変数決定部24において状態変数を決定するファクターの1つとして用いられる。「埋没度」の具体的な計算方法の例は、後述する。
On the other hand, in
変数の現れ方を表現する尺度としては、埋没度以外にも、例えば「不連続度」も採用し得る。例えば、ある変数はソースコード中で様々な値を連続的にとり得る一方で、別の変数は特定の値しか取らなかったり、又は不連続な、飛び飛びの値しかとらなかったりする場合がある。これを図9を参照して具体的に説明する。変数aを含む条件式があり、それぞれ制御A、...B、Cへの切り替えにおいて用いられているとする。この場合、変数aは、0、1、2、3という連続の値を取り得ると推定されるところ、実際にソースコード中を探索すると、変数aが「1」の値を取る場合に切り替わる制御は、当該ソースコード中には存在しない、という場合がある。この場合、変数aは、「1」の値に関しては不連続であると考えられる。このような、ある変数が不連続、換言すれば飛び飛びになる度合を、本実施の形態では「不連続度」と称する。 As a scale for expressing the appearance of variables, for example, “discontinuity” can be adopted in addition to the degree of burial. For example, one variable may take various values continuously in the source code, while another variable may only take a specific value, or may take only discrete values. This will be specifically described with reference to FIG. There are conditional expressions including variable a, and control A,. . . It is assumed that it is used in switching to B and C. In this case, it is estimated that the variable a can take a continuous value of 0, 1, 2, 3; however, when the search is actually made in the source code, the control is switched when the variable a takes the value “1”. May not exist in the source code. In this case, the variable a is considered to be discontinuous with respect to the value “1”. The degree to which a certain variable is discontinuous, in other words, skipped is referred to as “discontinuity” in the present embodiment.
変数の現れ方を表現する更に別の尺度としては、「非独立度」も採用し得る。「非独立度」は、ある変数が登場する条件式において、その条件式を真とするような当該変数の値がどれだけ多く存在するかを示す尺度である。例えば、図10に示すように、変数aを含む条件式があり、変数aの値が0の場合に制御Aが実行される一方、変数aの値が1の場合には制御Bが実行されるとする。しかし、制御Aと制御Bには、どちらの場合にも実行される小制御ABが含まれている。これは、小制御ABは、変数aの値が0であっても1であっても実行されることを意味する。ある変数に関し、条件式を真にする当該変数の値がどれだけ多く存在するかに関する尺度を、本実施の形態では、「非独立度」と称する。「非独立度」の具体的な計算方法の例は、後述する。 As another measure for expressing the appearance of variables, “non-independence” may be adopted. “Non-independence” is a scale indicating how many values of a variable such that the conditional expression is true exist in a conditional expression in which a certain variable appears. For example, as shown in FIG. 10, there is a conditional expression including a variable a. When the value of the variable a is 0, the control A is executed, whereas when the value of the variable a is 1, the control B is executed. Let's say. However, the control A and the control B include a small control AB that is executed in either case. This means that the small control AB is executed regardless of whether the value of the variable a is 0 or 1. A measure relating to how many values of a variable that make a conditional expression true for a certain variable is referred to as “independence” in the present embodiment. An example of a specific calculation method of “independence” will be described later.
このように、変数の「現れ方」を表現する尺度は、「埋没度」、「不連続度」、「非独立度」など、様々なものが考えられ得る。「埋没度」、「不連続度」、及び「非独立度」(第1乃至第3の特性)は、変数の現れ方を表現する尺度の一例である。このうち、第1の実施の形態の数値化部23では、条件式中での変数の「現れ方」を、「埋没度」の観点から数値化し、状態変数を決定する。以下、埋没度の具体的な計算方法の例を説明する。
As described above, various scales for expressing the “appearance” of the variable can be considered, such as “the degree of burial”, “the degree of discontinuity”, and “the degree of independence”. “Embedding degree”, “discontinuity degree”, and “non-independence degree” (first to third characteristics) are examples of scales representing how variables appear. Among these, the digitizing
埋没度の具体的な計算方法の一例を、図11を参照して説明する。ここでは、変数aの埋没度を計算する場合の例を示している。他の変数に関しても計算方法は同様である。
この図11の例では、変数aの埋没度を、抽出された条件式(行)1〜15(2)の集合Pにおいて、集合P中に含まれる条件式に含まれる変数a以外の変数の個数(累計)に基づいて計算する。すなわち、変数aの埋没度の計算においては、最初に、図11に示すように、条件式抽出部22で抽出された条件式の中からち、変数aが含まれる条件式の行のみを更に抽出する。そして、各条件式の行において(条件式15については、変数aが登場する行が2行あるため、2つの条件式15(1)、(2)に分割している)、変数aのみが含まれている行には数値「0」を付与し、変数a以外の変数b、c、d、eのいずれかが含まれている行には、当該それ以外の変数の種類の数を付与する。例えば、条件式1、2、7、13には、変数a以外の変数が含まれていないので、数値として「0」を付与する。また、条件式4、8、9には、変数a以外の変数がそれぞれ1つ含まれているので数値「1」を付与する。条件式15(1)及び15(2)には、数値「2」が付与される。数値化部23は、こうして各条件式(行)に付与された数値の合計(0+0+1+0+1+1+0+2+2=7)を「埋没度」として算出する。この埋没度の数値が大きいほど、その変数は他の変数に対し相対的に埋没しており、存在感が薄く、状態変数らしさが小さいことを示す。
以上のような埋没度の演算を、変数aだけでなく、状態変数候補抽出部21で抽出された他の全ての変数b〜eについても実行する。そして、状態変数決定部24は、変数ごとに演算された埋没度を比較して、変数a〜eの中から状態変数を選択する。上述の計算方法の場合、埋没度が最も小さい変数が状態変数として選択される。
An example of a specific method for calculating the degree of burial will be described with reference to FIG. Here, an example in which the degree of burial of the variable a is calculated is shown. The calculation method is the same for other variables.
In the example of FIG. 11, the degree of burial of the variable a is determined for variables other than the variable a included in the conditional expression included in the set P in the set P of the extracted conditional expressions (rows) 1 to 15 (2). Calculate based on the number (cumulative). That is, in the calculation of the degree of burial of the variable a, first, as shown in FIG. 11, only the line of the conditional expression including the variable a is extracted from the conditional expressions extracted by the conditional
The calculation of the burying degree as described above is executed not only for the variable a but also for all other variables b to e extracted by the state variable
[効果]
以上説明したように、第1の実施の形態のソフトウエア検証システムによれば、検証の対象であるソースコードから抽出された条件式及び変数に基づき変数の埋没度を演算し、その演算結果に基づいて状態変数を特定することができる。ソースコードを入力すること以外に、人手によるデータの入力は不要であり、状態変数の特定は、人手による分析によらず自動的に、かつ的確に、しかも短時間で特定することができる。
[effect]
As described above, according to the software verification system of the first embodiment, the degree of burial of a variable is calculated based on the conditional expression and variable extracted from the source code to be verified, and the calculation result is A state variable can be identified based on it. In addition to inputting the source code, it is not necessary to input data manually, and the state variable can be specified automatically, accurately and in a short time regardless of the manual analysis.
[第2の実施の形態]
次に、第2の実施の形態に係るソフトウエア検証システムを、図12を参照して説明する。この第2の実施の形態の基本的な構成及び動作は、第1の実施の形態と同一である(図3〜図5)。ただし、この実施の形態では、上述した「不連続度」の数値化を行い、その結果に基づいて状態変数を決定する。「不連続度」は、数値化部23で数値化され、状態変数決定部24において状態変数を決定するファクターとして用いられる。状態変数候補抽出部21、及び条件式抽出部22の動作は第1の実施の形態と同一である。
[Second Embodiment]
Next, a software verification system according to the second embodiment will be described with reference to FIG. The basic configuration and operation of the second embodiment are the same as those of the first embodiment (FIGS. 3 to 5). However, in this embodiment, the above-described “discontinuity” is digitized and the state variable is determined based on the result. The “discontinuity” is digitized by the digitizing
続いて、不連続度の具体的な計算方法の一例を説明する。
変数aがとり得る値の集合を推定するとともに、変数aがとり得る値の集合を、ソースコードを実際に探索し特定する。その推測される集合に含まれる値の数と、実測に基づく集合に含まれる値の数との割合を、変数aの不連続度と定義することができる。具体的には、各条件式の中で[a==i](iは任意の数)の表現をすべて抽出し、このiの種類の数を特定して実測値とする。また、推定値は、このようにして得られた実測値の数値列から、不自然に飛び飛びとなった部分を補完することにより得られる。
Next, an example of a specific method for calculating the discontinuity will be described.
A set of values that the variable a can take is estimated, and a set of values that the variable a can take is actually searched for and specified. A ratio between the number of values included in the estimated set and the number of values included in the set based on actual measurement can be defined as the discontinuity of the variable a. Specifically, all expressions of [a == i] (i is an arbitrary number) are extracted from each conditional expression, and the number of types of i is specified and used as an actual measurement value. Moreover, an estimated value is obtained by complementing the part which skipped unnaturally from the numerical sequence of the actual measurement value obtained in this way.
より具体的に説明すると、以下のようになる。
例えば、変数aがとり得る値ν(実測)をすべて求めて、降順(又は昇順)に並び替える。ここでは、νの値として、例えば降順に並んだ値ν0、ν1、ν2、・・・、νn−1、νnが得られたものとする。
このとき、隣接する2つの値の差分値diffi=νi+1−νi(i=0〜n−1)を算出する。そして、得られた差分値diff0〜diffn−1の中で最小値diffmin(=min[diff0、diff1、・・・、diffn−1])を抽出する。そして、値ν0を初項、値νnを末項、diffminを隣接項の間の差とする等差数列を生成する。この等差数列が、変数aがとり得る値の集合と推定される。この推定された集合と、実測の集合とを比較することにより、変数aの不連続度を特定することができる。
More specifically, it is as follows.
For example, all values ν (actual measurement) that can be taken by the variable a are obtained and rearranged in descending order (or ascending order). Here, as values of ν, for example, values ν 0 , ν 1 , ν 2 ,..., Ν n−1 , ν n arranged in descending order are obtained.
At this time, a difference value diff i = ν i + 1 −ν i (i = 0 to n−1) between two adjacent values is calculated. Then, the minimum value diff min in a resulting difference value diff 0 ~diff n-1 (= min [
図12は、変数aの不連続度を特定するための別の方法を説明する概念図である。まず、抽出された条件式の中から、変数aを含む条件式(行)を、図12のように抽出する(条件式15からは、変数aを含む2つの行が抽出されている)。そして、それらの条件式(行)の中で、変数aがどの値を取った場合に条件式が真とされるのかを判定する。この図12の例では、変数aの値が0、1、3のいずれかを取った場合に、抽出された行を含む条件式が真となる。一方、変数aは、理論上は値として「2」を取ることも可能であるが、図12に係るソースコードでは、変数aが2の値を取ったとしても、どの条件式も真とはならず、制御が切り替わることはない。したがって、この図12の例では、変数aの不連続度を#({0、1、2、3}/{0、1、3})=#{2}=1と算出する。 FIG. 12 is a conceptual diagram illustrating another method for specifying the discontinuity of the variable a. First, a conditional expression (row) including the variable a is extracted from the extracted conditional expression as shown in FIG. 12 (two lines including the variable a are extracted from the conditional expression 15). Then, in those conditional expressions (rows), it is determined which value the variable a takes to determine whether the conditional expression is true. In the example of FIG. 12, when the value of the variable a is 0, 1, or 3, the conditional expression including the extracted row is true. On the other hand, the variable a can theoretically take “2” as a value, but in the source code according to FIG. 12, even if the variable a takes a value of 2, any conditional expression is true. In other words, the control is not switched. Therefore, in the example of FIG. 12, the discontinuity of the variable a is calculated as # ({0, 1, 2, 3} / {0, 1, 3}) = # {2} = 1.
[効果]
以上説明したように、第2の実施の形態のソフトウエア検証システムによれば、抽出された条件式及び変数に基づき変数の不連続度を演算し、その演算結果に基づいて状態変数を特定することができる。状態変数の特定は、人手による分析によらず自動的に、かつ的確に、しかも短時間で特定することができる。
[effect]
As described above, according to the software verification system of the second embodiment, the degree of discontinuity of the variable is calculated based on the extracted conditional expression and variable, and the state variable is specified based on the calculation result. be able to. The state variable can be specified automatically, accurately, and in a short time regardless of manual analysis.
[第3の実施の形態]
次に、第3の実施の形態に係るソフトウエア検証システムを、図13〜図16を参照して説明する。この第3の実施の形態の基本的な構成及び動作は、第1の実施の形態と同一である(図3〜図5)。ただし、この実施の形態では、上述した「非独立」の数値化を行い、その結果に基づいて状態変数を決定する。「非独立度」は、数値化部23で数値化され、状態変数決定部24において状態変数を決定するファクターとして用いられる。状態変数候補抽出部21、及び条件式抽出部22の動作は第1の実施の形態と同一である。
[Third Embodiment]
Next, a software verification system according to the third embodiment will be described with reference to FIGS. The basic configuration and operation of the third embodiment are the same as those of the first embodiment (FIGS. 3 to 5). However, in this embodiment, the above-described “non-independent” quantification is performed, and the state variable is determined based on the result. The “independence degree” is digitized by the digitizing
次に、変数の非独立度の具体的な計算方法の第1の例を、図13を参照して説明する。この第1の例では、図10において説明したのと同様に、条件式を真にする当該変数の値がどれだけ多く存在するか、という観点から変数の非独立を計算する。 Next, a first example of a specific method for calculating the independence of variables will be described with reference to FIG. In the first example, as described with reference to FIG. 10, non-independence of variables is calculated from the viewpoint of how many values of the variable that make the conditional expression true exist.
まず、抽出された条件式の中から、1つの変数例えば変数aを含む条件式(行)を、図13のように抽出する(条件式15からは、変数aを含む2つの行が抽出されている)。そして、その各条件式(行)について、その条件式(行)が真となる変数aの値の個数(種類)を判定する。図13の例の場合、条件式1は、変数aの値が1の場合にのみ真となるので、条件式1には「1」が与えられる。条件式2については、「!=1」、すなわち、変数aが1以外、すなわち0、2、3(3通り)の場合に条件式2が真となるので、条件式2には「3」が与えられる。
First, from the extracted conditional expression, a conditional expression (row) including one variable, for example, variable a is extracted as shown in FIG. 13 (from
このようにして、すべての行について、その行の判断が真となる変数aの値の個数を求め、その合計値を判定する。複数の条件式について、条件式を真とするような変数aの値の個数が多ければ多いほど、変数aは状態変数らしくない、ということができる。すなわち、この第1の例では、複数の条件式を真とするような変数aの値の個数の合計値を求め、この合計値を非独立度D1として算出する。その他の変数b〜eについても同様にして非独立度D1の計算を実行する。そして、状態変変数決定部24は、変数ごとに算出された非独立度D1を比較して、変数a〜eの中から状態変数を選択する。
In this way, for all the rows, the number of values of the variable a for which the judgment of the row is true is obtained, and the total value is judged. For a plurality of conditional expressions, it can be said that the greater the number of values of the variable a that makes the conditional expression true, the less likely the variable a is to be a state variable. That is, in this first example, the total value of the number of values of the variable a that makes a plurality of conditional expressions true is obtained, and this total value is calculated as the independence degree D1. The calculation of the non-independence D1 is similarly performed for the other variables b to e. Then, the state variable
変数の非独立度の具体的な計算方法の第2の例を図14及び図15を参照して説明する。ここでの非独立度の概念は、第1の例の場合とは若干異なっている。一例として、図14に示すように、変数aを含む2つの条件式(X)、(Y)があり、条件式(X)は変数aの値が0又は1の場合に真となり、条件式(Y)は変数aの値が1又は2の場合に真となる場合を考える。 A second example of a specific calculation method of the variable independence will be described with reference to FIGS. The concept of independence here is slightly different from that in the first example. As an example, as shown in FIG. 14, there are two conditional expressions (X) and (Y) including a variable a. The conditional expression (X) is true when the value of the variable a is 0 or 1, and the conditional expression Consider a case where (Y) is true when the value of the variable a is 1 or 2.
この場合、2つの条件式(X)と(Y)はどちらも、変数aの値が1の場合に真となり、条件式を真とする変数が重複している。このように、2つの条件式が同じ変数を含み、しかも条件式を真とする当該変数の値が重複している場合、その変数は、その重複の分だけ、少なくとも(その2つの条件式に関しては)影響度が低いということができる。 In this case, the two conditional expressions (X) and (Y) are both true when the value of the variable a is 1, and the variables that make the conditional expression true are duplicated. In this way, when two conditional expressions include the same variable and the values of the variables for which the conditional expression is true are duplicated, the variable is at least (with respect to the two conditional expressions by the overlap. It can be said that the degree of influence is low.
上記のような考え方の下、この第2の例では、図15に示すような方法により、変数aの非独立度D2を計算する。まず、抽出された条件式の中から、変数aを含む条件式の行を抽出する(この図15の例では、条件式15から2つの行が抽出されて、合計で8つの行が抽出されている)。
そして、これらの8つの行の中から任意の2つの行を選択し、その選択された2つの行を真とする値を特定する。そして、その2つの行の両方を真とするような変数aの値が存在するか否か、換言すれば、2つの行の両方を真とするaの値が重複しているか否かを判定する。
例えば、図15の条件式1と条件式2を比較した場合、条件式1は変数aが1の場合に真となり、条件式2は変数aが2、3、又は4の場合に真となる。したがって、条件式1と条件式2との間では、両方の条件式を真とするようなaの値は存在しない(条件式を真とするような値が重複していない)。一方、条件式8と条件式9とを比較した場合、条件式8は変数aが0又は1の場合に真となり、条件式9は変数aが0又は3の場合に真となる。したがって、条件式8と条件式9との間では、両方の式を真とする値が存在する(重複が存在する)。以下同様にして、すべての2つの行の組み合わせ(8C2個)について同様の判定を行う。そして、条件式を真とする変数aの値が重複している2つの条件式の組み合わせの数Aを特定する。そして、この数αを、8つの行の任意の2つの行の組み合わせの数(全組み合わせ数(8C2個))βを特定し、非独立度D2=α/βを求める。このD2の値が小さいほど、変数aは状態変数らしいということができ、D2の値が大きいほど、変数aは状態変数らしくないということができる。
Under this concept, in the second example, the independence D2 of the variable a is calculated by the method shown in FIG. First, a line of a conditional expression including the variable a is extracted from the extracted conditional expressions (in the example of FIG. 15, two lines are extracted from the
Then, arbitrary two rows are selected from these eight rows, and a value for which the two selected rows are true is specified. Then, it is determined whether or not there is a value of the variable a that makes both of the two rows true, in other words, whether or not the value of a that makes both the two rows true is duplicated. To do.
For example, when the
変数の非独立度の具体的な計算方法の第3の例を、図16を参照して説明する。ここでの非独立度の概念は、第1の例及び第2の例のいずれとも若干異なっている。この第3の例では、変数aを含む複数の条件式の中で、それ単独で条件式を真にすることがない変数aの値が存在するか否か、存在する場合にはその個数γを特定し、更に変数aがとり得る値の個数(推定)δに対する、その個数γの割合γ/δを判定することにより、変数aの非独立度D3を判断する。変数aが複数の値を取り得る場合、その値のそれぞれが単独で条件式を真とするのであれば、その分だけその変数は相対的に影響度が高く、状態変数らしい変数であるということができる。一方、変数aが複数の値を取り得るが、そのうちのいくつかの値は、それ単独で条件式を真とするのではなく、他の値の場合にも真となるのであれば、その分だけ、その変数は影響度が低いということになる。この第3の例は、上記のような観点から変数aの非独立度D3を判断するものである。 A third example of a specific method for calculating the independence of variables will be described with reference to FIG. The concept of independence here is slightly different from both the first example and the second example. In the third example, among the plurality of conditional expressions including the variable a, whether or not there is a value of the variable a that does not make the conditional expression true by itself, and if there exists, the number γ And the independence degree D3 of the variable a is determined by determining the ratio γ / δ of the number γ with respect to the number (estimated) δ of values that the variable a can take. If the variable a can take a plurality of values, if each value alone is true for the conditional expression, the variable has a relatively high degree of influence and is a variable that seems to be a state variable. Can do. On the other hand, the variable a can take a plurality of values, but some of the values are not true for the conditional expression alone, but are also true for other values. Only that variable has a low impact. In the third example, the independence degree D3 of the variable a is determined from the above viewpoint.
例えば、変数aを含む条件式の行が図16に示すように抽出された場合を考える。この場合、条件式1、7、及び条件式15(1)は、変数aの値が1である場合にのみ真となる。また、条件式4、及び条件式13は、変数aの値が0である場合のみ真となる。また、条件式15(2)は、変数aの値が1の場合にのみ真となる。このように、変数aは値0、1、2、3を取り得ると推定されるが、そのうち、値0、1、2の場合には、その値単独でいずれかの条件式を真にする。
For example, consider a case where a row of a conditional expression including a variable a is extracted as shown in FIG. In this case,
しかし、変数aの値が3の場合には、それ単独(a=3のみ)で真となる条件式(行)が存在しない。すなわち、条件式2は、変数aの値が3の場合に真となるが、条件式2は、変数aの値が0又は2の場合にも真となるので、変数aの値が3の場合にのみ、条件式2が真となるものではない。条件式9も同様である。
このように、この第3の例では、変数aがとり得る値の個数(推定)δを特定し、更に、その値のうち、それ単独で条件式を真とすることが無い変数aの値の数γを特定し、変数aの非独立度D3=γ/δを算出する。他の変数b〜eについても同様にして非独立度D3を算出し、比較することにより状態変数を決定することができる。
However, when the value of the variable a is 3, there is no conditional expression (row) that is true by itself (only a = 3). That is,
Thus, in the third example, the number (estimated) δ of the values that the variable a can take is specified, and among those values, the value of the variable a that by itself does not make the conditional expression true. And the independence degree D3 = γ / δ of the variable a is calculated. Similarly, the state variables can be determined by calculating the non-independence D3 for the other variables b to e and comparing them.
上述したように、変数の非独立度を演算する方法は、様々なものが考えられる。上記第1の例〜第3の例で演算されるD1〜D3の少なくとも1つのみを採用してもよいし、上記非独立度D1〜D3を組み合わせて非独立度Dmを演算してもよい。例えば、非独立度DmをD1×(D2+D3)として演算することができる。 As described above, various methods for calculating the independence of variables can be considered. Only at least one of D1 to D3 calculated in the first to third examples may be employed, or the independence degree Dm may be calculated by combining the independence degrees D1 to D3. . For example, the independence degree Dm can be calculated as D1 × (D2 + D3).
[効果]
以上説明したように、第3の実施の形態のソフトウエア検証システムによれば、抽出された条件式及び変数に基づき変数の非独立度を演算し、その演算結果に基づいて状態変数を特定することができる。状態変数の特定は、人手による分析によらず自動的に、かつ的確に、しかも短時間で特定することができる。
[effect]
As described above, according to the software verification system of the third embodiment, the degree of independence of a variable is calculated based on the extracted conditional expression and variable, and the state variable is specified based on the calculation result. be able to. The state variable can be specified automatically, accurately, and in a short time regardless of manual analysis.
[その他]
上述の第1〜第3の実施の形態の数値化部23は、このような条件式中での各変数の「現れ方」を、上記のように埋没度、不連続度、又は非独立度の観点から数値化する。しかし、上述した埋没度、不連続度、及び非独立度は、変数の現れ方を表現する尺度の一例である。この3つの尺度以外の尺度を組み合わせても良いことは言うまでもなく、また、埋没度、不連続度、及び非独立度の全てを用いて状態変数を決定してもよいし、そのうちの一部を用いても良い。
例えば、埋没度、不連続度、及び独立度の全てを用いて態変数らしさを判定する場合、上述のようにして演算された埋没度、不連続度、及び非連続度の積を変数a〜eごとに演算して、この積の大小を比較することにより、状態変数を決定してもよい。
[Others]
The
For example, when determining the likelihood of a state variable using all of the burial degree, the discontinuity degree, and the independence degree, the product of the burial degree, the discontinuity degree, and the discontinuity degree calculated as described above is set as the variable a to The state variable may be determined by calculating every e and comparing the magnitudes of the products.
以上、本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。 As mentioned above, although some embodiment of this invention was described, these embodiment is shown as an example and is not intending limiting the range of invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the scope of the invention. These embodiments and modifications thereof are included in the scope and gist of the invention, and are included in the invention described in the claims and the equivalents thereof.
11・・・CPU、 12・・・データ入力部、 13、14・・・インタフェース(I/O)、 15・・・出力装置、 16・・・ROM、 17・・・RAM、 18・・・ハードディスクドライブ、 21・・・状態変数候補抽出部、 22・・・条件式抽出部、 23・・・数値化部、 24・・・状態変数決定部。
DESCRIPTION OF
Claims (8)
前記変数が含まれる条件式を抽出する条件式抽出部と、
前記条件式における前記変数の現れ方を数値化し、その数値化の結果に基づいて、前記状態変数候補抽出部で抽出された前記変数の中から状態変数を決定する状態変数決定部と
を備えたことを特徴とするソフトウエア検証用システム。 A state variable candidate extraction unit for extracting variables that are candidates for state variables;
A conditional expression extraction unit for extracting a conditional expression including the variable;
A state variable determination unit that quantifies the appearance of the variable in the conditional expression and determines a state variable from the variables extracted by the state variable candidate extraction unit based on the numerical result Software verification system characterized by this.
前記条件式抽出部で抽出された複数の条件式の各々において、一の変数以外の変数の種類の数を特定し、その数に基づいて前記一の変数の第1の特性を数値化する、請求項1記載のソフトウエア検証用システム。 The state variable determination unit
In each of the plurality of conditional expressions extracted by the conditional expression extraction unit, the number of types of variables other than one variable is specified, and the first characteristic of the one variable is quantified based on the number. The system for software verification according to claim 1.
前記変数がとり得ると推定される値の集合と、前記変数が実際に取る値の集合とを比較し、その比較結果に基づいて前記変数の第2の特性を数値化する、請求項1又は2記載のソフトウエア検証用システム。 The state variable determination unit
A set of values that the variable is estimated to be taken, the variable is compared with the set of values that take the actual quantifies a second characteristic of the variable on the basis of the comparison result, according to claim 1 Or the system for software verification of 2 description.
一の変数が含まれる条件式の各々において、その条件式を真にする前記一の変数の値の個数を特定し、その個数に基づいて、前記一の変数の第3の特性を数値化する、請求項1乃至3のいずれかに記載のソフトウエア検証用システム。 The state variable determination unit
In each conditional expression including one variable, the number of values of the one variable that makes the conditional expression true is specified, and the third characteristic of the one variable is quantified based on the number. The system for software verification according to any one of claims 1 to 3.
前記変数が含まれる条件式を抽出するステップと、
前記条件式における前記変数の現れ方を数値化し、その数値化の結果に基づいて、抽出された前記変数の中から状態変数を決定するステップと
を備えたことを特徴とするソフトウエア検証用方法。 Extracting variables as candidate state variables;
Extracting a conditional expression including the variable;
A method for verifying software, comprising: quantifying how the variable appears in the conditional expression, and determining a state variable from the extracted variables based on the result of the quantification .
抽出された複数の条件式の各々において、一の変数以外の変数の種類の数を特定し、その数に基づいて前記一の変数の第1の特性を数値化する、請求項5記載のソフトウエア検証用方法。 Determining the state variable comprises:
6. The software according to claim 5, wherein in each of the plurality of extracted conditional expressions, the number of types of variables other than one variable is specified, and the first characteristic of the one variable is digitized based on the number. Wear verification method.
前記変数がとり得る値の集合と、前記変数が実際に取る値の集合とを比較し、その比較結果に基づいて前記変数の第2の特性を数値化する、請求項5又は6記載のソフトウエア検証用方法。 Determining the state variable comprises:
A set of the variables can take values, the variable is compared with the set of values that take the actual quantifies a second characteristic of the variable on the basis of the comparison result, according to claim 5 or 6, wherein Software verification method.
一の変数が含まれる条件式の各々において、その条件式を真にする前記一の変数の値の個数を特定し、その個数に基づいて、前記一の変数の第3の特性を数値化する、請求項5乃至7のいずれかに記載のソフトウエア検証用方法。 Determining the state variable comprises:
In each conditional expression including one variable, the number of values of the one variable that makes the conditional expression true is specified, and the third characteristic of the one variable is quantified based on the number. The method for software verification according to any one of claims 5 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016186189A JP6572190B2 (en) | 2016-09-23 | 2016-09-23 | Software verification system and software verification method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016186189A JP6572190B2 (en) | 2016-09-23 | 2016-09-23 | Software verification system and software verification method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018049565A JP2018049565A (en) | 2018-03-29 |
JP6572190B2 true JP6572190B2 (en) | 2019-09-04 |
Family
ID=61767649
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016186189A Active JP6572190B2 (en) | 2016-09-23 | 2016-09-23 | Software verification system and software verification method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6572190B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110046067B (en) * | 2019-04-22 | 2023-10-31 | 无线生活(杭州)信息科技有限公司 | Interface testing method and device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH01237737A (en) * | 1988-03-17 | 1989-09-22 | Fujitsu Ltd | System for supporting flag identification |
WO2015008575A1 (en) * | 2013-07-19 | 2015-01-22 | 日産自動車株式会社 | Software inspection device, software inspection method, and software inspection program |
-
2016
- 2016-09-23 JP JP2016186189A patent/JP6572190B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2018049565A (en) | 2018-03-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102062931B1 (en) | A system and method for inputting text | |
JP6606997B2 (en) | Machine learning program, machine learning method, and information processing apparatus | |
US10474355B2 (en) | Input pattern detection over virtual keyboard for candidate word identification | |
JP7353946B2 (en) | Annotation device and method | |
JPWO2016151618A1 (en) | Prediction model update system, prediction model update method, and prediction model update program | |
US10642818B2 (en) | Causal analysis device, causal analysis method, and non-transitory computer readable storage medium | |
JP2017004123A (en) | Determination apparatus, determination method, and determination program | |
JP6572190B2 (en) | Software verification system and software verification method | |
US20200098161A1 (en) | System and method for executing non-graphical algorithms on a gpu (graphics processing unit) | |
JP5882272B2 (en) | Document evaluation program and document evaluation apparatus | |
JP2010061450A (en) | Information processing device, information processing method and program | |
US10885684B2 (en) | Estimation results display system, estimation results display method, and estimation results display program | |
KR101394339B1 (en) | System and method for processing genome sequence in consideration of seed length | |
US20150082278A1 (en) | Clone detection method and clone function commonalizing method | |
JP2015069393A (en) | Document data comparison method, document data comparison apparatus, and document data comparison program | |
JP6402637B2 (en) | Analysis program, analysis method, and analysis apparatus | |
US20150363514A1 (en) | CAD Data Processing Device and Processing Method | |
JP6604032B2 (en) | Evaluation support device, evaluation support program, and evaluation support system | |
KR101842681B1 (en) | Visualization method and apparatus for large-scale biological network | |
US20170270243A1 (en) | Method for finding associated positions of bases of a read on a reference genome | |
WO2015159377A1 (en) | Design assistance device | |
JP2007057065A (en) | Apparatus and method for analyzing piping network | |
JP2021105807A5 (en) | ||
JP2017201450A5 (en) | ||
JP7034053B2 (en) | Measure selection support method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20180328 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20181225 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20190115 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20190215 |
|
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: 20190716 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20190809 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6572190 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |