GNU 编译器集合中的修正条件/判定覆盖
Modified Condition/Decision Coverage in the GNU Compiler Collection
AI总结:
本文介绍 GCC 14 中基于二元决策图分析布尔表达式结构、映射到控制流图边并以按位指令插桩的掩码式 MC/DC 覆盖支持,实现了跨 C、C++、D 和 Rust 的语言无关测量。
摘要:
我们描述了 GCC 14 中掩码式修正条件/判定覆盖(MC/DC)支持的实现,这是一种强大的结构覆盖度量,在安全关键应用中具有广泛的行业采用。通过使用二元决策图(Binary Decision Diagrams)分析布尔表达式的结构,我们可以观察到 MC/DC 的关键性质,即独立影响结果的能力,并将其映射到控制流图(Control Flow Graph)的边上。这种映射可以转换为少量按位指令,使 GCC 能够对程序进行插桩,以高效地观察和记录条件何时被采用并对判定的结果产生独立影响。通过分析 BDD 而不是程序语法,GCC 可以用单一的语言无关实现来测量几乎所有其支持语言的 MC/DC,包括对 C、C++、D 和 Rust 的支持。
英文摘要:
We describe the implementation of the masking Modified Condition/Decision Coverage (MC/DC) support in GCC 14, a powerful structural coverage metric with wide industry adoption for safety critical applications. By analyzing the structure of Boolean expressions with Binary Decision Diagrams we can observe the key property of MC/DC, the power to independently affect the outcome, and map to the edges of the Control Flow Graph. This mapping can be translated to a few bitwise instructions and enables GCC to instrument programs to efficiently observe and record when conditions have been taken and have an independent effect on the outcome of a decision. By analyzing the BDD rather than the program syntax, GCC can measure MC/DC for almost all of its languages with a single language-agnostic implementation, including support for C, C++, D, and Rust.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。