Complete Thesis
Total Page:16
File Type:pdf, Size:1020Kb
University of Groningen Applying patterns in embedded systems design for managing quality attributes and their trade-offs Feitosa, Daniel IMPORTANT NOTE: You are advised to consult the publisher's version (publisher's PDF) if you wish to cite from it. Please check the document version below. Document Version Publisher's PDF, also known as Version of record Publication date: 2019 Link to publication in University of Groningen/UMCG research database Citation for published version (APA): Feitosa, D. (2019). Applying patterns in embedded systems design for managing quality attributes and their trade-offs. University of Groningen. Copyright Other than for strictly personal use, it is not permitted to download or to forward/distribute the text or part of it without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license (like Creative Commons). The publication may also be distributed here under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license. More information can be found on the University of Groningen website: https://www.rug.nl/library/open-access/self-archiving-pure/taverne- amendment. Take-down policy If you believe that this document breaches copyright please contact us providing details, and we will remove access to the work immediately and investigate your claim. Downloaded from the University of Groningen/UMCG research database (Pure): http://www.rug.nl/research/portal. For technical reasons the number of authors shown on this cover page is limited to 10 maximum. Download date: 02-10-2021 Applying Patterns in Embedded Systems Design for managing Quality Attributes and their Trade-offs PhD thesis to obtain the degree of PhD at the University of Groningen on the authority of the Rector Magnificus Prof. E. Sterken and in accordance with the decision by the College of Deans. This thesis will be defended in public on Friday 25 January 2019 at 11.00 hours by Daniel Feitosa born on 6 January 1988 in Salvador, Brazil Supervisors Prof. P. Avgeriou Prof. E. Y. Nakagawa Co-supervisor Dr. A. Ampatzoglou Assessment committee Prof. Y.G. Gueh´ eneuc´ Prof. C. Izurieta Prof. A.C. Telea The research reported in this thesis has been conducted in the Software Engi- neering and Architecture group of the Bernoulli Institute for Mathematics, Compu- ter Science and Artificial Intelligence of the University of Groningen, The Nether- lands. The research work was financially supported by the Brazilian and Dutch agencies Coordenac¸ao˜ de Aperfeic¸oamento de Pessoal de N´ıvel Superior (CAPES) and Netherlands Universities’ Foundation for International Cooperation (NUFFIC), under grant number 034/12, Conselho Nacional de Desenvolviment Cient´ıfico e Tecnologico´ (CNPq), under grant number 204607/2013-2, and Instituto Nacional de Cienciaˆ e Tecnologia em Sistemas Embarcados Cr´ıticos (INCT-SEC), under grant numbers 573963/2008-8 and 2008/57870-9. Cover details: The geometric forms on the front and back side of the cover refer to two different implementations of similar features of a robotic face. This is an ana- logy to the possibility of having different instantiations of one same design pattern, which may express different levels of one or more quality attributes. The curve deli- neated by a dark shade of red is an analogy to measurements quality levels in a time series. Finally, the font used in the cover is named Roboto, by Christian Robertson. Apllying patterns in embedded systems design for managing quality attributes and their trade-offs Daniel Feitosa ISBN: 978-94-034-1375-4 (printed version) ISBN: 978-94-034-1374-7 (electronic version) Abstract Embedded systems comprise one of the most important types of software-intensive systems, as they are pervasive and used in daily life more than any other type, e.g., in cars or in electrical appliances. When these systems operate under hard cons- traints, the violation of which can lead to catastrophic events, the system is classified as a critical embedded system (CES). The quality attributes related to these hard constraints are named critical quality attributes. For example, the performance and security of the software for cruise-control, automatic braking, or self-driving in a car are critical as they can potentially relate to harming human lives. Despite the growing body of knowledge on engineering CESs, there is still a lack of approaches that can support the design of CES, while managing critical qua- lity attributes and their trade-offs with noncritical ones. To address this gap, this dissertation explored the state of research and practice on designing CES and ma- naging quality trade-offs, identified approaches to improve the design of CES with regards to managing quality attributes and their trade-offs, and empirically investi- gated the merit of these approaches. To investigate the state-of-practice, we explored the actual trade-offs between quality attributes (both critical and noncritical) in real systems. The results showed that trade-offs favor certain critical quality attributes against noncritical ones (e.g., security for extendibility) or other critical quality attributes (e.g., correctness for per- formance). In addition, these trade-offs between critical and noncritical quality at- tributes are more recurrent in the domain of CESs. These observations suggest that certain trade-offs are systemic (i.e., recurrent in the system) and may have great impact on the level of quality attributes. Therefore, it is of paramount importance to investigate approaches that can tackle both critical and noncritical qualities and support managing the trade-offs between them. To explore the state-of-research, we conducted a systematic mapping study (SMS) to explore approaches that had been proposed and used for CES design. Results of the SMS showed that multiple approaches have been proposed, focu- sing on a variety of specific challenges posed by different types of CESs. Evidence suggests that CESs have been growing both in terms of size and complexity. In addition, noncritical features, such as GPS and infotainment subsystems, are also being integrated, sometimes sharing resources (e.g., communication medium) with critical features, which leads to a new class of challenges related to these mixed le- vels of criticality. To tackle issues arising from this growth, several solutions (e.g., component-based approaches and software patterns) focus on improving design- time quality attributes, such as reusability and maintainability, while guaranteeing critical quality attributes. These findings provide further evidence on the necessity of addressing both critical and noncritical quality attributes during CES design. After understanding the problem through the state of research and practice, the goal was to identify potential solutions that would support the management of trade-offs between QAs. Among the approaches identified during the SMS, some studies suggest using software patterns during CES design. Although literature shows that software patterns may affect different quality attributes, these effects have not been extensively explored empirically, especially regarding the correlation between critical and noncritical qualities. Due to their potential to support mana- ging quality attributes, we decided to focus the PhD project to the use of software patterns, in particular GoF design patterns. For that, we conducted two empirical studies (case studies) to investigate how GoF design pattern affects three of the most common critical quality attributes, namely security, correctness, and performance. In the first case study, five popular and non-trivial open-source software projects were considered to investigate the correlation between the application of GoF design patterns and the three quality attributes, which are assessed through static analysis. The results suggest that classes not participating in any pattern are correlated with lower quality levels. However, classes participating in patterns with more complex structure and pattern roles that are more change-prone are also more likely to be associated with lower quality levels. In the second study, dynamic analysis was exploited to assess and investigate one aspect of performance, namely energy effici- ency, which has gained notorious attention from both practitioners and researchers in the last years. The results suggest that although a pattern solution tends to con- sume more energy than a non-pattern solution, certain design-time properties of a pattern instance (e.g., number of message calls, or method size) have considerable impact on their effect. In particular, results showed that large methods and/or me- thods with high number of method invocations were correlated with higher energy efficiency. The results of both case studies suggest that design patterns are potential solu- tions for managing quality attributes. However, their impact on quality attributes is not uniform and, therefore, it is highly important to understand parameters that may affect it. One dominant parameter is the pattern instantiation. Similarly to how the design of a system may decay in comparison to its original architecture, design pattern instances can drift from their original implementation as the software evol- ves and additional functionality is added. This phenomenon is known as pattern grime, and understanding its consequences to the results observed in the aforemen- tioned studies is vital for getting a comprehensive picture of the benefits and impair- ments of applying GoF patterns