arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.04144cs.SE
收藏

为形式化测试覆盖准则标注控制流图

Annotating Control-Flow Graphs for Formalized Test Coverage Criteria

Sean Kauffman, Carlos Moreno, Sebastian Fischmeister

AI总结:

本文提出控制流判定图(CFDG),通过从控制流图(CFG)中推断判定信息并进行标注,从而形式化定义MC/DC等常见测试覆盖准则,并开发工具实现对编译器输出CFG的自动标注。

摘要:

控制流覆盖准则是安全关键系统嵌入式软件鉴定过程中的重要组成部分。诸如DO-178B定义的修正条件/判定覆盖(MC/DC)等准则,被监管机构用于评判测试的充分性,也被质量保证工程师在无法实现全路径覆盖时用于设计测试。尽管这些覆盖准则十分重要,但它们常常被误解。一个问题在于其定义通常以自然语言规范文档书写,导致不够精确。其他工作提出了使用二元谓词逻辑的形式化定义,但这些定义难以应用于实际程序的分析。控制流图(CFG)是编译器中分析程序逻辑最常用的模型,似乎是定义和分析覆盖准则的良好选择。然而,CFG丢弃了判定的显式概念,使得将其用于该任务看似不可能。在本文中,我们展示了如何利用从图本身推断出的判定信息来标注CFG。我们将这种标注后的模型称为控制流判定图(CFDG),并使用它来形式化定义几种常见的覆盖准则。我们已在一个工具中实现了相关算法,并展示了该工具可应用于自动标注主流编译器输出的CFG。

英文摘要:

Control flow coverage criteria are an important part of the process of qualifying embedded software for safety-critical systems. Criteria such as modified condition/decision coverage (MC/DC) as defined by DO-178B are used by regulators to judge the adequacy of testing and by QA engineers to design tests when full path coverage is impossible. Despite their importance, these coverage criteria are often misunderstood. One problem is that their definitions are typically written in natural language specification documents, making them imprecise. Other works have proposed formal definitions using binary predicate logic, but these definitions are difficult to apply to the analysis of real programs. Control-Flow Graphs (CFGs) are the most common model for analyzing program logic in compilers, and seem to be a good fit for defining and analyzing coverage criteria. However, CFGs discard the explicit concept of a decision, making their use for this task seem impossible. In this paper, we show how to annotate a CFG with decision information inferred from the graph itself. We call this annotated model a Control-Flow Decision Graph (CFDG) and we use it to formally define several common coverage criteria. We have implemented our algorithms in a tool which we show can be applied to automatically annotate CFGs output from popular compilers.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑