CAST-10解説及びMC/DC関連技術解説

MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
CAST-10解説及びMC/DC関連技術解説
What is a “Decision” in Application of Modified Condition/Decision
Coverage (MC/DC) and Decision Coverage (DC)?
平成25年10月
MHIエアロスペースシステムズ株式会社
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
CAST-10とは
1.1 概要
2002年6月に発行されたCAST-10では、DO-178Bで定義されている
MC/DC、DCを適用する際、デシジョンとは何かについて追究している。
1.2 背景
DO-178B/ED-12Bのデシジョンの定義に関して混乱が生じている。
レベルB,AのソフトウェアにはDC、レベルAのソフトウェアにはMC/DCのデ
シジョンの定義が影響するため、明らかにする必要がある。
<<参考>>
DO-178B Table A-7 Verification of Verification Process Results
Objective
Description
Applicability by Software Level
A
B
MC/DC
●
Decision Coverage
●
●
Statement Coverage
●
●
C
D
〇
〇:実施 ●:第三者による実施
-2-
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
DO178Cにおける構造カバレッジの位置づけ
Verification
要求ベーステスト生成
Software Requirements Based
Test Generation
ソフトウェア
下位要求テスト
Low-Level Tests
ソフトウェア統合テスト
Software Integration
Tests
ハードウェア/
ソフトウェア統合テスト
Hardware/Software
Integration Tests
Verification of verification
ソフトウェア要求カバレッジ解析
Software Requirements
Coverage Analysis
追加検証
Additional
Verification
ソフトウェア構造カバレッジ解析
Software Structure Coverage
Analysis
Verificationが正しいことを確認するためのもの(Verification of verification)
カバレッジ100%にすることを目的とするのではなく、Verificationの妥当性の指標- 3 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
DO-178B/ED-12Bでの定義
Condition
Boolean演算子を含まないBoolean式
(A Boolean expression containing no Boolean operators.)
<<参考>>
bool A = ( B == C )
If ( D < E)
Decision
Condition
• Conditionと0個以上のBoolean演算子で構成されるBoolean式
(A boolean expression composed of conditions and zero or more Boolean
operators. )
• Boolean演算子がないDecisionはCondition
A decision without a Boolean operator is a condition.
• 1つのDecisionで1つのConditionが1回より多く現れたら、それぞ
れの存在はまったく別のConditionである
If a condition appears more than once in a decision, each
occurrence is a distinct condition.
<<参考>>
Decision
bool a = ( b && c )
if ( A and B) or (A and C))
Boolean演算子: or and not
1つめのAと2つめのAは
Coupled Conditionである。
(別々のConditionとして考える)
-4-
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
DO-178B/ED-12Bでの定義
Decision Coverage
• プログラム内のすべてのエントリポイント、エグジットポイントが最
低1回は呼び出される
(Every point of entry and exit in the program has been invoked at least
once .)
• プログラム内のすべてのDecisionは可能な出力をすべてとる
(Every decision in the program has taken on all possible outcomes at least
once. )
A or B
A
B
False
False
False
True
True
True
A and B
A
B
False
False
False
True
True
True
演算子(And/Or)のミスをテストケースで検出できない
<<参考>>
bool a = ( b && c )
outcome
b
c
If (( d || (e && d) )
outcome
d
e
e&&d
True
True
True
True
True
True
True
False
False
-
False
False
-
False
-5-
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
DO-178B/ED-12Bでの定義
Modified Condition/Decision Coverage
• プログラム内のすべてのエントリポイント、エグジットポイントが最
低1回は呼び出される
• プログラム内のすべてのDecisionは可能な出力をすべてとる
• プログラム内の1つのDecisionにあるすべてのConditionは可能な
出力をすべてとる
(Every condition in a decision in the program has taken all possible
outcomes at least once.)
• 1つのDecisionにあるそれぞれのConditionはDecisionの結果に独
立的に影響することをあらわしている
(Each condition in a decision has been shown to independently affect that
decision‘s outcome.)
A or B
A
B
False
False
False
False
False
True
True
False
True
False
True
False
True
True
False
True
True
True
A and B
A
B
-6-
IEEE Std100-1992での定義
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
Branch
A) If 文、Case文、Go to文
(A computer program construct in which one of two or more alternative sets of
programs statements is selected for execution. case; jump; go to; if-then-else.)
B)
If文などの分岐点(ブランチポイント)
(A point in a computer program at which one of two or more alternative sets of
program statements is selected for execution. Syn: branchpoint.)
-7-
MC/DC Tutorialでの定義
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
• MC/DCチュートリアルはDO-178B/ED-12Bの”literal”定義を支持する。
The MC/DC tutorial supports the “literal” definition of decision in DO-178B/ED-12B.
• チュートリアルでは、「Decisionはブランチポイントの同意語ではない。MCDC
はブランチポイントにあるDecisionだけではなく、すべてのDecisionに適用す
る」と述べている。
The tutorial states “a decision is not synonymous with a branch point. MC/DC applies to all
decisions – not just those within a branch point”.
• チュートリアルではdecisionは古典的なブランチポイントに加え、代入文、実
際のパラメータ、インデクサ、集約などに現れるBoolean演算子を含むことを
示す。
The tutorial indicates that a decision includes the traditional branch points plus Boolean operations
that appear in assignment statements, actual parameters, indexers, aggregates, etc.
•
DO-178B/ED-12Bはentry and exit point coverageも要求しているが、一般的
なBranch Coverageにはそれらが含まれていない
It should also be noted that DO-178B/ED-12B also asks for entry and exit point coverage, which is
also not part of the “traditional” branch coverage.
<<参考>>
例 A := B or C; E := A and D;
e = Function( a || b , c &&d );
MC/DC tutorial:
a joint effort between NASA, FAA, and several industry participants.
-8-
DO-178B “literal”な定義
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
The “literal” definition of decision
1. Structural coverage guidelines are:
a. プログラム内の全てのステートメントが最低1回は呼び出される
Every statement in the program has been invoked at least once.
b. プログラム内の全てのエントリポイント、エグジットポイントが最低1回は呼
び出される
Every point of entry and exit in the program has been invoked at least once.
c. プログラム内の全てのコントロールステートメントが最低1回は可能な出力
をすべてとる
Every control statement in the program has taken all possible outcomes at least once.
d. プログラム内の全ての定数でないBoolean式はTrue/False結果の両方を評
価している
Every non-constant Boolean expression in the program has evaluated to both a True and a False
result.
e. プログラム内のBoolean式にある全ての定数でないConditionはTrue/False
結果の両方を評価している
Every non-constant condition in a Boolean expression in the program has evaluated to both a True
and a False result.
f. プログラム内のBoolean式にある全ての定数でないConditionは独立的に
式の出力に影響していることをあらわしている
Every non-constant condition in a Boolean expression in the program has been shown to
independently affect that expression's outcome.
-9-
DO-178B “literal”な定義
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
The “literal” definition of decision
2. Based upon these definitions:
a. Statement Coverage requires (a) only
b. DC requires (b, c, d)
c. MC/DC requires (b, c, d, e, f)
- 10 -
問題点とその理由
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
問題点
• いくつかの産業関係者はこの“literal” definition of decisionを適用していない
Some industry participants are not applying this “literal” definition of decision.
• 彼らはBranch coverageとDecision Coverageを同一にし、MC/DC,DCの解釈
に矛盾を導いている
They are equating branch coverage and decision coverage, leading to inconsistency in the
interpretation and application of DC and MC/DC in the industry.
• 特にツール開発者は、航空の背景よりむしろ古典的な(IEEEの定義を使用し
た)試験の背景からきて以来、そのアプローチにおいて矛盾している傾向に
ある
Tool manufacturers, in particular, tend to be inconsistent in the approach, since many of them come
from a “traditional” testing background (using the IEEE definitions), rather than an aviation
background.
矛盾に対する潜在的な理由
• DO-178B/ED-12Bの説明不足、練習材料の欠如
Lack of clarification and training materials on DO-178B/ED-12B.
• 古典的なソフトウェア試験コミュニティと航空コミュニティの違い
The difference from the aviation community and the traditional software testing community.
• DO-178B/ED-12Bの著者たち自身の間での同意の欠如
Lack of agreement among the authors of DO-178B/ED-12B themselves
• 航空産業の外側で開発された工業用検証ツールの使用
Use of commercial verification tools that are developed outside the aviation industry.
- 11 -
“literal” Decision
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
Decisionの定義とカバレッジ要求に対する世間の意見はいろいろある
• DO-178B/ED-12BのDecision Coverageの定義として“literal”定義を支持すると
いう人もいる
Some support the “literal” definition of DO-178B/ED-12B definition for decision coverage. (i.e., a
decision is more than a branch point).
• DO-178B/ED-12Bの“intended”定義は“literal”定義とは違うと信じている人もい
る
Some believe that the “intended” definition of DO-178B/ED-12B is different than the “literal”
definition (i.e., branch coverage is equal to decision coverage).
• MC/DCには“literal”定義を適用し、DCには“relaxed”定義を適用する人もいる
Some apply the “literal” definition of decision for MC/DC and the “relaxed” definition for DC.
- 12 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
“literal” Decision
“literal” 定義と“branch point” の違い
以下の3つのステートメントを使用して、それぞれのケーススタディを行う
• ”literal”定義のDecisionでMC/DC、DCを適用する
• Branch PointとDecisionを同等にしたDecisionのMC/DC、DCを適用する
A := B or C;
E := A and D;
if E then …
DO-178B/ED-12B’s
“literal” Definition of Decision
Branch
Point
- 13 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
ケーススタディ
MC/DCに“literal”定義を使用した場合
A := B or C
(item “d”)
E := A and D
(item “e” and “f”)
(item “d”)
(item “e” and “f”)
A(outcome)
B
C
E(outcome)
A
D
True
False
True
True
True
True
True
True
False
False
True
False
False
False
False
False
False
True
if E then …
最終的に必要なテストケース
(item “c”)
E
B
C
D
E(outcome)
A
D
True
False
True
True
True
True
True
True
True
False
True
False
True
False
False
True
False
False
False
False
False
True
- 14 -
ケーススタディ
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
利点
• assignments (Boolean式) がif-then文として同じコードコンポーネントに
含まれていようと、違うコードコンポーネントだろうと、これはその
assignments (Boolean式)に適用する。
This applies whether the assignments (Boolean expressions) are contained in the same
code component as the if-then statement, or in a different code component.
• システムのコンピュータプログラムとモジュールがどのように分配され
ようが問題なく、MC/DCはそれを処理する。
No matter how the logic is distributed across the system’s computer program and modules,
MC/DC will address it.
- 15 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
ケーススタディ
MC/DCの “decision” を“branch point”と同等にした場合
A := B or C
E := A and D
(Branch pointではないので、Don’t care)
(Branch pointではないので、Don’t care)
if E then …
(item “c”)
E(outcome)
A
D
E
A
True
True
True
True
True
False
-
False
False
-
最終的に必要なテストケース
B
C
D
True
-
True
-
-
False
欠点
• この解釈は論理演算において著しく弱い検証が実行されることを許し
てしまう
This interpretation allows significantly weaker verification to be performed on logic.
• 事実、ロジックにテンポラリを使うと、DCとMC/DCの間に違いがなくな
るようなコードを書くことができる
In fact, one can now write code using temporaries for logic so that there would be no
difference between DC and MC/DC.
- 16 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
ケーススタディ
DCに“literal”定義を使用した場合
A := B or C
E := A and D
(item “d”)
(item “d”)
A(outcome)
B
C
E(outcome)
A
D
True
True
True
True
True
True
False
False
False
False
False
False
if E then …
E(outcome)
A
D
最終的に必要なテストケース
E
A
B
C
True
True
True
True
True
False
-
False
False
False
(item “c”)
True
False
True
False
D
True
False
- 17 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
ケーススタディ
DCの “decision” を“branch point”と同等にした場合
A := B or C
E := A and D
(Branch pointではないので、Don’t care)
if E then …
(item “c”)
E(outcome)
A
D
E
A
True
True
True
True
True
False
-
False
False
-
(Branch pointではないので、Don’t care)
最終的に必要なテストケース
B
C
D
True
-
True
-
-
False
欠点
• この解釈は論理演算において弱い検証が実行されることを許してしまう
This interpretation allows weaker verification to be performed on logic.
• その弱体化は、その式がどれだけ多くのコンポーネントに分配されてい
ても、またカバレッジ分析が完全に統合されたコンポーネントもしはスタ
ンドアロンコンポーネントで実行されようと、最終的にBranch Pointで使
われるBoolean式の数に比例するということである。
The weakening is proportional to the number of Boolean expressions flowing into the branch
point, how many components the expressions are distributed across, and whether coverage
analysis is performed with fully integrated components or stand-alone components.
- 18 -
Certification Authorities’ Position
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
“literal”を推奨する理由
•
DC,MC/DCのDecisionには“literal“定義を推奨する
The certification authorities recommend the "literal" definition of decision for DC and
MC/DC.
•
ブランチポイントにあろうとなかろうと、レベルA,Bのソフトウェアでは論理演
算と制御構造がくまなく実行されるべきである
The logic and control structure in Levels A and B software must be thoroughly
exercised, whether it occurs at a branch point or not.
•
DecisionとBranch Pointを同等にすることは、レベルA,Bのソフトウェアにコン
ポーネントのコード制御構造の外側におけるBoolean式のコード化を招く。
To equate decision and branch point could allow Levels A and B software to be coded
with all Boolean expressions outside of the components’ code-control constructs.
- 19 -
Alternatives to The Literal Definition
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
DO-178Bでは代替手段を認めている
•
DCの代わりにBranch Coverageを使用することを提案している製造者がいる
some manufacturers have proposed branch coverage as an alternative to decision
coverage (not for MC/DC).
•
代替方法のアプリケーションはそれぞれ評価されるために少し違うニュアン
スをもっている
Each application of an alternative means have slightly different nuances to be
evaluated.
•
Decision Coverageの代わりにBranch Coverageが提案される場合、考慮すべ
き典型的な事項がある
Some typical things to consider if branch coverage is proposed as an alternate means
for decision coverage are listed below.
- 20 -
Alternatives to The Literal Definition
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
代替手段に必要なこと(1/2)
•
要求からテストケースを生成すべき
The developer should generate the test cases from the requirements.
•
正しい変数の使用法と、すべてのソフトウェア要求が論理演算子で表される
Boolean演算子が正しいことを確かめるために、正常範囲とロバストネスなテ
ストケースを使用すべき
The developer should use normal range and robustness test cases to verify the correct variable
usage and Boolean operators for all software requirements expressed by logical expressions (per
6.4.2.1d of DO- 178B/ED-12B).
•
正しいLoop演算と正しい論理判定を確かめるべき
The developer should verify correct loop operations and correct logic decisions (per 6.4.3 of DO178B/ED-12B).
•
代替手段が乱用されないことを確かめるためのプロセスとスタンダードを確
立、施行すべき
The developer should establish and enforce standards and processes to make sure that the
alternative method or means is not being abused (i.e., using Boolean expressions outside of the
components’ code-control constructs to reduce the structural coverage effort).
- 21 -
Alternatives to The Literal Definition
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
代替手段に必要なこと(2/2)
•
設計者とプログラマが確認テストや構造カバレッジ解析の努力を減らすため
にコンポーネントのコード制御構造の外側で故意または一貫してBoolean式
を使用しないことを保証するために、スタンダードが確立されるべきで、レ
ビューが実行されるべき
Standards should be established and reviews should be performed to ensure that the designer and/or
programmer (either human or machine) is not intentionally nor consistently using Boolean
expressions outside of the components’ code-control constructs to reduce the verification testing
and structural coverage analysis efforts (i.e., abusing the relaxation).
•
代替手段が充分でない場合は、追加のテストや構造カバレッジ解析を実行
すべき
The developer should perform additional testing and structural coverage analysis, if the alternative
method or means is not adequate (i.e., additional test cases and manual structural coverage analysis
may be needed to address specific instances of violations discovered within the code).
- 22 -
マスキングMC/DCについて
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
DO-178CではMC/DCの定義が追加
• MC/DCの定義が変更された。DO-178BのMC/DCの解釈(ユニー
クコーズMC/DC)ばかりでなく、マスキングMC/DCとショートサー
キットが許可された。
(The “Modified Condition/Decision Coverage”(MC/DC) definition
changed. Masking MC/DC and Short Circuit, as well as DO-178B’s
interpretation of MC/DC (often termed Unique-Cause MC/DC), are now
allowed (see Glossary).)
DO-178C Glossary Modified condition/decision coverageに、以下の
一文が追加されている
• A condition is shown to independently affect a decision’s outcome
by: (1) varying just that condition while holding fixed all other
possible conditions, or (2) varying just that condition while holding
fixed all other possible conditions that could affect the outcome.
DO-178C では、
ユニークコーズMC/DC及びマスキングMC/DCを許可している
- 23 -
マスキングMC/DCについて
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
DO-248BでのMC/DCの定義
DO-248でも、MC/DCは以下によって達成されるべきと記載されている
• 可能な他のConditionをすべて固定して保持し、Conditionの値
を変えること(ユニークコーズMC/DCとして知られている)
• 結果に影響する可能な他のConditionをすべて固定して保持し、
Conditionの値を変えること(マスキングMC/DC、ショートサー
キットMC/DCとして知られている)
Modified Condition/Decision Coverage may be accomplished by:
• Varying just that condition while holding fixed all other possible
conditions (known as unique cause MC/DC), or by
• Varying just that condition while holding fixed all other possible
conditions that could affect the outcome (known as masking MC/DC
and short-circuit MC/DC).
- 24 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
MC/DCケーススタディ
“literal”な定義のDecisionの場合(1/3)
Z = ( A or B ) and ( C or D )
DecisionをLiteralな定義とするなら、Decisionは3つあるため、
それぞれのDecisionの結果に影響するConditionに限定しなければならない
#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Z
F
F
F
F
F
T
T
T
F
T
T
T
F
T
T
T
A
F
F
F
F
F
F
F
F
T
T
T
T
T
T
T
T
B AorB C
F
F
F
F
F
F
F
F
T
F
F
T
T
T
F
T
T
F
T
T
T
T
T
T
F
T
F
F
T
F
F
T
T
F
T
T
T
T
F
T
T
F
T
T
T
T
T
T
D CorD
F
F
T
T
F
T
T
T
F
F
T
T
F
T
T
T
F
F
T
T
F
T
T
T
F
F
T
T
F
T
T
T
C=True, D=Trueのとき、
C, DはC or D(”literal”な定義のDecision)
の結果に独立的に影響しない
MC/DCの定義
orのConditionが
True, Trueの組み合わせは必要ない
A or B
A
B
False
False
False
True
False
True
True
True
False
True
True
True
- 25 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
MC/DCケーススタディ
“literal”な定義のDecisionの場合(2/3)
Z = ( A or B ) and ( C or D )
A or B
A
B
False
False
False
True
False
True
True
それぞれのDecisionの結果に影響するConditionに限定させる
ために、全てのDecisionにMC/DCの定義を使用する
A and B
A
B
False
False
False
True
False
False
True
True
False
False
True
False
True
True
True
True
True
OrはTrue, True以外、
and はFalse, False以外を
それぞれのConditionに適用する
#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Z
F
F
F
F
F
T
T
T
F
T
T
T
F
T
T
T
A
F
F
F
F
F
F
F
F
T
T
T
T
T
T
T
T
B AorB C
F
F
F
F
F
F
F
F
T
F
F
T
T
T
F
T
T
F
T
T
T
T
T
T
F
T
F
F
T
F
F
T
T
F
T
T
T
T
F
T
T
F
T
T
T
T
T
T
D CorD
F
F
T
T
F
T
T
T
F
F
T
T
F
T
T
T
F
F
T
T
F
T
T
T
F
F
T
T
F
T
T
T
- 26 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
MC/DCケーススタディ
“literal”な定義のDecisionの場合(3/3)
#
Z
A
B AorB C
D CorD
1
F
F
F
F
F
F
F
2
3
F
F
F
F
F
F
F
F
F
T
T
F
T
T
4
F
F
F
F
T
T
T
5
6
7
F
T
T
F
F
F
T
T
T
T
T
T
F
F
T
F
T
F
F
T
T
8
T
F
T
T
T
T
T
9
10
11
F
T
T
T
T
T
F
F
F
T
T
T
F
F
T
F
T
F
F
T
T
12
13
14
15
16
T
F
T
T
T
T
T
T
T
T
F
T
T
T
T
T
T
T
T
T
T
F
F
T
T
T
F
T
F
T
T
F
T
T
T
 すべてのDecision(=Z、AorB、CorD)が
T/Fをとっている
 すべてのCondition(=A,B,C,D)が
T/Fをとっている
 ConditionのT/FがDecisionの結果に
独立的に影響している
#
Z A
B
AorB C D CorD
2
F
F
F
F
F T
T
5
F
F
T
T
F
F
F
6
T
F
T
T
F T
T
9
F
T
F
T
F
F
F
10
T
T
F
T
F T
T
11
T
T
F
T
T F
T
- 27 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
MC/DCケーススタディ
ユニークコーズMC/DC
ユニークコーズMC/DCでは、ひとつの組み合わせにおいて、Decisionの結果が変化す
る1つのConditionの値だけを変化させることができる(他の全てのConditionは固定さ
せてなければならない)。
In the unique-cause approach, only the values of the condition of interest and the decision’s outcome
can change between the two test cases in an independence pair –everything else must remain the same.
#
Z
A
B AorB C
D CorD
1
F
F
F
F
F
F
F
2
3
F
F
F
F
F
F
F
F
F
T
T
F
T
T
4
F
F
F
F
T
T
T
5
6
7
F
T
T
F
F
F
T
T
T
T
T
T
F
F
T
F
T
F
F
T
T
8
T
F
T
T
T
T
T
9
10
11
F
T
T
T
T
T
F
F
F
T
T
T
F
F
T
F
T
F
F
T
T
12
T
T
F
T
T
T
T
13
F
T
T
T
F
F
F
14
T
T
T
T
F
T
T
Cの組み合わせで#9,#11をとってしまうと、
15
T
T
T
T
T
F
T
16
T
T
T
T
T
T
T
#9,#10でDの組み合わせができてしまう
参考:CAST-06
 すべてのDecision(=Z、AorB、CorD)が
T/Fをとっている
 すべてのCondition(=A,B,C,D)が
T/Fをとっている
 ConditionのT/FがDecisionの結果に
独立的に影響している
 組み合わせがユニークになっている
#
Z A
B
AorB C D CorD
2
F
F
F
F
F T
T
5
F
F
T
T
F
F
F
6
T
F
T
T
F T
T
7
T
F
T
T
T F
T
10
T
T
F
T
F T
T
- 28 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
マスキングMC/DCケーススタディ
Z = ( A or B ) and ( C or D )
マスキングMC/DCでは、独立したペアの中で、関心のあるConditionが、
Decisionの結果の値に影響する唯一のConditionだと示される限り、1つ以上
の入力を変えることを許している
The masking approach to MC/DC allows more than one input to change in an
independence pair, as long as the condition of interest is shown to be the only condition
that affects the value of the decision outcome.
参考:CAST-06
A
B
X
B=False
C
D
Y
Aに着目した時、BがFalseであれば
Z Aの値がXに独立的に影響する
さらに、YがTrueであれば(C, Dの値は問わない)
Aの値がZに独立的に影響する
Y=True
For A
# Z A B A or B C D C or D
2 F F F
F
F T
T
10 T T F
T
F T
T
2 F F F
F
F T
T
11 T T F
T
T F
T
3 F F F
F
T F
T
10 T T F
T
F T
T
Y(CorD)がTrueであれば、Aの値によって
3 F F F
F
T F
T
結果(Z)に影響することがわかるため、Aの
11 T T F
T
T F
T
他にC,Dの値を変えている
#
Z
A B
C D
2
F
F
F
F
T
5
F
F
T
F
F
6
T
F
T
F
T
7
T
F
T
T F
10 T
T F
F
T
- 29 -
Coupled Conditionを含むDecision
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
Coupled Condition
Z = (A and B) or (A and C)
1つのDecisionにあるそれぞれのConditionはDecisionの結果に独立
的に影響することをあらわしている(MC/DCの定義)
AがDecisionの結果に独立的に影響するテストケースを探す。
→#4、#8では、左(ひとつめ)のAが結果に影響したのか、
右(ふたつめ)のAが結果に影響したのかがわからない
#
1
2
3
4
5
6
7
8
Z
F
F
F
F
F
T
T
T
A
F
F
F
F
T
T
T
T
B
F
F
T
T
F
F
T
T
AandB
F
F
F
F
F
F
T
T
A
F
F
F
F
T
T
T
T
C
F
T
F
T
F
T
F
T
AandC
F
F
F
F
F
T
F
T
1つのDecisionで同じConditionが2回以上現れたら、
それらは別のCondition(Distinct Condition)とする(Decisionの定義)
- 30 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
Coupled Conditionを含むDecision
Coupled Conditionを含むDecisionのユニークコーズMC/DC
Z = (A and B) or (A and C)
• 1つのDecisionで1つのConditionが1回より多く現れたら、それぞ
れの存在はまったく別のConditionである(Decisionの定義より)
• ひとつめのAに着目したとき、他のCondition(ふたつめのA)を固
定して結果が変化する組み合わせができない
<<参考>>
#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Z
F
F
F
T
F
F
F
T
F
F
F
T
T
T
T
T
A
F
F
F
F
F
F
F
F
T
T
T
T
T
T
T
T
B
F
F
F
F
T
T
T
T
F
F
F
F
T
T
T
T
A
F
F
T
T
F
F
T
T
F
F
T
T
F
F
T
T
C
F
T
F
T
F
T
F
T
F
T
F
T
F
T
F
T
For A
#
Z
A
B
A
C
6
F
F
T
F
T
14
T
T
T
F
T
7
F
F
T
T
F
15
T
T
T
T
F
どちらの組み合わせも
1つめのAと2つめのAが
矛盾してしまう
他の全てのConditionを固定しなければならない
ユニークコーズMC/DCでは解決することができない
が、マスキングMC/DCで解決できる
- 31 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
DO-178関連文書での定義
Coupled Conditionを含むDecisionのマスキングMC/DC
Z = (A and B) or (A and C)
• ひとつめのAに着目したとき、(A and C)の結果がFalseである限り
AとCは結果に影響しないので、他のCondition(ふたつめのA)を
固定して結果が変化する組み合わせができる
For A
#
Z
6
F
14 T
6
F
15 T
7
F
14 T
7
F
15 T
A
F
T
F
T
F
T
F
T
B A and B
T
F
T
T
T
F
T
T
T
F
T
T
T
F
T
T
A
F
F
F
T
T
F
T
T
C A and C
T
F
T
F
T
F
F
F
F
F
T
F
F
F
F
F
1つめのAと2つめのAが矛盾しない
組み合わせを選ぶことができる
4通りのテストケースでMC/DC100%が得られる
#
Z
A B
A C
6
F
F T
F T
11
F
T F
T F
12
T
T F
T T
15
T
T T
T F
- 32 -
DO-178関連文書での定義
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
マスキングMC/DCとユニークコーズMC/DC
• マスキングMC/DCもユニークコーズMC/DCと同様に、これらの意図の3つを
すべて満たしている。
Masking MC/DC, as well as unique-cause MC/DC, satisfies all three of these “intents”.
Structural coverage analysis complements requirements-based tests by:
1. “適切なソフトウェアレベルに対し必要とされた度合で、コード構造が妥当である”というエビ
デンスを提供すること(Providing “evidence that the code structure was verified to the
degree required for the applicable software level”;)
2. “意図された機能の欠乏の論証をサポートする方法”を提供すること(Providing “a means to
support demonstration of absence of intended functions”; )and
3. “要求ベーステストの徹底”を確立すること(Establishing “the thoroughness of requirementsbased testing”.)
(RTCA/DO-248A SC-190/WG-52, FAQ #43)
• マスキングもユニークコーズも共に、Decisionにある論理演算子の最小のテ
ストを提供する。
Both the unique-cause and masking approaches to MC/DC provide the same minimum tests of a
logical operator in a decision.
• 最小のテストはそれぞれのConditionが独立してDecisionの結果に影響する
ことを裏付ける
These minimum tests confirm that each condition independently affects the decision’s outcome.
参考:CAST-06
- 33 -
MHIエアロスペースシステムズ株式会社
http://www.masc.co.jp
【参考文献】
◇ RTCA/DO-178C
Software Considerations in Airborne Systems and Equipment Certification
◇ RTCA/DO-248C
Supporting Information for DO-178C and DO-278A
◇ CAST-06
Rationale for Accepting Masking MC/DC in Certification Projects
- 34 -