面向适航软件工具的OCaml单元测试系统设计
Design of OCaml Unit Testing System for Airworthiness Software Tools
摘要 针对适航软件工具开发中OCaml语言缺少合规测试系统的问题,设计了一套集测试用例管理、自动化执行、报告生成与结构覆盖率收集于一体的单元测试系统.系统采用功能、用例与控制三层架构,创新利用OCaml结构相等性的递归复用,实现任意嵌套深度代数数据类型的自动深度比较,并结合浮点动态精度阈值、哈希表双向等价性与可追溯性建模,建立了"需求-测试-结果"的完整证据链及分层异常验证机制.在某适航软件工具应用表明:系统对10类典型错误的检出率达100%,并支持TQL-1级的MC/DC结构覆盖率收集,为OCaml语言适航测试提供了初步闭环解决方案.
Abstract:
To address the lack of a DO-330-compliant testing system for OCaml in the development of air-worthiness software tools,a unit testing system is designed integrating test case management,automatic execution,report generation and structural coverage collection.Based on a three-layer architecture of function,test case and control,the system innovatively reuses the recursion of OCaml structural equality to realize automatic deep comparison of algebraic data types with arbitrary nesting depths,and establishes a complete requirement-test-result evidence chain by combining dynamic precision thresholds for floating-point numbers,bidirectional equivalence verification of hash tables and traceability modeling,with a lay-ered exception verification mechanism designed.Application to a core module of an airworthiness software tool shows that the system achieves a 100%detection rate for ten typical error types,improves overall execution efficiency by about 30%over mainstream tools,and supports MC/DC structural coverage collec-tion at the TQL-1 level,providing an initial closed-loop solution for OCaml airworthiness testing.
刊 名 航空计算技术 ISTIC
年,卷(期): 2026, 56(5)
分类号: TP311.56
机标分类号: TP3 G434 V474.21
在线出版日期: 2026年11月24日