(A&&B) || (A&&C) || (A&&D)
1 1 1 0 1 0 1
1 0 1 0 1 0 0
1 0 1 1 1 0 1
1 0 1 0 1 1 1
no of conditions ==> 6
no of inputs ==> 4
ABCD o/p
1100 1
1000 0
1010 1
1001 1
(A&&B)||(B||C)
0 0 0 0 0
0 0 0 1 1
----------------
Z = A && B;
AB Z
01 0
10 0
11 1
Types of code coverage:
https://www.mathworks.com/help/slcoverage/ug/types-of-code-coverage.html
x,z ==> inputs
y ==> output
--------------------
how many min no of TCs required to get 100% statement coverage?
how many min no of TCs required to get 100% decision coverage?
how many min no of TCs required to get 100% MC/DC coverage?
x z y
8 4 6 ==> s1, s2, s5, s6 | D1F, D2F, D3T
0 4 1 ==> s1, s3, s6 | D1T,
0 1 7 ==> s1, s4, s6 | D1F, D2T
4 3 0 ==> D3F
----------------------------
TCA ==> Test Coverage Analysis (RBTCA+SCA) ==>is testing done is sufficient? ==> 100% RBTCA + 100% SCA
Scope: CRs
REQUIREMENTS LLR ---------------------------------> SOURCE CODE/EOC
LLT TC/TP/TR (7 TC)
TCA must be 100% to say enough TCs written and enough testing is done.
Requirements ==> SWS-LLR-0014
Testing TC ==> is_descent_phase_TC.xls
RBTCA ==> requirements coverage analysis
SCA ==> code coverage analysis
RBTCA: are we tested every requirements sufficient?
for requirements under scope, testing has done? (requirements missing testing completely or partially) yes
normal range TCs & robustness TCs ?(gaps: missing few boundary cases, missing robustness cases, missing some MD/DC cases) yes
SCA: are we tested every portion of source code sufficient? Tool: logiscope, Vectorcast, LDRA, RTRT, etc.
statement coverage: every statement in the code has been executed at least once?
decision coverage: relational o/p & logical o/p ==> T/F ? a>b, a>10 && a<20
MC/DC coverage: every condition in the decision has been tested independently?
Level A ==> SC, DC, MC/DC
Level B ==> SC, DC
Level C ==> SC
SCA Definitions comparison Table: https://github.com/Armin-Montigny/MCDC
Z = A && B;
AB Z
01 0
10 0
11 1
REQ1:
The software shall update X as per below logic:
X = 3
If (A == True) OR (B == True) then
X = 4
Endif
Note: X is an integer. (Range: -128 to 127)
A and B are booleans. (Range: True, False)
Test Cases:
Statement Coverage:
A B X
T F 4 ==> S1, S2
Decision Coverage:
A B X
T F 4 ==> T
F F 3 ==> F
MC/DC Coverage: FF,TF,FT
A B X
T F 4 ==>
F F 3 ==>
F T 4
REQ1:
The software shall update X as per below logic:
X = 3 //S1
If (A == True) OR (B == True) then //D1
X = 4 //S2
Else
X = 5 //S3
End if
Note: X is an integer. (Range: -128 to 127)
A and B are booleans. (Range: True, False)
Test Cases:
Statement Coverage:
A B X
T F 4 ==> S1, S2
F F 5 ==> S1,S3
Test Cases:
Decision Coverage:
A B X
T F 4 ==> T
F F 5 ==> F
Test Cases:
MC/DC Coverage: FF,TF,FT
A B X
T F 4 ==>
F F 5 ==>
F T 4
REQ1:
If (A = B) and (B = C) then software shall set Z = TRUE.
if(A==B && B==C)
{
Z = TRUE; //S1
}
Note: A, B and Z are booleans. (Range: True, False)
Test Cases:
Statement Coverage:
A B C Z
T T T TRUE //S1
Test Cases:
Decision Coverage:
A B C Z
T T T TRUE ==> D1 is T
T F F FALSE ==> D1 is F
Test Cases:
MC/DC Coverage: TT,FT,TF //Murali
A B C Z
T T T TRUE ==> TT
T F F FALSE ==> FT
F F T FALSE ==> TF
A B C Z //Eswar
F F F TRUE ==> TT
F T T FALSE ==> FT
T T F FALSE ==> TF
Requirement:
When the vehicle speed exceeds 120 km/hr for 10 sec then the software shall set the "Reduce speed" signal ON; else OFF; (functional + performance requirement)
every 0.5 sec this function will be executed. (performance requirement)
Speed range is 0-200km/hr
function executed for every 0.5 sec or not?
function developed as requirement condition or not?
speed(km/h) time Reduce speed
---------------------------------------------------------------------------------------------------
120.5 for more than or equal to sec (10.5) ON
120.5 for less than 10 sec (9.5) OFF
120.0 for more than or equal to sec (10.0) OFF
120.5 for more than or equal to sec (10.5) ON
119.5 for more than or equal to sec (10.5) OFF
------------------------------------------------------------------------------------------------