TL;DR
This paper presents a novel method for automatically generating functional tests for safety-critical avionics software, significantly reducing manual effort. By leveraging Bounded Model Checking (BMC) on formal low-level requirements, the approach generates tests that meet DO-178C standards and are independent of implementation details, offering a more objective and efficient alternative to traditional testing methods.
What Problem Does This Paper Address?
Developing safety-critical software for avionics, as guided by standards like DO-178C, is a complex and time-consuming process. A significant bottleneck is the generation and verification of low-level tests against low-level requirements (LLRs). This manual process is often empirical, subjective, and labor-intensive, with estimates suggesting it can consume substantial engineering effort (e.g., 50 person-years for a project of 250,000 lines of code). The paper aims to automate this process, reducing costs and improving the reliability and consistency of testing by creating a formal, objective method for generating tests directly from requirements.
Methods
The core of the proposed method involves using Bounded Model Checking (BMC) to automatically generate test cases from formal low-level requirements. The process can be broken down into these key steps:
- Formalizing Requirements: Low-level requirements, typically written in natural language, are translated into formal specifications using pre- and post-conditions. A mini-syntax for Boolean expressions is defined to represent these requirements.
- Coverage Criterion: A novel coverage criterion is introduced, extending Modified Condition/Decision Coverage (MC/DC) with boundary value analysis and control flow considerations. This criterion aims to ensure tests adequately cover the requirements.
- MC/DC: Standard MC/DC is applied to Boolean expressions to generate initial testing conditions.
- Negation-Free Expressions: A
neg-freeoperator is used to convert negated predicates into equivalent non-negated forms, addressing issues with negation-free requirements. - Non-Ordered Predicate Expansion: A
to-orderedoperator expands non-ordered predicates (e.g.,<,>) into equivalent ordered predicates (e.g.,<,=), incorporating boundary value analysis. - ITE Expression Handling: The method specifically addresses
if-then-else(ITE) structures within requirements, ensuring coverage of different execution paths. - Automated Test Generation: A procedure is designed to apply BMC to the formal requirements. For each testing condition derived from the coverage criterion, a "trap property" (the negation of the condition) is instrumented into the program model. If the BMC tool finds a satisfying trace for this trap property, it indicates a violation of the original requirement, and an execution trace leading to this violation is returned as a test vector.
- Toolchain Integration: The developed method is implemented using the CBMC model checker and integrated with the RapiTestFramework, creating an automated toolchain for test generation, compilation, execution, and review.
Datasets
Not discussed in the paper. The paper focuses on a methodology and its application to a case study using code provided by an industrial partner (Rolls-Royce).
Key Insights and Ideas
- Formalizing Requirements is Key: The success of automated testing hinges on translating natural language requirements into formal, machine-readable specifications (pre- and post-conditions).
- MC/DC Plus Boundary Value Analysis: Combining MC/DC with boundary value analysis provides a more robust coverage criterion for formal specifications than either technique alone, ensuring both logical and boundary conditions are tested.
- BMC for Test Generation, Not Just Verification: The paper demonstrates that BMC can be effectively used not only for proving properties but also for generating test cases by finding counterexamples (execution traces) that violate requirements.
- Independence from Implementation: By generating tests directly from requirements, the method ensures that tests are independent of the software's internal structure, a crucial aspect for safety-critical systems and for maintaining test validity even if the implementation changes.
- Significant Effort Reduction: The core promise is a substantial reduction in the manual effort and cost associated with testing safety-critical software, making it more accessible and efficient.
Key Results
The paper reports on a case study involving an avionics system provided by Rolls-Royce. The key findings include:
- Successful Toolchain Integration: The developed toolchain, integrating CBMC and RapiTestFramework, was successfully applied to real-world avionics code.
- Good Coverage Achieved: For the AL case study component, statement code coverage of 100% was achieved. For the OL case study component, RTC achieved 68.75% coverage, with the gap attributed to potential refinements needed in SPARK Ada contracts or intermediate language representations.
- Reduced Manual Effort: The authors anticipate significant cost savings and a reduction in manual testing effort, as the automated process replaces monotonous test scripting.
- Maintainability and Extensibility: The generated tests are in a consistent format, facilitating maintenance. Manual tests can also be added in the same format.
Limitations and Future Work
- Ada to C Conversion: A significant limitation encountered was the need to convert Ada/SPARK code to C for processing by CBMC, which is not a direct front-end for Ada. This conversion requires careful maintenance. Future work includes developing a formal Ada/SPARK front-end for CBMC.
- SPARK Contract Refinements: In some cases, gaps in code coverage required further refinements to the SPARK Ada contracts or investigations into intermediate language representations.
- Future Exploitation: The authors are interested in applying the technique to test case chain generation for reactive systems and exploring testing for model-based development processes (e.g., Simulink systems).
- Mixed-Language Projects: The toolchain is expected to undergo further development to support mixed-language test projects.
Summary updated