计算机科学 ›› 2024, Vol. 51 ›› Issue (7): 29-39.doi: 10.11896/jsjkx.230600126

• 计算机软件 • 上一篇    下一篇

基于自然语言需求的SCADE模型测试用例自动生成方法

邵温欣1,2, 杨志斌1,2, 李维3, 周勇1,2   

  1. 1 南京航空航天大学计算机科学与技术学院 南京 211106
    2 高安全系统的软件开发与验证技术工信部重点实验室 南京 211106
    3 航空防护救生技术航空科技重点实验室 湖北 襄阳 441003
  • 收稿日期:2023-06-15 修回日期:2023-10-18 出版日期:2024-07-15 发布日期:2024-07-10
  • 通讯作者: 杨志斌(yangzhibin168@163.com)
  • 作者简介:(wxshao821@163.com)
  • 基金资助:
    国家自然科学基金(62072233);国防基础科研项目(JCKY2020205C006);航空科学基金(201919052002);南京航空航天大学科研与实践创新计划(xcxjh20221607)

Natural Language Requirements Based Approach for Automatic Test Cases Generation of SCADE Models

SHAO Wenxin1,2, YANG Zhibin1,2, LI Wei3, ZHOU Yong1,2   

  1. 1 School of Computer Science and Technology,Nanjing University of Aeronautics and Astronautics,Nanjing 211106,China
    2 Key Laboratory of Safety-critical Software,Ministry of Industry and Information Technology,Nanjing 211106,China
    3 Aviation Key Laboratory of Science and Technology on Life-support Technology,Xiangyang,Hubei 441003,China
  • Received:2023-06-15 Revised:2023-10-18 Online:2024-07-15 Published:2024-07-10
  • About author:SHAO Wenxin,born in 1998,postgra-duate.Her main research interests include safety critical-system and formal verification.
    YANG Zhibin,born in 1982,Ph.D,professor,is a member of CCF(No.08632M).His main research interests include safety-critical system,formal verification and AI software enginee-ring.
  • Supported by:
    National Natural Science Foundation of China(62072233),National Defense Basic Scientific Research Project(JCKY2020205C006),Aeronautical Science Foundation of China(201919052002) and Postgraduate Research & Practice Innovation Program of NUAA(xcxjh20221607).

摘要: 随着安全关键软件规模和复杂性不断增加,模型驱动开发方法在安全关键领域得到了广泛应用。SCADE作为一种重要的建模方法和工具,能够表达确定性并发行为且具有精确时间语义等特性,适用于安全关键软件的建模、测试与验证。目前,已有方法主要采用手工方式构造SCADE模型测试用例,存在需求与测试用例不一致、成本代价高且容易出错的问题。文中提出了一种基于自然语言需求的SCADE模型测试用例自动生成方法。首先,给出了基于模型检测的测试用例自动生成方法,通过自然语言需求处理生成原子命题,用于生成前提假设Assume和观察者模型,同时给出了陷阱性质(Trap Properties) 生成规则来生成陷阱性质用于模型检测;其次,给出了基于覆盖分析和变异测试的测试用例质量评估方法,并在SCADE模型上进行变异测试;最后,设计和实现了原型工具,并基于一个工业界案例飞行员弹射座椅控制系统进行了案例分析,验证了所提方法的有效性。

关键词: 安全关键软件, 模型驱动开发, SCADE, 测试用例自动生成, 模型检测

Abstract: With the increasing scale and complexity of safety-critical software,model-driven development(MDD) is widely used in safety-critical fields.As an important modeling method and tool,SCADE can express deterministic concurrent behavior and has precise time semantics,which is suitable for modeling,testing and verification of safety-critical software.At present,the existing methods mainly use manual methods to construct SCADE model test cases,and there are some problems such as inconsistency between requirements and test cases,high cost and easy to make mistakes.This paper presents an automatic generation method of SCADE model test cases based on natural language requirements.Firstly,an automatic test case generation method based on mo-del checking is presented,which generates atomic propositions by natural language requirements processing to generate the assume and observer models,and provides the rules of trap properties generation to generate trap properties for model checking.Secondly,a test case quality evaluation method based on coverage analysis and mutation testing is presented,and the mutation testing is carried out on SCADE model.Finally,the prototype tool is designed and implemented,and an industrial case of pilot ejection seat control system is analyzed to verify the effectiveness of the proposed method.

Key words: Safety-critical software, Model-driven development, SCADE, Automatic test case generation, Model checking

中图分类号: 

  • TP311
[1]YANG Z B,YUAN S H,XIE J,et al.A synchronous language multi-threaded code automatic generation tool[J].Journal of Software,2019,30(7):23.
[2]SINGH P,SINGH L K.Reliability and Safety Engineering for Safety Critical Systems:An Interview Study With Industry Practitioners[J].IEEE Transactions on Reliability,2021,70(2):643-653.
[3]RIERSON L.Developing safety-critical software:a practicalguide for aviation software and DO-178C compliance[M].CRC Press,2017.
[4]DO-331,Model-based development and verification supplement to DO-178C and DO-278A[S].RTCA:Washington,DC,USA,2011.
[5]DO-333,Formal methods supplement to DO-178C and DO-278A[S].RTCA:Washington,DC,USA,2011.
[6]WAKANKAR A,BHATTACHARJEE A K,DHODAPKAR S D,et al.Automatic test case generation in model based software design to achieve higher reliability[C]//2010 2nd International Conference on Reliability,Safety and Hazard - Risk-Based Technologies and Physics-of-Failure Methods(ICRESH).2010:493-499.
[7]SCADE[OL].https://www.ansys.com/products/em-beddedsoft-ware/ansys-scade-suite.
[8]JING H,SHEN Y Y.ANSYS SCADE Suite Modeling Foundation [M].Beijing:China Water Resources and Hydropower Press,2018.
[9]ELKHOLY W,EL-MENSHAWY M,BENTAHAR J,et al.Model checking intelligent avionics systems for test cases gene-ration using multi-agent systems[J].Expert Systems with Applications,2020,156:113458.
[10]KADRY S.A New Proposed Technique to Improve Software Regression Testing Cost[J].International Journal of Security & Its Applications,2011,5(3):21-39.
[11]BRILLOUT A,HE N,MAZZUCCHI M,et al.Mutation-Based Test Case Generation for Simulink Models[C]//Formal Me-thods for Components and Objects.Berlin,Heidelberg:Sprin-ger,2010:208-227.
[12]WANG W X,HU J,HU J C,et al.Test Case Generation MethodOriented to Tabular Form Formal Requirement Model[J].Computer Science,2021,48(5):16-24.
[13]DAI X,GONG W,GU Q.Automated test case generation based on differential evolution with node branch archive[J].Compu-ters & Industrial Engineering,2021,156:107290.
[14]TIAN Y,YIN B,LI C.A Model-based Test Cases Generation Method for Spacecraft Software[C]//2021 8th International Conference on Dependable Systems and Their Applications(DSA).2021:373-382.
[15]RAYADURGAM S,HEIMDAHL M P E.Coverage based test-case generation using model checkers[C]//Proceedings of the Eighth Annual IEEE International Conference and Workshop on the Engineering of Computer-Based Systems(ECBS 2001).2001:83-91.
[16]CHANDLER R E.Model Checking[M].MIT Press,2005.
[17]ANICULAESEI A,VORWALD A,RAUSCH A.Using theSCADE Toolchain to Generate Requirements-Based Test Cases for an Adaptive Cruise Control System[C]//2019 ACM/IEEE 22nd International Conference on Model Driven Engineering Languages and Systems Companion(MODELS-C).2019:503-513.
[18]CHILENDKI J J,MILLER S P.Applicability of modified condition/decision coverage to software testing[J].Software Engineering Journal,1994,9(5):193-200.
[19]DEMILLO R A,LIPTON R J,SAYWARD F G.Hints on Test Data Selection:Help for the Practicing Programmer[J].Computer,1978,11(4):34-41.
[20]YANG H,HONG M,QU Y Y.Approach of Mutation Test CaseGeneration Based on Model Checking[J].Computer Science,2018,45(11A):488-493.
[21]GAALOUL K,MENGHI C,NEJATI S,et al.Combining Gene-tic Programming and Model Checking to Generate Environment Assumptions[J].arXiv:2101.01933,2021.
[22]ZHANG Z L,YANG Z B,LI X J,et al.Machine Learning Based Environment Assumption Automatic Generation for Compositional Verification of SCADE Models[J].Computer Science,2023,50(6):297-306.
[23]YANG Z B,YANG Y Q,YUAN S H,et al.Terminology Recommendation and Requirement Classification Method for Safety-critical Software[J].Computer Science,2021,48(5):32-44.
[24]HE H,CHOI J D.The Stem Cell Hypothesis:Dilemma behind Multi-Task Learning with Transformer Encoders[J/OL].https://arxiv.org/abs/2109.06939.
[25]WHALEN M W,RAJAN A,HEIMDAHL M P E,et al.Cove-rage metrics for requirements-based testing[C]//Proceedings of the 2006 International Symposium on Software Testing and Dnalysis.New York,NY,USA:Association for Computing Machinery,2006:25-36.
[26]MA C,PROVOST J.Design-to-Test Approach for Programmable Controllers in Safety-Critical Automation Systems[J].IEEE Transactions on Industrial Informatics,2020,16(10):6499-6508.
[27]MOHD-SHAFIE M L,KADIR W M N W,LICHTER H,et al.Model-based test case generation and prioritization:a systematic literature review[J].Software and Systems Modeling,2022,21(2):717-753.
[28]LI Y P,LI H,ZHAO J L.Research about FSM Test Sequence Generation Algorithm[J].Computer Science,2016,43(Z11):474-481.
[29]HUANG S Q,LIU Y B,HUANG X S.Research on Automatic Testing Technology of Model Driven Development Tools[J].Computer Science,2021,48(6A):568-571.
[30]MINJ B.Generation of Test Cases based on Analysis of Simulink Stateflow Models[C]//IJCA Proceedings on National Conference on Knowledge,Innovation in Technology andEnginee-ring(NCKITE 2015).Foundation of Computer Science(FCS),2015.
[31]MOITRA A,SIU K,CRAPO A W,et al.Automating requirements analysis and test case generation[J].Requirements Engineering,2019,24(3):341-364.
[32]YANG B,WU J,XU L,et al.A Method for Modeling Software Testing Requirements and Generating Test Cases [J].Chinese Journal of Computers,2014,37(3):17.
[33]DURRIEU G,LAURENT O,SEGUIN C,et al.Formal Proof and Test Case Generation for Critical Embedded Systems Using Scade[C]//Building the Information Society.Boston,MA:Springer US,2004:499-504.
[34]ANICULAESEI A,HOWAR F,DENECKE P,et al.Automated generation of requirements-based test cases for an adaptive cruise control system[C]//2018 IEEE Workshop on Validation,Analysis and Evolution of Software Tests(VST).2018:11-15.
[35]WHALEN M W,RAJAN A,HEIMDAHL M P E,et al.Cove-age metrics for requirements-based testing[C]//Proceedings of the 2006 International Symposium on Software Testing and Analysis.New York,NY,USA:Association for Computing Machinery,2006:25-36.
[36]ANICULAESEI A,VORWALD A,RAUSCH A.Automated Generation of Requirements-Based Test Cases for an Automotive Function using the SCADE Toolchain[C]//The 11th International Conference on Adaptive and Self-Ada Ptive Systems and Application.2019.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!