计算机科学 ›› 2024, Vol. 51 ›› Issue (7): 29-39.doi: 10.11896/jsjkx.230600126
邵温欣1,2, 杨志斌1,2, 李维3, 周勇1,2
SHAO Wenxin1,2, YANG Zhibin1,2, LI Wei3, ZHOU Yong1,2
摘要: 随着安全关键软件规模和复杂性不断增加,模型驱动开发方法在安全关键领域得到了广泛应用。SCADE作为一种重要的建模方法和工具,能够表达确定性并发行为且具有精确时间语义等特性,适用于安全关键软件的建模、测试与验证。目前,已有方法主要采用手工方式构造SCADE模型测试用例,存在需求与测试用例不一致、成本代价高且容易出错的问题。文中提出了一种基于自然语言需求的SCADE模型测试用例自动生成方法。首先,给出了基于模型检测的测试用例自动生成方法,通过自然语言需求处理生成原子命题,用于生成前提假设Assume和观察者模型,同时给出了陷阱性质(Trap Properties) 生成规则来生成陷阱性质用于模型检测;其次,给出了基于覆盖分析和变异测试的测试用例质量评估方法,并在SCADE模型上进行变异测试;最后,设计和实现了原型工具,并基于一个工业界案例飞行员弹射座椅控制系统进行了案例分析,验证了所提方法的有效性。
中图分类号:
[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. |
|