  Robotic systems are becoming pervasive and adopted in increasingly many
domains, such as manufacturing, healthcare, and space exploration. To this end,
engineering software has emerged as a crucial discipline for building
maintainable and reusable robotic systems. Robotics software engineering
research has received increasing attention, fostering autonomy as a fundamental
goal. However, robotics developers are still challenged trying to achieve this
goal given that simulation is not able to deliver solutions to realistically
emulate real-world phenomena. Robots also need to operate in unpredictable and
uncontrollable environments, which require safe and trustworthy self-adaptation
capabilities implemented in software. Typical techniques to address the
challenges are runtime verification, field-based testing, and mitigation
techniques that enable fail-safe solutions. However, there is no clear guidance
to architect ROS-based systems to enable and facilitate runtime verification
and field-based testing. This paper aims to fill in this gap by providing
guidelines that can help developers and QA teams when developing, verifying or
testing their robots in the field. These guidelines are carefully tailored to
address the challenges and requirements of testing robotics systems in
real-world scenarios. We conducted a literature review on studies addressing
runtime verification and field-based testing for robotic systems, mined
ROS-based application repositories, and validated the applicability, clarity,
and usefulness via two questionnaires with 55 answers. We contribute 20
guidelines formulated for researchers and practitioners in robotic software
engineering. Finally, we map our guidelines to open challenges thus far in
runtime verification and field-based testing for ROS-based systems and, we
outline promising research directions in the field.
