Commit 96d1fb81 authored by Hernan Ponce de Leon's avatar Hernan Ponce de Leon
Browse files

Merge branch '3465-IStatementTerm_toZ3' of https://git.fortiss.org/af3/af3.git...

Merge branch '3465-IStatementTerm_toZ3' of https://git.fortiss.org/af3/af3.git into 3465-IStatementTerm_toZ3
parents 9b799cd4 4b410adf
random-specification-model.ecore b04f23eef5a265ffed25435e135c0ebd85ef2ac1 GREEN
testing.ecore c2d12e3a1a99bb82278d6b4db6757f7e722de172 GREEN
testing.ecore f3a265b2a8807a7405dd75e718f978c8d59bf951 GREEN
......@@ -383,4 +383,36 @@
</eStructuralFeatures>
</eClassifiers>
</eSubpackages>
<eSubpackages name="mcdc" nsURI="http://www.fortiss.org/af3/testing/model/mcdc"
nsPrefix="org-fortiss-af3-testing-mcdc">
<eClassifiers xsi:type="ecore:EClass" name="FormalRequirementMCDC" eSuperTypes="platform:/resource/org.fortiss.af3.expression/model/expression.ecore#//terms/imperative/IfThenElse">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Class to formalize requirements in such a way that a {@link TestSuite} satisfying MCDC can be generated.&#xA;The formal language is an if-then-else statement with defined inputs and outputs.&#xA;Guard, thenBlock and else block must not be &lt;code>null&lt;/code>.&#xA;ThenBlock and ElseBlock are only allowed to contain &#xA;{@link org.fortiss.af3.expression.model.terms.imperative.Assignment}s."/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="inputs" upperBound="-1"
eType="ecore:EClass platform:/resource/org.fortiss.af3.expression/model/expression.ecore#//terms/Var"
containment="true">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Defined inputs for the {@link org.fortiss.af3.testing.model.mcdc.FormalRequirementMCDC}.&#xA;In the guard and on the rhs of the assignments there can only be variables, which are contained in this list."/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="outputs" upperBound="-1"
eType="ecore:EClass platform:/resource/org.fortiss.af3.expression/model/expression.ecore#//terms/Var">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Defined outputs for the {@link org.fortiss.af3.testing.model.mcdc.FormalRequirementMCDC}.&#xA;On the lhs of the assignments there can only be variables, which are contained in this list."/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="McdcSpecificationPart" eSuperTypes="#//TestSuiteSpecificationPart">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Specification part for a formal MCDC requirement."/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="formalRequirementMCDC"
eType="#//mcdc/FormalRequirementMCDC" containment="true">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="The specifying formal mcdc requirement."/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</eSubpackages>
</ecore:EPackage>
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="(c) 2017 fortiss GmbH. GENERATED CODE: Do not edit, see Ecore metamodel instead!" modelDirectory="/org.fortiss.af3.testing/generated-src"
editDirectory="/org.fortiss.af3.testing.edit/generated-src" editorDirectory="/org.fortiss.af3.testing.editor/generated-src"
modelPluginID="org.fortiss.af3.testing" templateDirectory="" redirection="" modelName="TestSuiteModel"
editPluginClass="org.fortiss.af3.testing.model.provider.TestSuiteModelEditPlugin"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="(c) 2017 fortiss GmbH. GENERATED CODE: Do not edit, see Ecore metamodel instead!"
modelDirectory="/org.fortiss.af3.testing/generated-src" editDirectory="/org.fortiss.af3.testing.edit/generated-src"
editorDirectory="/org.fortiss.af3.testing.editor/generated-src" modelPluginID="org.fortiss.af3.testing"
templateDirectory="" redirection="" modelName="TestSuiteModel" editPluginClass="org.fortiss.af3.testing.model.provider.TestSuiteModelEditPlugin"
editorPluginClass="org.fortiss.af3.testing.model.presentation.TestSuiteModelEditorPlugin"
rootImplementsInterface="" featureMapWrapperInterface="" featureMapWrapperInternalInterface=""
featureMapWrapperClass="" testsDirectory="/org.fortiss.af3.testing.tests/generated-src"
......@@ -118,5 +118,16 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference testing.ecore#//constraintResults/ExecutionError/problematicTransition"/>
</genClasses>
</nestedGenPackages>
<nestedGenPackages prefix="Mcdc" basePackage="org.fortiss.af3.testing.model" disposableProviderFactory="true"
ecorePackage="testing.ecore#//mcdc">
<genClasses ecoreClass="testing.ecore#//mcdc/FormalRequirementMCDC">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference testing.ecore#//mcdc/FormalRequirementMCDC/inputs"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true"
ecoreFeature="ecore:EReference testing.ecore#//mcdc/FormalRequirementMCDC/outputs"/>
</genClasses>
<genClasses ecoreClass="testing.ecore#//mcdc/McdcSpecificationPart">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference testing.ecore#//mcdc/McdcSpecificationPart/formalRequirementMCDC"/>
</genClasses>
</nestedGenPackages>
</genPackages>
</genmodel:GenModel>
MCDCUtils.java 8e4c09ba90443f0e369e52de21d3c1dcb6701828 YELLOW
MCDCUtils.java 75c28048c3f2dd98608c4662735f462a53f3d3bb RED
......@@ -42,6 +42,7 @@ import org.fortiss.af3.project.model.typesystem.IFunction;
import org.fortiss.af3.project.model.typesystem.ITerm;
import org.fortiss.af3.project.model.typesystem.IType;
import org.fortiss.af3.project.model.typesystem.VarBase;
import org.fortiss.af3.testing.model.mcdc.FormalRequirementMCDC;
import com.microsoft.z3.ArithExpr;
import com.microsoft.z3.BoolExpr;
......@@ -66,16 +67,6 @@ public final class MCDCUtils {
* @param context
* @return the {@link Expr} for an {@link ITerm} or <code>null</code> for invalid inputs.
*/
// TODO(HP): Remove the println
// TODO(HP): Way to many nested ifs. maybe use pattern matching.
// Also, it would be better to just check "instance of X" for the Xs in the lowest level of the
// type hierarchy (BoolConst, Var, FunctionCall,
// instead of IStatementTerm or IExpressionTerm) and just return null if not of the cases match
// that.
// Is there a getID function for IDs of the TermsPackage for switch case?? Or aren't the ifs too
// nested?
// The highlevel checks were there to identify the lowest level unmatched case (e.g. unmatched
// IExpressionTerm as print instead of only saying unmatched)
public static Expr toZ3(String prefix, Context ctx, ITerm term, EObject context) {
if(term instanceof BoolConst) {
return ctx.mkBool(((BoolConst)term).getValue());
......@@ -123,6 +114,7 @@ public final class MCDCUtils {
Expr rhs = toZ3(prefix, ctx, ((Assignment)term).getValue(), context);
String identifier = ((Assignment)term).getVariable().getIdentifier();
IType type = getVarType(((Assignment)term).getVariable(), context);
// TODO(HP): the 3 ifs return the same. You can have only one return at the end.
if(type instanceof TBool) {
lhs = ctx.mkBoolConst(prefix + identifier);
return ctx.mkEq(lhs, rhs);
......@@ -136,22 +128,6 @@ public final class MCDCUtils {
return ctx.mkEq(lhs, rhs);
}
}
// TODO: uncomment when merged in mcdc-master
// if(term instanceof FormalRequirementMCDC) {
// FormalRequirementMCDC formalRequirementMCDC = (FormalRequirementMCDC)term;
// BoolExpr guard = (BoolExpr)toZ3(prefix, ctx, formalRequirementMCDC.getGuard());
// BoolExpr thenE = ctx.mkTrue();
// BoolExpr elseE = ctx.mkTrue();
// for(IStatementTerm statement : formalRequirementMCDC.getThenBlock().getStatements())
// {
// thenE = ctx.mkAnd(thenE, (BoolExpr)toZ3(prefix, ctx, statement));
// }
// for(IStatementTerm statement : formalRequirementMCDC.getElseBlock().getStatements())
// {
// elseE = ctx.mkAnd(elseE, (BoolExpr)toZ3(prefix, ctx, statement));
// }
// return ctx.mkOr(ctx.mkAnd(guard, thenE), ctx.mkAnd(ctx.mkNot(guard), elseE));
// }
return null;
}
......@@ -159,6 +135,8 @@ public final class MCDCUtils {
private static Expr unaryOperator(Context ctx, EOperator operator, Expr arg0) {
try {
switch(operator) {
// TODO(HP): if it is an unary operation, is it possible to have all this operators?
// E.g. what the meaning of "or true"?
case ADD:
return ctx.mkAdd((ArithExpr)arg0);
case SUBTRACT:
......@@ -225,7 +203,6 @@ public final class MCDCUtils {
try {
if(operator == EOperator.ADD || operator == EOperator.SUBTRACT ||
operator == EOperator.MULTIPLY) {
// extract -> different type for the two lists
List<ArithExpr> tmp =
args.stream().map(e -> (ArithExpr)toZ3(prefix, ctx, e, context))
.collect(Collectors.toList());
......@@ -289,6 +266,8 @@ public final class MCDCUtils {
PredefinedFunction predefinedFunction = (PredefinedFunction)function;
EOperator operator = predefinedFunction.getOperator();
switch(operator) {
// TODO(HP): I'm not familiar with the semantics of switch.
// Will the code above be executed if any of the cases match?
case LOWER_THAN:
case GREATER_THAN:
case LOWER_EQUAL:
......
GenerateStateAutomatonUtils.java 81645f6c18da5bcc920f8671da4eeb622f8f69d4 GREEN
StatisticUtils.java d2ea1b26fc14f0b19d18604d330205b8aae3352e GREEN
TestingConstraintUtils.java 7c423db9009862b16a96c05ab7ef9a59d4af6c81 GREEN
TestingModelElementFactory.java 1606349a0752446c7d696837dd808f2599316fd6 GREEN
TestingUtils.java f808f4450df3d07f2e2bf93138f57a3a44c7d17a GREEN
TestingModelElementFactory.java 66acd55aeafd698b525dfaae2e343b62584f11fc GREEN
TestingUtils.java e9fa206a3ab1f59b56b242097d4a8cc19935f9d7 GREEN
......@@ -27,12 +27,15 @@ import static org.fortiss.af3.platform.utils.PlatformModelElementFactory.createP
import static org.fortiss.af3.project.utils.ConstraintsProjectUtils.getProjectConstraints;
import static org.fortiss.af3.testing.utils.TestingConstraintUtils.setTestSuite;
import static org.fortiss.af3.testing.utils.TestingConstraintUtils.setTestedComponent;
import static org.fortiss.af3.testing.utils.TestingUtils.validStatementSequenceMCDC;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.copy;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getParentElement;
import java.util.Calendar;
import java.util.Map;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.InputPort;
import org.fortiss.af3.component.model.OutputPort;
......@@ -40,6 +43,9 @@ import org.fortiss.af3.deployment.model.ComponentAllocation;
import org.fortiss.af3.deployment.model.Deployment;
import org.fortiss.af3.deployment.model.InputPortAllocation;
import org.fortiss.af3.deployment.model.OutputPortAllocation;
import org.fortiss.af3.expression.model.terms.IExpressionTerm;
import org.fortiss.af3.expression.model.terms.Var;
import org.fortiss.af3.expression.model.terms.imperative.StatementSequence;
import org.fortiss.af3.platform.model.PlatformArchitecture;
import org.fortiss.af3.platform.model.generic.GenericExecutionUnit;
import org.fortiss.af3.platform.model.generic.GenericReceiver;
......@@ -58,6 +64,8 @@ import org.fortiss.af3.testing.model.TestingModelFactory;
import org.fortiss.af3.testing.model.coverage.CoverageFactory;
import org.fortiss.af3.testing.model.coverage.StateCoverage;
import org.fortiss.af3.testing.model.coverage.TransitionCoverage;
import org.fortiss.af3.testing.model.mcdc.FormalRequirementMCDC;
import org.fortiss.af3.testing.model.mcdc.McdcFactory;
import org.fortiss.af3.testing.model.statistic.IdleIntTupel;
import org.fortiss.af3.testing.model.statistic.StateAutomatonExecutionStatistic;
import org.fortiss.af3.testing.model.statistic.StateIntTupel;
......@@ -318,4 +326,28 @@ public class TestingModelElementFactory {
IConstraintUIService.getInstance().install(c);
return c;
}
/** Creates a {@link FormalRequirementMCDC}. */
public static FormalRequirementMCDC createFormalRequirementMCDC(EList<Var> inputs,
EList<Var> outputs, IExpressionTerm guard, StatementSequence thenBlock,
StatementSequence elseBlock) {
for(Var var : getChildrenWithType(guard, Var.class)) {
if(!inputs.contains(var)) {
return null;
}
}
boolean valid = true;
valid &= validStatementSequenceMCDC(inputs, outputs, thenBlock);
valid &= validStatementSequenceMCDC(inputs, outputs, elseBlock);
if(valid) {
FormalRequirementMCDC req = McdcFactory.eINSTANCE.createFormalRequirementMCDC();
req.setGuard(guard);
req.setThenBlock(thenBlock);
req.setElseBlock(elseBlock);
return req;
}
return null;
}
}
......@@ -15,15 +15,23 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.testing.utils;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.InputPort;
import org.fortiss.af3.component.model.OutputPort;
import org.fortiss.af3.component.model.Port;
import org.fortiss.af3.expression.model.terms.IExpressionTerm;
import org.fortiss.af3.expression.model.terms.Var;
import org.fortiss.af3.expression.model.terms.imperative.Assignment;
import org.fortiss.af3.expression.model.terms.imperative.IStatementTerm;
import org.fortiss.af3.expression.model.terms.imperative.StatementSequence;
import org.fortiss.af3.testing.constraint.TestSuiteConstraint;
import org.fortiss.af3.testing.model.TestCase;
import org.fortiss.af3.testing.model.TestInput;
......@@ -261,4 +269,46 @@ public class TestingUtils {
}
return null;
}
/**
* @param inputs
* - List of input variables
* @param outputs
* - List of output variables
* @param statementSequence
* - Statement sequence to validate
* @return <code>true</code> if:
* - Only {@link Assignment}s contained inside the <code>statementSequence</code>.
* - Only {@link Var}s contained in <code>outputs</code> on lhs of {@link Assignment}s.
* - Only {@link Var}s contained in <code>inputs</code> on rhs of {@link Assignment}s.
*/
public static boolean validStatementSequenceMCDC(EList<Var> inputs, EList<Var> outputs,
StatementSequence statementSequence) {
if(statementSequence == null || statementSequence.getStatements() == null) {
return false;
}
for(IStatementTerm statement : statementSequence.getStatements()) {
if(statement instanceof Assignment) {
if(!outputs.contains(((Assignment)statement).getVariable())) {
return false;
}
// If the value of an assignment is only a {@link Var} getChildrenWithType returns
// an empty array.
IExpressionTerm rhs = ((Assignment)statement).getValue();
if(rhs instanceof Var) {
if(!inputs.contains(rhs)) {
return false;
}
}
for(Var var : getChildrenWithType(rhs, Var.class)) {
if(!inputs.contains(var)) {
return false;
}
}
} else {
return false;
}
}
return true;
}
}
<
/*-------------------------------------------------------------------------+
| Copyright 2018 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package test.org.fortiss.af3.testing.mcdc;
import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.add;
import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.assignment;
import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.createVar;
import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.intConst;
import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.lowerEqual;
import static org.fortiss.af3.expression.utils.ExpressionModelElementFactory.sequence;
import static org.fortiss.af3.testing.utils.TestingModelElementFactory.createFormalRequirementMCDC;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.fortiss.af3.expression.model.terms.IExpressionTerm;
import org.fortiss.af3.expression.model.terms.IntConst;
import org.fortiss.af3.expression.model.terms.Var;
import org.fortiss.af3.expression.model.terms.imperative.Assignment;
import org.fortiss.af3.expression.model.terms.imperative.IStatementTerm;
import org.fortiss.af3.expression.model.terms.imperative.StatementSequence;
import org.fortiss.af3.testing.model.mcdc.FormalRequirementMCDC;
import org.junit.Test;
/**
*
* @author ludwig dickmanns
*/
public class TestFormalRequirementMCDC {
/**
* Correct {@link FormalRequirementMCDC}.
*
* if (iG <= 42) {
* o0 = i0;
* }
* else {
* o1 = i1;
* }
*
* Creation should pass: No errors in creation.
*/
@Test
public void test01() {
System.out.println("test01");
EList<Var> inputs = new BasicEList<Var>();
EList<Var> outputs = new BasicEList<Var>();
IExpressionTerm guard;
StatementSequence thenBlock, elseBlock;
// Inputs.
Var i0 = createVar("i0");
Var i1 = createVar("i1");
Var iG = createVar("iG");
inputs.add(i0);
inputs.add(i1);
inputs.add(iG);
// Outputs.
Var o0 = createVar("o0");
Var o1 = createVar("o1");
outputs.add(o0);
outputs.add(o1);
// Guard.
IntConst intG = intConst(42);
guard = lowerEqual(iG, intG);
// Then-Block.
Assignment t1 = assignment(o0, i0);
thenBlock = sequence(t1);
// Else-Block.
Assignment e1 = assignment(o1, i1);
elseBlock = sequence(e1);
// Formal Requirement MCDC.
FormalRequirementMCDC formalRequirementMCDC;
formalRequirementMCDC =
createFormalRequirementMCDC(inputs, outputs, guard, thenBlock, elseBlock);
assert (formalRequirementMCDC != null);
System.out.println();
System.out.println(formalRequirementMCDC.toString());
System.out.println();
}
/**
* Wrong {@link FormalRequirementMCDC}
*
* Creation should fail:
* Output inside of the guard. Creation should return null.
*/
@Test
public void test02() {
System.out.println("test02");
EList<Var> inputs = new BasicEList<Var>();
EList<Var> outputs = new BasicEList<Var>();
IExpressionTerm guard;
StatementSequence thenBlock, elseBlock;
// Outputs.
Var o0 = createVar("o0");
outputs.add(o0);
// Guard.
IntConst intG = intConst(42);
guard = lowerEqual(o0, intG);
// Else-Block.
thenBlock = singleAssignmentSequence(inputs, outputs);
// Else-Block.
elseBlock = singleAssignmentSequence(inputs, outputs);
// Formal Requirement MCDC.
FormalRequirementMCDC formalRequirementMCDC;
formalRequirementMCDC =
createFormalRequirementMCDC(inputs, outputs, guard, thenBlock, elseBlock);
assert (formalRequirementMCDC == null);
System.out.println();
}
/**
* Wrong {@link FormalRequirementMCDC}.
*
* Creation should fail:
* Input on lhs of an {@link Assignment} in thenBlock. Creation should return null.
*/
@Test
public void test03() {
System.out.println("test03");
EList<Var> inputs = new BasicEList<Var>();
EList<Var> outputs = new BasicEList<Var>();
IExpressionTerm guard;
StatementSequence thenBlock, elseBlock;
// Inputs.
Var i0 = createVar("i0");
Var i1 = createVar("i1");
Var iG = createVar("iG");
inputs.add(i0);
inputs.add(i1);
inputs.add(iG);
// Guard.
IntConst intG = intConst(42);
guard = lowerEqual(iG, intG);
// Then-Block.
Assignment t1 = assignment(i0, i1);
thenBlock = sequence(t1);
// Else-Block.
elseBlock = singleAssignmentSequence(inputs, outputs);
// Formal Requirement MCDC.
FormalRequirementMCDC formalRequirementMCDC;
formalRequirementMCDC =
createFormalRequirementMCDC(inputs, outputs, guard, thenBlock, elseBlock);
assert (formalRequirementMCDC == null);
System.out.println();
}
/**
* Wrong {@link FormalRequirementMCDC}.
*
* Creation should fail:
* Output on rhs of an {@link Assignment} (rhs is just the Output) in thenBlock. Creation should
* return null.
*/
@Test
public void test04() {
System.out.println("test04");
EList<Var> inputs = new BasicEList<Var>();
EList<Var> outputs = new BasicEList<Var>();
IExpressionTerm guard;
StatementSequence thenBlock, elseBlock;
// Inputs.
Var iG = createVar("iG");
inputs.add(iG);
// Outputs.
Var o0 = createVar("o0");
Var o1 = createVar("o1");
outputs.add(o0);
outputs.add(o1);
// Guard.
IntConst intG = intConst(42);
guard = lowerEqual(iG, intG);
// Then-Block.
Assignment t1 = assignment(o0, o1);
thenBlock = sequence(t1);
// Else-Block.
elseBlock = singleAssignmentSequence(inputs, outputs);
// Formal Requirement MCDC.
FormalRequirementMCDC formalRequirementMCDC;
formalRequirementMCDC =
createFormalRequirementMCDC(inputs, outputs, guard, thenBlock, elseBlock);
assert (formalRequirementMCDC == null);
System.out.println();
}
/**
* Wrong {@link FormalRequirementMCDC}.
*
* Creation should fail:
* Output on rhs of an {@link Assignment} (rhs is an {@link IExpressionTerm}) in thenBlock.
* Creation should return null.
*/
@Test
public void test05() {
System.out.println("test05");
EList<Var> inputs = new BasicEList<Var>();
EList<Var> outputs = new BasicEList<Var>();
IExpressionTerm guard;
StatementSequence thenBlock, elseBlock;
// Inputs.
Var iG = createVar("iG");
inputs.add(iG);
// Outputs.
Var o0 = createVar("o0");
Var o1 = createVar("o1");
outputs.add(o0);
outputs.add(o1);
// Guard.
IntConst intG = intConst(42);
guard = lowerEqual(iG, intG);
// Then-Block.
IExpressionTerm rhs = add(o1, intConst(42));
Assignment t1 = assignment(o0, rhs);
thenBlock = sequence(t1);
// Else-Block.
elseBlock = singleAssignmentSequence(inputs, outputs);
// Formal Requirement MCDC.
FormalRequirementMCDC formalRequirementMCDC;
formalRequirementMCDC =
createFormalRequirementMCDC(inputs, outputs, guard, thenBlock, elseBlock);
assert (formalRequirementMCDC == null);
System.out.println();
}
/**
* Wrong {@link FormalRequirementMCDC}.
*
* Creation should fail:
* Input on lhs of an {@link Assignment} in elseBlock. Creation should return null.
*/
@Test
public void test06() {