Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3540250.3549159acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Detecting Simulink compiler bugs via controllable zombie blocks mutation

Published: 09 November 2022 Publication History

Abstract

As a popular Cyber-Physical System (CPS) development tool chain, MathWorks Simulink is widely used to prototype CPS models in safety-critical applications, e.g., aerospace and healthcare. It is crucial to ensure the correctness and reliability of Simulink compiler (i.e., the compiler module of Simulink) in practice since all CPS models depend on compilation. However, Simulink compiler testing is challenging due to millions of lines of source code and the lack of the complete formal language specification. Although several methods have been proposed to automatically test Simulink compiler, there still remains two challenges to be tackled, namely the limited variant space and the insufficient mutation diversity. To address these challenges, we propose COMBAT, a new differential testing method for Simulink compiler testing. COMBAT includes an EMI (Equivalence Modulo Input) mutation component and a diverse variant generation component. The EMI mutation component inserts assertion statements (e.g., If /While blocks) at arbitrary points of the seed CPS model. These statements break each insertion point into true and false branches. Then, COMBAT feeds all the data passed through the insertion point into the true branch to preserve the equivalence of CPS variants. In such a way, the body of the false branch could be viewed as a new variant space, thus addressing the first challenge. The diverse variant generation component uses Markov chain Monte Carlo optimization to sample the seed CPS model and generate complex mutations of long sequences of blocks in the variant space, thus addressing the second challenge. Experiments demonstrate that COMBAT significantly outperforms the state-of-the-art approaches in Simulink compiler testing. Within five months, COMBAT has reported 16 valid bugs for Simulink R2021b, of which 11 bugs have been confirmed as new bugs by MathWorks Support.

References

[1]
MathWorks. https://ww2.mathworks.cn/help/slcoverage/ug/types-of-model-coverage.html
[2]
MathWorks. https://ww2.mathworks.cn/en/products/simulink.html
[3]
MathWorks. https://www.mathworks.com/support/bugreports/
[4]
MathWorks. https://ww2.mathworks.cn/en/
[5]
Homa Alemzadeh, Ravishankar K. Iyer, Zbigniew Kalbarczyk, and Jai Raman. 2013. Analysis of Safety-Critical Computer Failures in Medical Devices. IEEE Security Privacy 11, 4 (2013), 14–26. https://doi.org/10.1109/MSP.2013.49
[6]
Olivier Bouissou and Alexandre Chapoutot. 2012. An Operational Semantics for Simulink’s Simulation Engine. ACM SIGPLAN/SIGBED International Conference on Languages, Compilers, Tools and Theory for Embedded Systems (LCTES 2012), 129–138. https://doi.org/10.1145/2248418.2248437
[7]
Angelo Brillout, Nannan He, Michele Mazzucchi, Daniel Kroening, Mitra Purandare, Philipp Rümmer, and Georg Weissenbacher. 2009. Mutation-Based Test Case Generation for Simulink Models. International Symposium on Formal Methods for Components and Objects (FMCO 2009), 208–227. https://doi.org/10.1007/978-3-642-17071-3_11
[8]
Junjie Chen, Yanwei Bai, Dan Hao, Yingfei Xiong, Hongyu Zhang, and Bing Xie. 2017. Learning to prioritize test programs for compiler testing. IEEE/ACM International Conference on Software Engineering (ICSE 2017), 700–711. https://doi.org/10.1109/ICSE.2017.70
[9]
Junjie Chen, Wenxiang Hu, Dan Hao, Yingfei Xiong, Hongyu Zhang, Lu Zhang, and Bing Xie. 2016. An Empirical Comparison of Compiler Testing Techniques. In Proc. International Conference on Software Engineering (ICSE 2016). ACM, 1 (2016), 180–190. https://doi.org/10.1145/2884781.2884878
[10]
Junjie Chen, Jibesh Patra, Michael Pradel, Yingfei Xiong, Hongyu Zhang, Dan Hao, and Lu Zhang. 2020. A Survey of Compiler Testing. ACM Comput, 53, 1 (2020), 1–36. https://doi.org/10.1145/3363562
[11]
Junjie Chen, Guancheng Wang, Dan Hao, Yingfei Xiong, Hongyu Zhang, and Lu Zhang. 2019. History-Guided Configuration Diversification for Compiler Test-Program Generation. International Conference on Automated Software Engineering (ASE 2019), 305–316. https://doi.org/10.1109/ASE.2019.00037
[12]
Junjie Chen, Guancheng Wang, Dan Hao, Yingfei Xiong, Hongyu Zhang, Lu Zhang, and Bing Xie. 2021. Coverage Prediction for Accelerating Compiler Testing. IEEE Transactions on Software Engineering, 47, 2 (2021), 261–278. https://doi.org/10.1109/TSE.2018.2889771
[13]
Shafiul Azam Chowdhury, Soumik Mohian, Sidharth Mehra, Siddhant Gawsane, Taylor T. Johnson, and Christoph Csallner. 2018. Automatically finding bugs in a commercial cyber-physical system development tool chain with SLforge. International Conference on Software Engineering (ICSE 2018), 981–992. https://doi.org/10.1145/3180155.3180231
[14]
Shafiul Azam Chowdhury, Sohil Lal Shrestha, Taylor T. Johnson, and Christoph Csallner. 2020. SLEMI:Equivalence Modulo Input (EMI) Based Mutation of CPS Models for Finding Compiler Bugs in Simulink. International Conference on Software Engineering (ICSE 2020), 335–346. https://ieeexplore.ieee.org/abstract/document/9283988
[15]
Shafiul Azam Chowdhury, Lina Sera Varghese, Soumik Mohian, Taylor T. Johnson, and Christoph Csallner. 2018. A Curated Corpus of Simulink Models for Model-Based Empirical Studies. International Workshop on Software Engineering for Smart Cyber-Physical Systems (SEsCPS 2018), 45–48. https://ieeexplore.ieee.org/abstract/document/8445079
[16]
COMBAT. 2022. Replication package of COMBAT. https://github.com/EDA-Testing/COMBAT
[17]
U.S. Consumer Product Safety Commission (CPSC). 2010. Recall 11-702: Fire Alarm Control Panels Recalled by Fire-Lite Alarms Due to Alert Failure. http://www.cpsc.gov/en/Recalls/2011/Fire-Alarm-Control-Panels-Recalledby-Fire-Lite-Alarms-Due-to-Alert-Failure
[18]
Kyle Dewey, Jared Roesch, and Ben Hardekopf. 2015. Fuzzing the Rust Typechecker Using CLP (T). IEEE/ACM International Conference on Automated Software Engineering (ASE 2015), 482–493. https://ieeexplore.ieee.org/document/7372036
[19]
Péter Fehér, Tamás Mészáros, László Lengyel, and Pieter J. Mosterman. 2013. Data Type Propagation in Simulink Models with Graph Transformation. Eastern European Regional Conference on the Engineering of Computer Based Systems (ECBS-EERC 2013), 127–137. https://ieeexplore.ieee.org/document/6664519
[20]
Christoph Guger, Alois Schlogl, Christa Neuper, Dirk Walterspacher, Thomas Strein, and Gert Pfurtscheller. 2001. Rapid prototyping of an EEG-based braincomputer interface (BCI). IEEE Transactions on Neural Systems and Rehabilitation Engineering, 9, 1 (2001), 49–58. https://doi.org/10.1109/7333.918276
[21]
Grégoire Hamon and John Rushby. 2007. An operational semantics for Stateflow. International Journal on Software Tools for Technology Transfer, 9, 5 (2007), 447–456. https://doi.org/10.1007/s10009-007-0049-7
[22]
MathWorks Inc. 2018. Products and Services. http://www.mathworks.com/products/
[23]
MathWorks Inc. 2022. Simulink Documentation — MATLAB Simulink. http: //www.mathworks.com/help/simulink/
[24]
He Jiang, Zhide Zhou, Zhilei Ren, Jingxuan Zhang, and Xiaochen Li. 2021. CTOS: Compiler Testing for Optimization Sequences of LLVM. IEEE Transactions on Software Engineering, 1–1. https://doi.org/10.1109/TSE.2021.3058671
[25]
Vu Le, Mehrdad Afshari, and Zhendong Su. 2014. Compiler Validation via Equivalence Modulo Inputs. ACM Sigplan Notices, 49, 6 (2014), 216–226. https://doi.org/10.1145/2666356.2594334
[26]
Vu Le, Chengnian Sun, and Zhendong Su. 2015. Finding Deep Compiler Bugs via Guided Stochastic Program Mutation. ACM SIGPLAN Notices, 50, 10 (2015), 386–399. https://doi.org/10.1145/2858965.2814319
[27]
Edward A. Lee. 2008. Cyber Physical Systems: Design Challenges. International Symposium on Object Oriented Real-Time Distributed Computing (ISORC 2008), 363–369. https://doi.org/10.1109/ISORC.2008.25
[28]
Edward A. Lee. 2010. Cyber Physical Systems: Design Challenges. CPS foundations. In Proc. Design Automation Conference (DAC 2010), 737–742. https://doi.org/10.1145/1837274.1837462
[29]
Christopher Lidbury, Andrei Lascu, Nathan Chong, and Alastari F. Donaldson. 2015. Many-core compiler fuzzing. ACM SIGPLAN Notices, 50, 6 (2015), 65–76. https://doi.org/10.1145/2813885.2737986
[30]
Bing Liu, Lucia, Shiva Nejati, and Lionel C. Briand. 2017. Improving fault localization for Simulink models using search-based testing and prediction models. IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER 2017), 359–370. https://doi.org/10.1109/SANER.2017.7884636
[31]
William M. McKeeman. 1998. Differential testing for software. Digital Technical Journa, 10, 1 (1998), 100–107.
[32]
Pieter J. Mosterman, Justyna Zander, Grégoire Hamon, and Ben Denckla. 2009. Towards computational hybrid system semantics for time-based block diagrams. IFAC Conference on Analysis and Design of Hybrid Systems (ADHS 2009), 376–385. https://doi.org/10.3182/20090916-3-ES-3003.00065
[33]
U.S. National Highway Traffic Safety Administration (NHTSA). 2014. Defect Information Report 14V-053. http://www-odi.nhtsa.dot.gov/acms/cs/jaxrs/download/doc/UCM450071/RCDNN-14V053-0945.pdf
[34]
Marta Olszewska, Yanja Dajsuren, Harald Altinger, Alexander Serebrenik, Marina A.Waldén, and Mark G. J. van den Brand. 2016. Tailoring complexity metrics for Simulink models. In Proc. 10th European Conference on Software Architecture Workshops., 5–5. https://dl.acm.org/doi/10.1145/2993412.3004853
[35]
Vera Pantelic, Steven Postma, Mark Lawford, Monika Jaskolka, Bennett Mackenzie, Alexandre Korobkine, Marc Bender, Jeff Ong, Gordon Marks, and Alan Wassyng. 2017. Software engineering practices and Simulink: Bridging the gap. International Journal on Software Tools for Technology Transfer, 20, 1 (2017), 95–117. https://doi.org/10.1007/s10009-017-0450-9
[36]
Akshay Rajhans, Srinath Avadhanula, Alongkrit Chutinan, Pieter J. Mosterman, and Fu Zhang. 2018. Graphical modeling of hybrid dynamics with Simulink and Stateflow. International Conference on Hybrid Systems: Computation and Control (HSCC 2018), 247–252. https://doi.org/10.1145/3178126.3178152
[37]
Steven Rasmussen, Jason Mitchell, Chris Schulz, Corey Schumacher, and Phillip Chandler. 2012. A multiple UAV simulation for researchers. In AIAA Modeling and Simulation Technologies Conference and Exhibit., 11–14. https://doi.org/10.2514/6.2003-5684
[38]
Prahladavaradan Sampath, A. C. Rajeev, S. Ramesh, and K. C. Shashidhar. 2007. Testing Model-Processing Tools for Embedded Systems. IEEE Real- Time and Embedded Technology and Applications Symposium, 209–214. https://doi.org/10.1109/RTAS.2007.39
[39]
Qingchao Shen, Haoyang Ma, Junjie Chen, Yongqiang Tian, Shing-Chi Cheung, and Xiang Chen. 2021. A comprehensive study of deep learning compiler bugs. ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE 2021), 968–980. https://doi.org/10.1145/3468264.3468591
[40]
Sohil Lal Shrestha, Shafiul Azam Chowdhury, and Christoph Csallner. 2020. DeepFuzzSL: Generating models with deep learning to find bugs in the Simulink toolchain. Workshop on Testing for Deep Learning and Deep Learning for Testing (DeepTest 2020), https://par.nsf.gov/servlets/purl/10187922
[41]
Sohil Lal Shrestha and Christoph Csallner. 2021. SLGPT: Using Transfer Learning to Directly Generate Simulink Model Files and Find Bugs in the Simulink Toolchain. Evaluation and Assessment in Software Engineering(EASE 2021), 260–265. https://doi.org/10.1145/3463274.3463806
[42]
Ingo Stürmer and Mirko Conrad. 2003. Test suite design for code generation tools. 18th IEEE International Conference on Automated Software Engineering (ASE 2003), 286–290. https://doi.org/10.1109/ASE.2003.1240322
[43]
Ingo Stürmer, Mirko Conrad, Heiko Dörr, and Peter Pepper. 2007. Systematic Testing of Model-Based Code Generators. IEEE Transactions on Software Engineering, 622–634. https://doi.org/10.1109/TSE.2007.70708
[44]
Chengnian Sun, Vu Le, and Zhengdong Su. 2016. Finding Compiler Bugs via Live Code Mutation. ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2016), 849–863. https://doi.org/10.1145/2983990.2984038
[45]
Yixuan Tang, He Jiang, Zhide Zhou, Xiaochen Li, Zhilei Ren, and Weiqiang Kong. 2021. Detecting Compiler Warning Defects Via Diversity-Guided Program Mutation. IEEE Transactions on Software Engineering, 1–1. https://doi.org/10.1109/TSE.2021.3119186
[46]
Yixuan Tang, Zhilei Ren, Weiqiang Kong, and He Jiang. 2020. Compiler testing: a systematic literature analysis. Frontiers Comput. Sci, 14, 1 (2020), 14–26. hhttps://doi.org//10.1007/s11704-019-8231-0
[47]
Sandro Tolksdorf, Daniel Lehmann, and Michael Pradel. 2019. Interactive metamorphic testing of debuggers. In Proceedings of the 28th ACM SIGSOFT International Symposium on Software Testing and Analysis. 273–283.
[48]
Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. 2011. Finding and understanding bugs in C compilers. In Proc. 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI)., 283–294. https://doi.org/10.1145/1993498.1993532
[49]
Yibiao Yang, Yuming Zhou, Hao Sun, Zhendong Su, Zhiqiang Zuo, Lei Xu, and Baowen Xu. 2019. Hunting for Bugs in Code Coverage Tools via Randomized Differential Testing. International Conference on Software Engineering (ICSE 2019), 488–499. https://doi.org/10.1109/ICSE.2019.00061
[50]
Justyna Zander, Ina Schieferdecker, and Pieter J. Mosterman. 2011. Model-based testing for embedded systems (first ed.). CRC Press.
[51]
Zhide Zhou Zhilei Ren, Guojun Gao and He Jiang. 2021. An empirical study of optimization bugs in GCC and LLVM. J. Syst. Softw, 174, 110884 (2021), https://doi.org/10.1016/j.jss.2020.110884

Cited By

View all
  • (2024)SIMTAM: Generation Diversity Test Programs for FPGA Simulation Tools Testing Via Timing Area MutationACM Transactions on Design Automation of Electronic Systems10.1145/370573030:2(1-25)Online publication date: 23-Nov-2024
  • (2024)Rust-twins: Automatic Rust Compiler Testing through Program Mutation and Dual Macros GenerationProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695059(631-642)Online publication date: 27-Oct-2024
  • (2023)Analyzing a Semantics-Aware Bug Seeding Tool's Efficacy: A qualitative study with the SemSeed toolProceedings of the XXXVII Brazilian Symposium on Software Engineering10.1145/3613372.3613412(246-256)Online publication date: 25-Sep-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ESEC/FSE 2022: Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering
November 2022
1822 pages
ISBN:9781450394130
DOI:10.1145/3540250
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 09 November 2022

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Cyber-physical system
  2. Simulink
  3. compiler bug
  4. differential testing

Qualifiers

  • Research-article

Funding Sources

Conference

ESEC/FSE '22
Sponsor:

Acceptance Rates

Overall Acceptance Rate 112 of 543 submissions, 21%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)69
  • Downloads (Last 6 weeks)6
Reflects downloads up to 08 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)SIMTAM: Generation Diversity Test Programs for FPGA Simulation Tools Testing Via Timing Area MutationACM Transactions on Design Automation of Electronic Systems10.1145/370573030:2(1-25)Online publication date: 23-Nov-2024
  • (2024)Rust-twins: Automatic Rust Compiler Testing through Program Mutation and Dual Macros GenerationProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695059(631-642)Online publication date: 27-Oct-2024
  • (2023)Analyzing a Semantics-Aware Bug Seeding Tool's Efficacy: A qualitative study with the SemSeed toolProceedings of the XXXVII Brazilian Symposium on Software Engineering10.1145/3613372.3613412(246-256)Online publication date: 25-Sep-2023
  • (2023)EvoSL: A Large Open-Source Corpus of Changes in Simulink Models & Projects2023 ACM/IEEE 26th International Conference on Model Driven Engineering Languages and Systems (MODELS)10.1109/MODELS58315.2023.00024(273-284)Online publication date: 1-Oct-2023
  • (2023)PhyFu: Fuzzing Modern Physics Simulation EnginesProceedings of the 38th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE56229.2023.00054(1579-1591)Online publication date: 11-Nov-2023

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media