Commit e0611bd9 authored by Faezeh KHORRAM's avatar Faezeh KHORRAM 💬
Browse files

add wodel-test project for pssm and tdl

parent fdd8b96a
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.imt.tdl.PSSMMutation</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>wodel.project.sampleBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>builder.wodelTestBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>wodel.project.sampleNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>wodel.wodeltest.builder.wodelTestNature</nature>
</natures>
</projectDescription>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: PSSMMutation
Bundle-SymbolicName: org.imt.tdl.PSSMMutation;singleton:=true
Bundle-Version: 1.0.0
Require-Bundle: org.eclipse.emf.ecore,
wodel.models;bundle-version="1.0.0",
wodel.wodeltest;bundle-version="1.0.0",
org.eclipse.emf.compare;bundle-version="3.1.2",
org.eclipse.text,
org.eclipse.ocl.ecore;bundle-version="3.3.100",
wodel.utils;bundle-version="1.0.0",
org.eclipse.emf.common,
org.eclipse.e4.ui.workbench,
org.apache.log4j;bundle-version="1.2.15",
org.eclipse.ui,
org.eclipse.core.runtime;bundle-version="3.10.0",
com.google.guava;bundle-version="15.0.0",
org.eclipse.ocl;bundle-version="3.4.2",
org.eclipse.core.resources;bundle-version="3.12.0",
org.eclipse.emf.ecore.xmi;bundle-version="2.9.0",
org.imt.tdl.runner;bundle-version="1.0.0",
org.eclipse.jdt.core;bundle-version="3.24.0",
org.etsi.mts.tdl.model;bundle-version="1.4.0"
source.. = src-gen/,src/
bin.includes = META-INF/,\
.,\
plugin.xml
data/model
data/out
PSSMMutation.mutator
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="statemachines" nsURI="http://org.tetrabox.examples.statemachines.interpretedstatemachines/statemachines/"
nsPrefix="statemachines">
<eClassifiers xsi:type="ecore:EClass" name="CustomSystem">
<eStructuralFeatures xsi:type="ecore:EReference" name="statemachine" lowerBound="1"
eType="#//StateMachine" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="signals" upperBound="-1"
eType="#//Signal" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="operations" upperBound="-1"
eType="#//Operation" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Signal" eSuperTypes="#//NamedElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="attributes" upperBound="-1"
eType="#//Attribute" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Operation" eSuperTypes="#//NamedElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="inParameters" upperBound="-1"
eType="#//Attribute" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="outParameters" upperBound="-1"
eType="#//Attribute" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="return" eType="#//Attribute"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="EventType" abstract="true"/>
<eClassifiers xsi:type="ecore:EClass" name="SignalEventType" eSuperTypes="#//EventType">
<eStructuralFeatures xsi:type="ecore:EReference" name="signal" lowerBound="1"
eType="#//Signal"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="CallEventType" eSuperTypes="#//EventType">
<eStructuralFeatures xsi:type="ecore:EReference" name="operation" lowerBound="1"
eType="#//Operation"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Attribute" abstract="true" eSuperTypes="#//NamedElement"/>
<eClassifiers xsi:type="ecore:EClass" name="BooleanAttribute" eSuperTypes="#//Attribute"/>
<eClassifiers xsi:type="ecore:EClass" name="IntegerAttribute" eSuperTypes="#//Attribute"/>
<eClassifiers xsi:type="ecore:EClass" name="StringAttribute" eSuperTypes="#//Attribute"/>
<eClassifiers xsi:type="ecore:EClass" name="Constraint" abstract="true"/>
<eClassifiers xsi:type="ecore:EClass" name="BooleanConstraint" eSuperTypes="#//Constraint">
<eStructuralFeatures xsi:type="ecore:EReference" name="attribute" eType="#//BooleanAttribute"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="IntegerConstraint" eSuperTypes="#//Constraint">
<eStructuralFeatures xsi:type="ecore:EReference" name="attribute" eType="#//IntegerAttribute"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="StringConstraint" eSuperTypes="#//Constraint">
<eStructuralFeatures xsi:type="ecore:EReference" name="attribute" eType="#//StringAttribute"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="StateMachine" eSuperTypes="#//NamedElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="regions" lowerBound="1"
upperBound="-1" eType="#//Region" containment="true" eOpposite="#//Region/stateMachine"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Region" eSuperTypes="#//NamedElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="vertice" upperBound="-1"
eType="#//Vertex" containment="true" eOpposite="#//Vertex/container"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="transitions" upperBound="-1"
eType="#//Transition" containment="true" eOpposite="#//Transition/container"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="stateMachine" eType="#//StateMachine"
eOpposite="#//StateMachine/regions"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="state" eType="#//State"
eOpposite="#//State/regions"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="currentVertex" unique="false"
eType="#//Vertex">
<eAnnotations source="dynamic"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Vertex" abstract="true" eSuperTypes="#//NamedElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="container" eType="#//Region"
eOpposite="#//Region/vertice"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="outgoingTransitions" upperBound="-1"
eType="#//Transition" eOpposite="#//Transition/source"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" upperBound="-1"
eType="#//Transition" eOpposite="#//Transition/target"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Pseudostate" eSuperTypes="#//Vertex">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" lowerBound="1" eType="#//PseudostateKind"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="state" eType="#//State"
eOpposite="#//State/connectionPoint"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//Vertex">
<eStructuralFeatures xsi:type="ecore:EReference" name="regions" upperBound="-1"
eType="#//Region" containment="true" eOpposite="#//Region/state"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="entry" eType="#//Behavior"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="doActivity" eType="#//Behavior"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="exit" eType="#//Behavior"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="deferrableTriggers" upperBound="-1"
eType="#//Trigger" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="connectionPoint" upperBound="-1"
eType="#//Pseudostate" containment="true" eOpposite="#//Pseudostate/state"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="isEntryCompleted" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
<eAnnotations source="dynamic"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="isDoActivityCompleted"
unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
<eAnnotations source="dynamic"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="isExitCompleted" unique="false"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
<eAnnotations source="dynamic"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="FinalState" eSuperTypes="#//State"/>
<eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//NamedElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="source" lowerBound="1"
eType="#//Vertex" eOpposite="#//Vertex/outgoingTransitions"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="target" lowerBound="1"
eType="#//Vertex" eOpposite="#//Vertex/incomingTransitions"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="triggers" upperBound="-1"
eType="#//Trigger" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="container" lowerBound="1"
eType="#//Region" eOpposite="#//Region/transitions"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="#//TransitionKind"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="effect" eType="#//Behavior"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="constraint" eType="#//Constraint"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Trigger" eSuperTypes="#//NamedElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="eventType" lowerBound="1"
eType="#//EventType" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Behavior" eSuperTypes="#//NamedElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="emittedSignals" upperBound="-1"
eType="#//SignalEventOccurrence" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="OperationBehavior" eSuperTypes="#//Behavior">
<eStructuralFeatures xsi:type="ecore:EReference" name="attributeValues" upperBound="-1"
eType="#//AttributeValue" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AttributeValue" abstract="true">
<eAnnotations source="dynamic"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="BooleanAttributeValue" eSuperTypes="#//AttributeValue">
<eAnnotations source="dynamic"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="attribute" eType="#//BooleanAttribute"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="IntegerAttributeValue" eSuperTypes="#//AttributeValue">
<eAnnotations source="dynamic"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="attribute" eType="#//IntegerAttribute"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="StringAttributeValue" eSuperTypes="#//AttributeValue">
<eAnnotations source="dynamic"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="attribute" eType="#//StringAttribute"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="EventOccurrence" abstract="true">
<eAnnotations source="dynamic"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="CompletionEventOccurrence">
<eAnnotations source="dynamic"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="state" eType="#//State"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SignalEventOccurrence" eSuperTypes="#//EventOccurrence">
<eAnnotations source="dynamic"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="signal" lowerBound="1"
eType="#//Signal"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="attributeValues" upperBound="-1"
eType="#//AttributeValue" containment="true">
<eAnnotations source="dynamic"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="CallEventOccurrence" eSuperTypes="#//EventOccurrence">
<eAnnotations source="dynamic"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="operation" lowerBound="1"
eType="#//Operation"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="inParameterValues" upperBound="-1"
eType="#//AttributeValue" containment="true">
<eAnnotations source="dynamic"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="outParameterValues" upperBound="-1"
eType="#//AttributeValue" containment="true">
<eAnnotations source="dynamic"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="returnValue" eType="#//AttributeValue"
containment="true">
<eAnnotations source="dynamic"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="PseudostateKind">
<eLiterals name="initial"/>
<eLiterals name="join" value="1"/>
<eLiterals name="fork" value="2"/>
<eLiterals name="terminate" value="3"/>
<eLiterals name="entrypoint" value="4"/>
<eLiterals name="exitpoint" value="5"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="TransitionKind">
<eLiterals name="internal"/>
<eLiterals name="local" value="1"/>
<eLiterals name="external" value="2"/>
</eClassifiers>
</ecore:EPackage>
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="wodel.wodeltest.MutTest">
<wodeltest
class="org.imt.pssm.mutation.WodelTest">
</wodeltest>
</extension>
</plugin>
package mutator.PSSMMutation;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.AbstractMap.SimpleEntry;
import org.eclipse.core.resources.IProject;
import exceptions.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EPackage;
import mutator.PSSMMutation.PSSMMutation;
import manager.IMutatorExecutor;
import manager.IWodelTest;
import manager.ModelManager;
import manager.MutatorUtils;
import manager.MutatorUtils.MutationResults;
public class PSSMMutationLauncher implements IMutatorExecutor {
public MutationResults execute(int maxAttempts, int numMutants, boolean registry, boolean metrics,
boolean debugMetrics, String[] blockNames, IProject project, IProgressMonitor monitor, boolean serialize,
Object testObject, TreeMap<String, List<String>> classes)
throws ReferenceNonExistingException, WrongAttributeTypeException, MaxSmallerThanMinException,
AbstractCreationException, ObjectNoTargetableException, ObjectNotContainedException,
MetaModelNotFoundException, ModelNotFoundException, IOException {
IWodelTest test = testObject != null ? (IWodelTest) testObject : null;
String ecoreURI = "C:/labtop/gemoc_studio-nightly/workspaces/xTDL_EventManager/PSSMMutation/data/model/statemachines.ecore";
List<EPackage> packages = ModelManager.loadMetaModel(ecoreURI, this.getClass());
boolean isRegistered = ModelManager.isRegistered(packages);
Map<String, EPackage> registeredPackages = new HashMap<String, EPackage>();
if (isRegistered == true) {
registeredPackages = ModelManager.unregisterMetaModel(packages);
}
MutationResults mutationResults = new MutationResults();
MutatorUtils mutPSSMMutation = new PSSMMutation();
MutationResults resultsPSSMMutation = mutPSSMMutation.execute(maxAttempts, numMutants, registry, metrics,
debugMetrics, packages, registeredPackages, blockNames, project, monitor, serialize, test, classes);
mutationResults.numMutatorsApplied += resultsPSSMMutation.numMutatorsApplied;
mutationResults.numMutantsGenerated += resultsPSSMMutation.numMutantsGenerated;
if (resultsPSSMMutation.mutatorsApplied != null) {
if (mutationResults.mutatorsApplied == null) {
mutationResults.mutatorsApplied = new ArrayList<String>();
}
mutationResults.mutatorsApplied.addAll(resultsPSSMMutation.mutatorsApplied);
}
if (isRegistered == true) {
ModelManager.registerMetaModel(registeredPackages);
}
return mutationResults;
}
}
package mutator.org.imt.tdl.PSSMMutation;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.AbstractMap.SimpleEntry;
import org.eclipse.core.resources.IProject;
import exceptions.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EPackage;
import mutator.PSSMMutation.PSSMMutation;
import manager.IMutatorExecutor;
import manager.IWodelTest;
import manager.ModelManager;
import manager.MutatorUtils;
import manager.MutatorUtils.MutationResults;
public class org_imt_tdl_PSSMMutationLauncher implements IMutatorExecutor {
public MutationResults execute(int maxAttempts, int numMutants, boolean registry, boolean metrics,
boolean debugMetrics, String[] blockNames, IProject project, IProgressMonitor monitor, boolean serialize,
Object testObject, TreeMap<String, List<String>> classes)
throws ReferenceNonExistingException, WrongAttributeTypeException, MaxSmallerThanMinException,
AbstractCreationException, ObjectNoTargetableException, ObjectNotContainedException,
MetaModelNotFoundException, ModelNotFoundException, IOException {
IWodelTest test = testObject != null ? (IWodelTest) testObject : null;
String ecoreURI = "/org.imt.tdl.PSSMMutation/data/model/statemachines.ecore";
List<EPackage> packages = ModelManager.loadMetaModel(ecoreURI, this.getClass());
boolean isRegistered = ModelManager.isRegistered(packages);
Map<String, EPackage> registeredPackages = new HashMap<String, EPackage>();
if (isRegistered == true) {
registeredPackages = ModelManager.unregisterMetaModel(packages);
}
MutationResults mutationResults = new MutationResults();
MutatorUtils mutPSSMMutation = new PSSMMutation();
MutationResults resultsPSSMMutation = mutPSSMMutation.execute(maxAttempts, numMutants, registry, metrics,
debugMetrics, packages, registeredPackages, blockNames, project, monitor, serialize, test, classes);
mutationResults.numMutatorsApplied += resultsPSSMMutation.numMutatorsApplied;
mutationResults.numMutantsGenerated += resultsPSSMMutation.numMutantsGenerated;
if (resultsPSSMMutation.mutatorsApplied != null) {
if (mutationResults.mutatorsApplied == null) {
mutationResults.mutatorsApplied = new ArrayList<String>();
}
mutationResults.mutatorsApplied.addAll(resultsPSSMMutation.mutatorsApplied);
}
if (isRegistered == true) {
ModelManager.registerMetaModel(registeredPackages);
}
return mutationResults;
}
}
generate exhaustive mutants
in "data/out/"
from "data/model/"
metamodel "/org.imt.tdl.PSSMMutation/data/model/statemachines.ecore"
with blocks {
ccs "Creates a connected state" {
randomState = select one State
newState = create State with {name = random-string(1, 4), ^container = randomState->^container}
create Transition with {^source = randomState, ^target = newState}
}
ccfs "Creates a connected final state "{
randomState = select one State where {self not typed FinalState}
fs = create FinalState with {name = random-string(1, 4), ^container = randomState->^container}
create Transition with {^source = randomState, ^target = fs}
}
ctr "Creates a transition with random source and target states"{
randomState1 = select one State where {self not typed FinalState and self not typed Pseudostate}
randomState2 = select one State where {self not typed FinalState and self not typed Pseudostate}
create Transition with {name = random-string(1, 4), ^source = randomState1, ^target = randomState2}
}
ctr2 "Creates a transition with source but without target state"{
randomState = select one State where {self not typed FinalState}
create Transition with {name = random-string(1, 4), ^source = randomState}
}
rtr "Removes a transition"{
remove one Transition
}
dtr "Duplicates a transition"{
tr = select one Transition
create Transition with {
^container = tr->^container, ^source = tr->^source, ^target = tr->^target,
triggers = tr->triggers, effect = tr->effect, constraint = tr->constraint
}
}
rst "Removes a state and adjacent transitions"{
remove one State
remove all Transition where {^source = null}
remove all Transition where {^target = null}
}
cis "Changes the initial state to a different one"{
initial1 = select one Pseudostate
initial2 = select one Pseudostate where {self <> initial1}
transition = select one Transition where {^source = initial1}
modify transition with {^source = initial2}
}
cfs "Changes the final state to a different one"{
final1 = select one FinalState
final2 = select one FinalState where {self <> final1}
transition = select one Transition where {^target = final1}
modify transition with {^target = final2}
}
cst "Changes the source state of a transition"{
transition = select one Transition
state = select one State where {self <> transition->^source}
modify transition with {^source = state}
}
rts "Changes the target state of a transition"{
transition = select one Transition
state = select one State where {self <> transition->^target}
modify transition with {^target = state}
}
sdt "Swaps the direction of a transition"{
modify one Transition with {swapref(^source, ^target)}
}
rev "Removes an event"{
remove one Trigger
}
cev "Creates an event and set it to a transition"{
signalEventType = create SignalEventType with {signal = one Signal}
event = create Trigger with {name = random-string(1, 4), eventType = signalEventType}
modify one Transition with {triggers = event}
}
cet "Changes the event of a transition"{
event = select one Trigger
transition = select one Transition where {triggers <> event}
modify transition with {triggers = event}
}
rac "Removes an action"{
remove one Behavior
}
cac "Creates an action and set it to a transition"{
action = create Behavior with {name = random-string(1, 4)}
modify one Transition with {effect = action}
}
cat "Changes the action of a transition"{
action = select one Behavior
transition = select one Transition where {effect <> action}
modify transition with {effect = action}
}
cas "Creates an action and set it to a state"{
action = create Behavior with {name = random-string(1, 4)}
modify one State where {self not typed FinalState and self not typed Pseudostate} with {entry = action}
}
rco "Removes a constraint"{
remove one Constraint
}
}
\ No newline at end of file
package org.imt.pssm.mutation;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.jdt.core.JavaCore;
import org.etsi.mts.tdl.Package;
import org.etsi.mts.tdl.TestDescription;
import org.imt.tdl.runner.Failure;
import org.imt.tdl.runner.Result;
import org.imt.tdl.runner.TDLCore;
import manager.IOUtils;
import manager.IWodelTest;
import manager.ModelManager;
import manager.WodelTestGlobalResult;
import manager.WodelTestGlobalResult.Status;
import manager.WodelTestInfo;
import manager.WodelTestResult;
import manager.WodelTestResultClass;
public class WodelTest implements IWodelTest {
String workspacePath;
List<String> seedModels = new ArrayList<>();
Map<String, Result> seedModelsTestResult = new HashMap<>();
@Override
public String getProjectName() {
return "PSSMMutation";
}
@Override
public String getNatureId() {
return JavaCore.NATURE_ID;
}