Variability Management in Testing Architectures for Embedded Control Systems Goiuria Sagardui, Leire Etxeberria and Joseba A. Agirre Computer and Electronics department Mondragon Goi Eskola Politeknikoa Loramendi 4, Mondragón (Gipuzkoa), Spain Email: {gsagardui, letxeberria, jaagirre}@mondragon.edu Abstract— In recent years, embedded systems have substantially increased their presence both in industry and in our everyday lives. Hence, more and more effort is being dedicated to the development of such systems. Since embedded systems involve computation that is subject to physical constraints, the development and validation of software for such systems becomes a challenge. Moreover, the validation of the embedded system within the environment increases the complexity and cost of testing, so many efforts are being devoted to perform testing activities from early phases of the development. Testing by simulation of the system and its environment is one of the most promising approaches to reduce testing costs. In this paper, we present a proposal based on model-based testing and variability management and integrated in Simulink for ensuring the correctness of a embedded control software. Variability management of configurations helps managing different simulation environments and allows less costly and time-consuming testing. Keywords - testing architecture; variability management; simulation. I. INTRODUCTION Embedded systems are engineering artifacts involving computation that is subject to physical constraints. The physical constraints arise through two kinds of interactions of computational processes with the physical world: (i) reaction to a physical environment, and (ii) execution on a physical platform [1]. Concentrating on software, embedded system software characterizes itself, among others, by heterogeneity, distribution (on potential multiple and heterogeneous hardware resources), ability to react (supervision, user interfaces modes), criticality, real-time and consumption constraints [2]. The need to consider all these factors in concert makes the development of software for embedded systems a complex endeavour. However, not only development poses a significant challenge. Due to its complexity, the validation of embedded software also becomes a cumbersome task. Embedded software needs to cater for the variability on both the physical environment and the physical platform it is executed on apart from testing the software itself. Moreover, when we consider that embedded systems are often part of safety-critical systems (e.g., aviation or railway systems), the validation of the software becomes essential [3], which also raises testing cost. Model Driven Engineering (MDE) is a paradigm that promises a reduction in testing efforts. Models become the central asset of the development so testing can be started from early phases. Model-, software-, processor-, and hardware-in-the-loop (MiL, SiL, PiL, and HiL) tests; called X-in-the-loop tests provide four testing configurations [4]. “The model, software, processor, and hardware terms refer to the different target system configurations in the testing environment, each of which adds value to the verification process” [4]. The MiL tests the model along with the plant model that simulates the physical environment signals. For SiL testing, the model of the MiL is replaced with the corresponding software code. This source code can be autogenerated from the model. PiL tests the source code executed on the target processor machine. For HiL testing, the software is integrated with the real software infrastructure and deployed in the hardware processor or microcontroller. The environment around the system is still a simulated one, but the plan model is replaced by a dedicated hardware setup specially designed for the simulation [4]. Each of the configurations has a different focus from the validation point of view and following them allows detecting errors early when they are easier to correct and to validate incrementally different aspects of the system (functionality, performance, etc.). Functionality and system behavior can be tested at MiL and SiL level. Tests on PiL level can reveal faults that are caused by the target compiler or by the processor architecture [5]. HiL level is to reveal faults in the low-level services and in the I/O services [5]; and to confirm the real-time functionality and performance [4]. Embedded software for control systems usually has to run in different environment conditions, and has to control different number or/and types of sensors and actuators. This increases the complexity of testing even in early phases of the development. Testing the control system in different real scenarios is very costly and time-consuming. Taking into account variability in different aspects of the validation from early testing architectures allows reducing the testing complexity by considering all the possible variants both in software, tests and the environment from simulation. This ensures an increased coverage of the testing in early phases of the development and a correct selection of the most risky scenarios for testing the final system. This paper proposes a systematic approach to X-in-the- Loop validation considering the variability in the testing 73 Copyright (c) IARIA, 2012. ISBN: 978-1-61208-233-2 VALID 2012 : The Fourth International Conference on Advances in System Testing and Validation Lifecycle