Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
naomod
faezeh-public
XTDL
Commits
b82f0262
Commit
b82f0262
authored
Jul 12, 2021
by
Faezeh KHORRAM
💬
Browse files
Update PSSMMutation.mutator
parent
68ffd910
Changes
1
Hide whitespace changes
Inline
Side-by-side
Mutation Testing/org.imt.tdl.PSSMMutation/src/PSSMMutation.mutator
View file @
b82f0262
...
...
@@ -5,22 +5,22 @@ metamodel "/org.imt.tdl.PSSMMutation/data/model/statemachines.ecore"
with blocks {
ccs "Creates a connected state" {
randomState = select one State
randomState = select one
Vertex where {self not typed Final
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
Sta
te where {self not typed FinalState}
randomState = select one
Ver
te
x
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
Sta
te where {self not typed FinalState
and self not typed Pseudostate
}
randomState2 = select one
Sta
te where {self not typed
FinalState and self not typed
Pseudostate}
randomState1 = select one
Ver
te
x
where {self not typed FinalState}
randomState2 = select one
Ver
te
x
where {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
Sta
te where {self not typed FinalState}
randomState = select one
Ver
te
x
where {self not typed FinalState}
create Transition with {name = random-string(1, 4), ^source = randomState}
}
rtr "Removes a transition"{
...
...
@@ -34,30 +34,30 @@ with blocks {
}
}
rst "Removes a state and adjacent transitions"{
remove one
Sta
te
remove one
Ver
te
x
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
transition = select one Transition where {^source is typed Pseudostate}
initial1 = select transition->^source
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
transition = select one Transition where {^target is typed FinalState}
final1 = select transition->^target
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
Sta
te where {self <> transition->^source}
state = select one
Ver
te
x
where {self
not typed FinalState and self
<> transition->^source}
modify transition with {^source = state}
}
rts "Changes the target state of a transition"{
transition = select one Transition
state = select one
Sta
te where {self <> transition->^target}
state = select one
Ver
te
x
where {self
not typed Pseudostate and self
<> transition->^target}
modify transition with {^target = state}
}
sdt "Swaps the direction of a transition"{
...
...
@@ -83,16 +83,16 @@ with blocks {
action = create Behavior with {name = random-string(1, 4)}
modify one Transition with {effect = action}
}
cat "Changes the action of a transition"{
ac
tion = select one
Behavior
transi
tion = select one
Transit
io
n
where {
effect <> action
}
modify transition with {effect = action}
cat "Changes the action of a transition"{
transi
tion = select one
Transition where {effect <> null}
ac
tion = select one
Behav
io
r
where {
self <> transition->effect
}
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}
modify one State where {self not typed FinalState} with {entry = action}
}
rco "Removes a constraint"{
remove one Constraint
}
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment