M. dos Santos, S. Hallé, F. Petrillo
Marcela Gonçalves dos Santos
Sylvain Hallé
Université du Québec à Chicoutimi
CANADA
Mutation Testing for Industrial
Robotic Systems
CRSNG
NSERC
Fábio Petrillo
École de technologie supérieure
CANADA
FMAS, September 17th 2025
M. dos Santos, S. Hallé, F. Petrillo
Industrial robotic system
A robot is "a programmed actuated mechanism
with a degree of autonomy to perform locomotion,
manipulation or positioning" (ISO 9373).
This excludes:
Software
Voice assistants
Autonomous cars
ATMs
Smart appliances
Industrial robots are
robots for use in
automation applications in
an industrial environment.
M. dos Santos, S. Hallé, F. Petrillo
When IRSs fail
369 robot-related accident cases reported in Korea
betwen 2010 and 2019*
*Lee, K., Shin, J. & Lim, J.-Y. (2021). Critical
Hazard Factors in the Risk Assessments of
Industrial Robots: Causal Analysis and Case
Studies. Safety and Health at Work.
IRSs are non-operational
12% of the time. This
downtime is partly due to
program faults and
sensor faults**
**Tsarouhas, P
. H. & Fourlas, G. K. (2015).
Reliability and Maintainability Analysis ofa
Robotic System for Industrial Applications: A
Case Study. International Journal
ofPerformability Engineering, 11(5), 453
M. dos Santos, S. Hallé, F. Petrillo
Testing practices in IRSs*
There are multiple ways to assess the robustness of
an IRS...
*A. Afzal, C. L. Goues, M. Hilton, and C. S. Timperley. 2020. A Study on Challenges of
Testing Robotic Systems. ICST 2020
Logging and playback
Compliance testing
Robustness testing
Regression testing
Performance testing
Continuous integration
...and multiple challenges:
Cost and resources
Lack of oracle
Environmental complexity
Software/hardware
integration
Distrust of simulation
M. dos Santos, S. Hallé, F. Petrillo
Testing practices in IRSs*
There are multiple ways to assess the robustness of
an IRS...
*A. Afzal, C. L. Goues, M. Hilton, and C. S. Timperley. 2020. A Study on Challenges of
Testing Robotic Systems. ICST 2020
Logging and playback
Compliance testing
Robustness testing
Regression testing
Performance testing
Continuous integration
...and multiple challenges:
Cost and resources
Lack of oracle
Environmental complexity
Software/hardware
integration
Distrust of simulation
M. dos Santos, S. Hallé, F. Petrillo
Testing practices in IRSs*
There are multiple ways to assess the robustness of
an IRS...
*A. Afzal, C. L. Goues, M. Hilton, and C. S. Timperley. 2020. A Study on Challenges of
Testing Robotic Systems. ICST 2020
Logging and playback
Compliance testing
Robustness testing
Regression testing
Performance testing
Continuous integration
...and multiple challenges:
Cost and resources
Lack of oracle
Environmental complexity
Software/hardware
integration
Distrust of simulation
"We mostly do field testing.
That’s what really affects what
happens. [...] Simulation just doesn’t
reflect the real world."
M. dos Santos, S. Hallé, F. Petrillo
Simulation and testing
Advantages of simulation:
eliminates the necessity for physical
prototypes1
offer a cost-effective means to implement
changes2
many real-world robotics bugs can be
replicated and addressed in simulation
environments3
mitigates the risk of damaging equipment4
Roth, H., Ruehl, M. & Dueber, F. (2003). A robot simulation system for small and medium-
sized companies.
Robert, C., Sotiropoulos, T., Waeselynck, H., Guiochet, J. & Vernhes, S. (2020). The virtual
lands of Oz: testing an agribot in simulation.
Timperley, C., Afzal, A., Katz, D. S., Hernandez, J. & Le Goues, C. (2018). Crashing
Simulated Planes is Cheap: Can Simulation Detect Robotics Bugs Early?
Bossecker, E., Sousa Calepso, A., Kaiser, B., Verl, A. & Sedlmair, M. (2023). A Virtual Reality
Simulator for Timber Fabrication Tasks Using Industrial Robotic Arms.
1.
2.
3.
4.
M. dos Santos, S. Hallé, F. Petrillo
Simulation and testing
Advantages of simulation:
eliminates the necessity for physical
prototypes1
offer a cost-effective means to implement
changes2
many real-world robotics bugs can be
replicated and addressed in simulation
environments3
mitigates the risk of damaging equipment4
+ ability to run a large number of scenarios(us)
M. dos Santos, S. Hallé, F. Petrillo
Simulation and testing
Formal verification in the physical world is
infeasible...
...but how can we assess the strength of a test
suite? ("lightweight formal method")
capability to detect faults
M. dos Santos, S. Hallé, F. Petrillo
Simulation and testing
Formal verification in the physical world is
infeasible...
...but how can we assess the strength of a test
suite? ("lightweight formal method")
capability to detect faults
Mutation testing
Technique consisting of applying small
modifications to a program to simulate
potential defects
M. dos Santos, S. Hallé, F. Petrillo
Principle
M. dos Santos, S. Hallé, F. Petrillo
Principle
original
program
M. dos Santos, S. Hallé, F. Petrillo
Principle
mutant #1
mutant #n
.
.
.
original
program
M. dos Santos, S. Hallé, F. Petrillo
Principle
mutant #1
mutant #n
.
.
.
TEST
SUITE
original
program
M. dos Santos, S. Hallé, F. Petrillo
Principle
mutant #1
mutant #n
.
.
.
mutant is
killed
fail
TEST
SUITE
original
program
M. dos Santos, S. Hallé, F. Petrillo
Principle
mutant #1
mutant #n
.
.
.
mutant is
killed
fail
mutant has
survived
pass
TEST
SUITE
original
program
M. dos Santos, S. Hallé, F. Petrillo
Surviving mutants
A surviving mutant is indicative of a
gap in the testing coverage:
the mutant program is (likely)
incorrect, yet no test case
catches the error*
*Unless it is an equivalent mutant
Typically, new cases are added to the test suite
until the mutant is killed
M. dos Santos, S. Hallé, F. Petrillo
Example
M. dos Santos, S. Hallé, F. Petrillo
Example
Program
function sum(a)
local t = 0
for i = 0, |a| - 1 do
t = t + a[i]
end
return t
end
P
M. dos Santos, S. Hallé, F. Petrillo
Example
Program
function sum(a)
local t = 0
for i = 0, |a| - 1 do
t = t + a[i]
end
return t
end
P
assert sum([0]) == 0
1
assert sum([2,0]) == 2
2
assert sum([]) == 0
3
Test cases
M. dos Santos, S. Hallé, F. Petrillo
Example
Program
function sum(a)
local t = 0
for i = 0, |a| - 1 do
t = t + a[i]
end
return t
end
P
assert sum([0]) == 0
1
assert sum([2,0]) == 2
2
assert sum([]) == 0
3
Test cases
M. dos Santos, S. Hallé, F. Petrillo
Example
Program
function sum(a)
local t = 0
for i = 0, |a| - 1 do
t = t + a[i]
end
return t
end
P
assert sum([0]) == 0
1
assert sum([2,0]) == 2
2
assert sum([]) == 0
3
Test cases
Mutant A
function sum(a)
local t = 1
for i = 0, |a| - 1 do
t = t + a[i]
end
return t
end
M
M. dos Santos, S. Hallé, F. Petrillo
Example
Program
function sum(a)
local t = 0
for i = 0, |a| - 1 do
t = t + a[i]
end
return t
end
P
assert sum([0]) == 0
1
assert sum([2,0]) == 2
2
assert sum([]) == 0
3
Test cases
Mutant A
function sum(a)
local t = 1
for i = 0, |a| - 1 do
t = t + a[i]
end
return t
end
M
M. dos Santos, S. Hallé, F. Petrillo
Example
Program
function sum(a)
local t = 0
for i = 0, |a| - 1 do
t = t + a[i]
end
return t
end
P
assert sum([0]) == 0
1
assert sum([2,0]) == 2
2
assert sum([]) == 0
3
Test cases
Mutant A
function sum(a)
local t = 1
for i = 0, |a| - 1 do
t = t + a[i]
end
return t
end
M
Mutant B
function sum(a)
local t = 0
for i = 0, |a| - 2 do
t = t + a[i]
end
return t
end
M
M. dos Santos, S. Hallé, F. Petrillo
Example
Program
function sum(a)
local t = 0
for i = 0, |a| - 1 do
t = t + a[i]
end
return t
end
P
assert sum([0]) == 0
1
assert sum([2,0]) == 2
2
assert sum([]) == 0
3
Test cases
Mutant A
function sum(a)
local t = 1
for i = 0, |a| - 1 do
t = t + a[i]
end
return t
end
M
Mutant B
function sum(a)
local t = 0
for i = 0, |a| - 2 do
t = t + a[i]
end
return t
end
M
M. dos Santos, S. Hallé, F. Petrillo
Creating mutants
Mutants are created by applying mutation
operators:
They are intended to represent typical errors that
could be made by a programmer.
M. dos Santos, S. Hallé, F. Petrillo
A robot program
A typical robot program has most of its logic
embedded in string parameters:
It contains relatively few arithmetic operations and
control structures
send(“pick”)
send(“lift/5”)
if read(“color”) == “red” then
send(“turn/90”)
else
send(“turn/270”)
end
send(“drop/5”)
send(“release”)
M. dos Santos, S. Hallé, F. Petrillo
Issue(s)
Issue #1: applying "traditional" mutation operators
often generate invalid robot commands...
send(“pick”)
send(“lift/5”)
if read(“color”) == “red” then
send(“turn/90”)
else
send(“turn/270”)
end
send(“drop/5”)
send(“release”)
M. dos Santos, S. Hallé, F. Petrillo
Issue(s)
Issue #1: applying "traditional" mutation operators
often generate invalid robot commands...
send(“pickl”)
send(“lift/5”)
if read(“color”) == “red” then
send(“turn/90”)
else
send(“turn/270”)
end
send(“drop/5”)
send(“release”)
...resulting in mutants that fail every test and
provide no informative value
M. dos Santos, S. Hallé, F. Petrillo
send(“pick”)
send(“lift/5”)
if read(“color”) == “red” then
send(“turn/90”)
else
send(“turn/270”)
end
send(“drop/6”)
send(“release”)
Issue(s)
Issue #2a: even when mutation operators follow
correct syntax...
...small parameter changes, like off-by-one errors,
can create robot actions that cannot be executed in
the real world
M. dos Santos, S. Hallé, F. Petrillo
send(“pick”)
send(“lift/5”)
if read(“color”) == “red” then
send(“turn/90”)
else
send(“turn/270”)
end
send(“drop/6”)
send(“release”)
5
Issue(s)
Issue #2a: even when mutation operators follow
correct syntax...
...small parameter changes, like off-by-one errors,
can create robot actions that cannot be executed in
the real world
M. dos Santos, S. Hallé, F. Petrillo
send(“pick”)
send(“lift/5”)
if read(“color”) == “red” then
send(“turn/90”)
else
send(“turn/270”)
end
send(“drop/6”)
send(“release”)
5 6
!
Issue(s)
Issue #2a: even when mutation operators follow
correct syntax...
...small parameter changes, like off-by-one errors,
can create robot actions that cannot be executed in
the real world
M. dos Santos, S. Hallé, F. Petrillo
send(“pick”)
send(“lift/5”)
if read(“color”) == “red” then
send(“turn/90”)
else
send(“turn/270”)
end
send(“drop/5”)
send(“release”)
Issue(s)
Issue #2b: even when mutation operators follow
correct syntax...
...on the contrary, a mutation may be valid but fail
to introduce any meaningful behavioral difference
M. dos Santos, S. Hallé, F. Petrillo
send(“pick”)
send(“lift/5”)
if read(“color”) == “red” then
send(“turn/90”)
else
send(“turn/270”)
end
send(“drop/5”)
send(“release”)
Issue(s)
Issue #2b: even when mutation operators follow
correct syntax...
...on the contrary, a mutation may be valid but fail
to introduce any meaningful behavioral difference
M. dos Santos, S. Hallé, F. Petrillo
Issue(s)
Issue #2b: even when mutation operators follow
correct syntax...
...on the contrary, a mutation may be valid but fail
to introduce any meaningful behavioral difference
send(“pick”)
send(“lift/5”)
if read(“color”) == “red” then
send(“turn/89”)
else
send(“turn/270”)
end
send(“drop/5”)
send(“release”)
M. dos Santos, S. Hallé, F. Petrillo
The need for new operators
Either way, these mutants provide no added value
as they are unable to reveal any new gap in the
coverage achieved by the test suite.
Hence the need for...
M. dos Santos, S. Hallé, F. Petrillo
The need for new operators
Either way, these mutants provide no added value
as they are unable to reveal any new gap in the
coverage achieved by the test suite.
Hence the need for...
mutation operators taking into account the fact
that a robot program is not just any piece of
procedural code
M. dos Santos, S. Hallé, F. Petrillo
The need for new operators
Either way, these mutants provide no added value
as they are unable to reveal any new gap in the
coverage achieved by the test suite.
Hence the need for...
mutation operators taking into account the fact
that a robot program is not just any piece of
procedural code
but a specific type of program that manipulates
robotic components interacting with the physical
world
M. dos Santos, S. Hallé, F. Petrillo
The need for new operators
Mutation operators are representative of typical
errors made by programmers.
So what are the typical errors made by robot
programmers?
M. dos Santos, S. Hallé, F. Petrillo
Confuse forward and backward
Invert left and right
Forget an instruction (e.g. pick before lift)
Apply a rotation to the wrong joint
Fail to identify non-idempotent instructions
Don't account for sensor imprecision
Exceed the technical limitations of the robot
(not exhaustive!)
The need for new operators
Mutation operators are representative of typical
errors made by programmers.
So what are the typical errors made by robot
programmers?
M. dos Santos, S. Hallé, F. Petrillo
The need for new operators
turn left by X turn right by X
move forward
by X
move backward
by X
OP
operation nothing
x-axis y-axis
success failure
angular unit X angular unit Y
rad
o
angle = X angle = -X
angle = X angle = X+k
length unit X length unit Y
cm
in
distance = X distance = -X
distance = X distance = X+k
M. dos Santos, S. Hallé, F. Petrillo
Preliminary evaluation
We used the Gazebo simulator to simulate a Gen3
robot with an end-point gripper from Robotiq
(2F-85)
M. dos Santos, S. Hallé, F. Petrillo
Preliminary evaluation
The task is a (classical) pick-and-place scenario
https://www.youtube.com/watch?v=9S0R0mGKA-I
Yu Sun et al. (2018). Robotic Grasping and
Manipulation Competition: Task Pool. In Yu
Sun & JoeFalco, editors: Robotic Grasping
and Manipulation, Springer.
10.1007/978-3-319-94568-2_1
M. dos Santos, S. Hallé, F. Petrillo
Preliminary evaluation
Sample of 26 generated mutants:
M. dos Santos, S. Hallé, F. Petrillo
Preliminary evaluation
5 rounds of testing (to account for variation in
generated noise)
Mutation score
Round
1
2
3
4
5
%
92
85
92
88
88
+
% =
Surviving mutants were
#5, #10, #14, #20 and
#24.
M. dos Santos, S. Hallé, F. Petrillo
Examining surviving mutants
Mutant #5
5
Inserts a redundant grip instruction
Does not prevent task
completion...
...but the extra motion
could impact the overall
mission timing
M. dos Santos, S. Hallé, F. Petrillo
Examining surviving mutants
Mutant #5
5
Inserts a redundant grip instruction
Does not prevent task
completion...
...but the extra motion
could impact the overall
mission timing
Test suite is missing a non-
functional requirement
M. dos Santos, S. Hallé, F. Petrillo
Examining surviving mutants
Mutant #10
1
0
Reverses the sign on position sensor on
the y-axis
The deviation remained
within the 0.02 cm
threshold
...but only because the
expected position was
close to 0
M. dos Santos, S. Hallé, F. Petrillo
Test suite vulnerable to a translation
of the coordinate system
Examining surviving mutants
Mutant #10
1
0
Reverses the sign on position sensor on
the y-axis
The deviation remained
within the 0.02 cm
threshold
...but only because the
expected position was
close to 0
M. dos Santos, S. Hallé, F. Petrillo
Examining surviving mutants
Mutants #14, #20, #24
2
4
1
4
Add Gaussian noise to position readings
Perhaps the position is
within the tolrance limit...
...but then these mutants
are equivalent to the
original program
2
0
M. dos Santos, S. Hallé, F. Petrillo
Test suite partially accounts for
imprecision in sensor readings
Examining surviving mutants
Mutants #14, #20, #24
2
4
1
4
Add Gaussian noise to position readings
Perhaps the position is
within the tolrance limit...
...but then these mutants
are equivalent to the
original program
2
0
M. dos Santos, S. Hallé, F. Petrillo
Take-home points
Classical mutation operators treat a robot
program just like any other program, and result
in a low mutation score*
Using domain-specific operators increases the
likelihood of generating mutants that reveal
gaps in the test coverage
Simulation is essential to run the mutants due to
their large number
*Uğur Yayan (2023): ROSMutation: Mutation Based Automated
Testing for ROS Compatible Robotic Software. Advances in
Electrical and Computer Engineering 23(3), pp. 47–56, doi:
10.4316/AECE.2023.03006.
M. dos Santos, S. Hallé, F. Petrillo
Threats to validity
Internal validity
Results depend on the fidelity of the Gazebo
simulator
External validity
Findings based on a single task (pick-and-place)
Set of mutation operators is not exhaustive
Construct validity
Uses mutation score as the measure of test
effectiveness
M. dos Santos, S. Hallé, F. Petrillo
Future work
Develop framework for ROS to automatically
generate robot-mutants
Apply methodology on other scenarios
Extend the set of mutation operators to account
for different sensors/actuators
M. dos Santos, S. Hallé, F. Petrillo
Thank you!
Future work
Develop framework for ROS to automatically
generate robot-mutants
Apply methodology on other scenarios
Extend the set of mutation operators to account
for different sensors/actuators

Mutation Testing for Industrial Robotic Systems (FMAS 2025)

  • 1.
    M. dos Santos,S. Hallé, F. Petrillo Marcela Gonçalves dos Santos Sylvain Hallé Université du Québec à Chicoutimi CANADA Mutation Testing for Industrial Robotic Systems CRSNG NSERC Fábio Petrillo École de technologie supérieure CANADA FMAS, September 17th 2025
  • 2.
    M. dos Santos,S. Hallé, F. Petrillo Industrial robotic system A robot is "a programmed actuated mechanism with a degree of autonomy to perform locomotion, manipulation or positioning" (ISO 9373). This excludes: Software Voice assistants Autonomous cars ATMs Smart appliances Industrial robots are robots for use in automation applications in an industrial environment.
  • 3.
    M. dos Santos,S. Hallé, F. Petrillo When IRSs fail 369 robot-related accident cases reported in Korea betwen 2010 and 2019* *Lee, K., Shin, J. & Lim, J.-Y. (2021). Critical Hazard Factors in the Risk Assessments of Industrial Robots: Causal Analysis and Case Studies. Safety and Health at Work. IRSs are non-operational 12% of the time. This downtime is partly due to program faults and sensor faults** **Tsarouhas, P . H. & Fourlas, G. K. (2015). Reliability and Maintainability Analysis ofa Robotic System for Industrial Applications: A Case Study. International Journal ofPerformability Engineering, 11(5), 453
  • 4.
    M. dos Santos,S. Hallé, F. Petrillo Testing practices in IRSs* There are multiple ways to assess the robustness of an IRS... *A. Afzal, C. L. Goues, M. Hilton, and C. S. Timperley. 2020. A Study on Challenges of Testing Robotic Systems. ICST 2020 Logging and playback Compliance testing Robustness testing Regression testing Performance testing Continuous integration ...and multiple challenges: Cost and resources Lack of oracle Environmental complexity Software/hardware integration Distrust of simulation
  • 5.
    M. dos Santos,S. Hallé, F. Petrillo Testing practices in IRSs* There are multiple ways to assess the robustness of an IRS... *A. Afzal, C. L. Goues, M. Hilton, and C. S. Timperley. 2020. A Study on Challenges of Testing Robotic Systems. ICST 2020 Logging and playback Compliance testing Robustness testing Regression testing Performance testing Continuous integration ...and multiple challenges: Cost and resources Lack of oracle Environmental complexity Software/hardware integration Distrust of simulation
  • 6.
    M. dos Santos,S. Hallé, F. Petrillo Testing practices in IRSs* There are multiple ways to assess the robustness of an IRS... *A. Afzal, C. L. Goues, M. Hilton, and C. S. Timperley. 2020. A Study on Challenges of Testing Robotic Systems. ICST 2020 Logging and playback Compliance testing Robustness testing Regression testing Performance testing Continuous integration ...and multiple challenges: Cost and resources Lack of oracle Environmental complexity Software/hardware integration Distrust of simulation "We mostly do field testing. That’s what really affects what happens. [...] Simulation just doesn’t reflect the real world."
  • 7.
    M. dos Santos,S. Hallé, F. Petrillo Simulation and testing Advantages of simulation: eliminates the necessity for physical prototypes1 offer a cost-effective means to implement changes2 many real-world robotics bugs can be replicated and addressed in simulation environments3 mitigates the risk of damaging equipment4 Roth, H., Ruehl, M. & Dueber, F. (2003). A robot simulation system for small and medium- sized companies. Robert, C., Sotiropoulos, T., Waeselynck, H., Guiochet, J. & Vernhes, S. (2020). The virtual lands of Oz: testing an agribot in simulation. Timperley, C., Afzal, A., Katz, D. S., Hernandez, J. & Le Goues, C. (2018). Crashing Simulated Planes is Cheap: Can Simulation Detect Robotics Bugs Early? Bossecker, E., Sousa Calepso, A., Kaiser, B., Verl, A. & Sedlmair, M. (2023). A Virtual Reality Simulator for Timber Fabrication Tasks Using Industrial Robotic Arms. 1. 2. 3. 4.
  • 8.
    M. dos Santos,S. Hallé, F. Petrillo Simulation and testing Advantages of simulation: eliminates the necessity for physical prototypes1 offer a cost-effective means to implement changes2 many real-world robotics bugs can be replicated and addressed in simulation environments3 mitigates the risk of damaging equipment4 + ability to run a large number of scenarios(us)
  • 9.
    M. dos Santos,S. Hallé, F. Petrillo Simulation and testing Formal verification in the physical world is infeasible... ...but how can we assess the strength of a test suite? ("lightweight formal method") capability to detect faults
  • 10.
    M. dos Santos,S. Hallé, F. Petrillo Simulation and testing Formal verification in the physical world is infeasible... ...but how can we assess the strength of a test suite? ("lightweight formal method") capability to detect faults Mutation testing Technique consisting of applying small modifications to a program to simulate potential defects
  • 11.
    M. dos Santos,S. Hallé, F. Petrillo Principle
  • 12.
    M. dos Santos,S. Hallé, F. Petrillo Principle original program
  • 13.
    M. dos Santos,S. Hallé, F. Petrillo Principle mutant #1 mutant #n . . . original program
  • 14.
    M. dos Santos,S. Hallé, F. Petrillo Principle mutant #1 mutant #n . . . TEST SUITE original program
  • 15.
    M. dos Santos,S. Hallé, F. Petrillo Principle mutant #1 mutant #n . . . mutant is killed fail TEST SUITE original program
  • 16.
    M. dos Santos,S. Hallé, F. Petrillo Principle mutant #1 mutant #n . . . mutant is killed fail mutant has survived pass TEST SUITE original program
  • 17.
    M. dos Santos,S. Hallé, F. Petrillo Surviving mutants A surviving mutant is indicative of a gap in the testing coverage: the mutant program is (likely) incorrect, yet no test case catches the error* *Unless it is an equivalent mutant Typically, new cases are added to the test suite until the mutant is killed
  • 18.
    M. dos Santos,S. Hallé, F. Petrillo Example
  • 19.
    M. dos Santos,S. Hallé, F. Petrillo Example Program function sum(a) local t = 0 for i = 0, |a| - 1 do t = t + a[i] end return t end P
  • 20.
    M. dos Santos,S. Hallé, F. Petrillo Example Program function sum(a) local t = 0 for i = 0, |a| - 1 do t = t + a[i] end return t end P assert sum([0]) == 0 1 assert sum([2,0]) == 2 2 assert sum([]) == 0 3 Test cases
  • 21.
    M. dos Santos,S. Hallé, F. Petrillo Example Program function sum(a) local t = 0 for i = 0, |a| - 1 do t = t + a[i] end return t end P assert sum([0]) == 0 1 assert sum([2,0]) == 2 2 assert sum([]) == 0 3 Test cases
  • 22.
    M. dos Santos,S. Hallé, F. Petrillo Example Program function sum(a) local t = 0 for i = 0, |a| - 1 do t = t + a[i] end return t end P assert sum([0]) == 0 1 assert sum([2,0]) == 2 2 assert sum([]) == 0 3 Test cases Mutant A function sum(a) local t = 1 for i = 0, |a| - 1 do t = t + a[i] end return t end M
  • 23.
    M. dos Santos,S. Hallé, F. Petrillo Example Program function sum(a) local t = 0 for i = 0, |a| - 1 do t = t + a[i] end return t end P assert sum([0]) == 0 1 assert sum([2,0]) == 2 2 assert sum([]) == 0 3 Test cases Mutant A function sum(a) local t = 1 for i = 0, |a| - 1 do t = t + a[i] end return t end M
  • 24.
    M. dos Santos,S. Hallé, F. Petrillo Example Program function sum(a) local t = 0 for i = 0, |a| - 1 do t = t + a[i] end return t end P assert sum([0]) == 0 1 assert sum([2,0]) == 2 2 assert sum([]) == 0 3 Test cases Mutant A function sum(a) local t = 1 for i = 0, |a| - 1 do t = t + a[i] end return t end M Mutant B function sum(a) local t = 0 for i = 0, |a| - 2 do t = t + a[i] end return t end M
  • 25.
    M. dos Santos,S. Hallé, F. Petrillo Example Program function sum(a) local t = 0 for i = 0, |a| - 1 do t = t + a[i] end return t end P assert sum([0]) == 0 1 assert sum([2,0]) == 2 2 assert sum([]) == 0 3 Test cases Mutant A function sum(a) local t = 1 for i = 0, |a| - 1 do t = t + a[i] end return t end M Mutant B function sum(a) local t = 0 for i = 0, |a| - 2 do t = t + a[i] end return t end M
  • 26.
    M. dos Santos,S. Hallé, F. Petrillo Creating mutants Mutants are created by applying mutation operators: They are intended to represent typical errors that could be made by a programmer.
  • 27.
    M. dos Santos,S. Hallé, F. Petrillo A robot program A typical robot program has most of its logic embedded in string parameters: It contains relatively few arithmetic operations and control structures send(“pick”) send(“lift/5”) if read(“color”) == “red” then send(“turn/90”) else send(“turn/270”) end send(“drop/5”) send(“release”)
  • 28.
    M. dos Santos,S. Hallé, F. Petrillo Issue(s) Issue #1: applying "traditional" mutation operators often generate invalid robot commands... send(“pick”) send(“lift/5”) if read(“color”) == “red” then send(“turn/90”) else send(“turn/270”) end send(“drop/5”) send(“release”)
  • 29.
    M. dos Santos,S. Hallé, F. Petrillo Issue(s) Issue #1: applying "traditional" mutation operators often generate invalid robot commands... send(“pickl”) send(“lift/5”) if read(“color”) == “red” then send(“turn/90”) else send(“turn/270”) end send(“drop/5”) send(“release”) ...resulting in mutants that fail every test and provide no informative value
  • 30.
    M. dos Santos,S. Hallé, F. Petrillo send(“pick”) send(“lift/5”) if read(“color”) == “red” then send(“turn/90”) else send(“turn/270”) end send(“drop/6”) send(“release”) Issue(s) Issue #2a: even when mutation operators follow correct syntax... ...small parameter changes, like off-by-one errors, can create robot actions that cannot be executed in the real world
  • 31.
    M. dos Santos,S. Hallé, F. Petrillo send(“pick”) send(“lift/5”) if read(“color”) == “red” then send(“turn/90”) else send(“turn/270”) end send(“drop/6”) send(“release”) 5 Issue(s) Issue #2a: even when mutation operators follow correct syntax... ...small parameter changes, like off-by-one errors, can create robot actions that cannot be executed in the real world
  • 32.
    M. dos Santos,S. Hallé, F. Petrillo send(“pick”) send(“lift/5”) if read(“color”) == “red” then send(“turn/90”) else send(“turn/270”) end send(“drop/6”) send(“release”) 5 6 ! Issue(s) Issue #2a: even when mutation operators follow correct syntax... ...small parameter changes, like off-by-one errors, can create robot actions that cannot be executed in the real world
  • 33.
    M. dos Santos,S. Hallé, F. Petrillo send(“pick”) send(“lift/5”) if read(“color”) == “red” then send(“turn/90”) else send(“turn/270”) end send(“drop/5”) send(“release”) Issue(s) Issue #2b: even when mutation operators follow correct syntax... ...on the contrary, a mutation may be valid but fail to introduce any meaningful behavioral difference
  • 34.
    M. dos Santos,S. Hallé, F. Petrillo send(“pick”) send(“lift/5”) if read(“color”) == “red” then send(“turn/90”) else send(“turn/270”) end send(“drop/5”) send(“release”) Issue(s) Issue #2b: even when mutation operators follow correct syntax... ...on the contrary, a mutation may be valid but fail to introduce any meaningful behavioral difference
  • 35.
    M. dos Santos,S. Hallé, F. Petrillo Issue(s) Issue #2b: even when mutation operators follow correct syntax... ...on the contrary, a mutation may be valid but fail to introduce any meaningful behavioral difference send(“pick”) send(“lift/5”) if read(“color”) == “red” then send(“turn/89”) else send(“turn/270”) end send(“drop/5”) send(“release”)
  • 36.
    M. dos Santos,S. Hallé, F. Petrillo The need for new operators Either way, these mutants provide no added value as they are unable to reveal any new gap in the coverage achieved by the test suite. Hence the need for...
  • 37.
    M. dos Santos,S. Hallé, F. Petrillo The need for new operators Either way, these mutants provide no added value as they are unable to reveal any new gap in the coverage achieved by the test suite. Hence the need for... mutation operators taking into account the fact that a robot program is not just any piece of procedural code
  • 38.
    M. dos Santos,S. Hallé, F. Petrillo The need for new operators Either way, these mutants provide no added value as they are unable to reveal any new gap in the coverage achieved by the test suite. Hence the need for... mutation operators taking into account the fact that a robot program is not just any piece of procedural code but a specific type of program that manipulates robotic components interacting with the physical world
  • 39.
    M. dos Santos,S. Hallé, F. Petrillo The need for new operators Mutation operators are representative of typical errors made by programmers. So what are the typical errors made by robot programmers?
  • 40.
    M. dos Santos,S. Hallé, F. Petrillo Confuse forward and backward Invert left and right Forget an instruction (e.g. pick before lift) Apply a rotation to the wrong joint Fail to identify non-idempotent instructions Don't account for sensor imprecision Exceed the technical limitations of the robot (not exhaustive!) The need for new operators Mutation operators are representative of typical errors made by programmers. So what are the typical errors made by robot programmers?
  • 41.
    M. dos Santos,S. Hallé, F. Petrillo The need for new operators turn left by X turn right by X move forward by X move backward by X OP operation nothing x-axis y-axis success failure angular unit X angular unit Y rad o angle = X angle = -X angle = X angle = X+k length unit X length unit Y cm in distance = X distance = -X distance = X distance = X+k
  • 42.
    M. dos Santos,S. Hallé, F. Petrillo Preliminary evaluation We used the Gazebo simulator to simulate a Gen3 robot with an end-point gripper from Robotiq (2F-85)
  • 43.
    M. dos Santos,S. Hallé, F. Petrillo Preliminary evaluation The task is a (classical) pick-and-place scenario https://www.youtube.com/watch?v=9S0R0mGKA-I Yu Sun et al. (2018). Robotic Grasping and Manipulation Competition: Task Pool. In Yu Sun & JoeFalco, editors: Robotic Grasping and Manipulation, Springer. 10.1007/978-3-319-94568-2_1
  • 44.
    M. dos Santos,S. Hallé, F. Petrillo Preliminary evaluation Sample of 26 generated mutants:
  • 45.
    M. dos Santos,S. Hallé, F. Petrillo Preliminary evaluation 5 rounds of testing (to account for variation in generated noise) Mutation score Round 1 2 3 4 5 % 92 85 92 88 88 + % = Surviving mutants were #5, #10, #14, #20 and #24.
  • 46.
    M. dos Santos,S. Hallé, F. Petrillo Examining surviving mutants Mutant #5 5 Inserts a redundant grip instruction Does not prevent task completion... ...but the extra motion could impact the overall mission timing
  • 47.
    M. dos Santos,S. Hallé, F. Petrillo Examining surviving mutants Mutant #5 5 Inserts a redundant grip instruction Does not prevent task completion... ...but the extra motion could impact the overall mission timing Test suite is missing a non- functional requirement
  • 48.
    M. dos Santos,S. Hallé, F. Petrillo Examining surviving mutants Mutant #10 1 0 Reverses the sign on position sensor on the y-axis The deviation remained within the 0.02 cm threshold ...but only because the expected position was close to 0
  • 49.
    M. dos Santos,S. Hallé, F. Petrillo Test suite vulnerable to a translation of the coordinate system Examining surviving mutants Mutant #10 1 0 Reverses the sign on position sensor on the y-axis The deviation remained within the 0.02 cm threshold ...but only because the expected position was close to 0
  • 50.
    M. dos Santos,S. Hallé, F. Petrillo Examining surviving mutants Mutants #14, #20, #24 2 4 1 4 Add Gaussian noise to position readings Perhaps the position is within the tolrance limit... ...but then these mutants are equivalent to the original program 2 0
  • 51.
    M. dos Santos,S. Hallé, F. Petrillo Test suite partially accounts for imprecision in sensor readings Examining surviving mutants Mutants #14, #20, #24 2 4 1 4 Add Gaussian noise to position readings Perhaps the position is within the tolrance limit... ...but then these mutants are equivalent to the original program 2 0
  • 52.
    M. dos Santos,S. Hallé, F. Petrillo Take-home points Classical mutation operators treat a robot program just like any other program, and result in a low mutation score* Using domain-specific operators increases the likelihood of generating mutants that reveal gaps in the test coverage Simulation is essential to run the mutants due to their large number *Uğur Yayan (2023): ROSMutation: Mutation Based Automated Testing for ROS Compatible Robotic Software. Advances in Electrical and Computer Engineering 23(3), pp. 47–56, doi: 10.4316/AECE.2023.03006.
  • 53.
    M. dos Santos,S. Hallé, F. Petrillo Threats to validity Internal validity Results depend on the fidelity of the Gazebo simulator External validity Findings based on a single task (pick-and-place) Set of mutation operators is not exhaustive Construct validity Uses mutation score as the measure of test effectiveness
  • 54.
    M. dos Santos,S. Hallé, F. Petrillo Future work Develop framework for ROS to automatically generate robot-mutants Apply methodology on other scenarios Extend the set of mutation operators to account for different sensors/actuators
  • 55.
    M. dos Santos,S. Hallé, F. Petrillo Thank you! Future work Develop framework for ROS to automatically generate robot-mutants Apply methodology on other scenarios Extend the set of mutation operators to account for different sensors/actuators