一句话:提出 k-path 算法,基于文法系统覆盖输入的语法元素及其组合,显著提升代码覆盖率。
基于文法的测试利用给定文法生成语法合法的输入,但仅保证语法正确并不足以覆盖程序所关心的输入特征,例如 URL 解析器需要覆盖所有 URL 变体。本文提出针对文法产生式的 k-path 算法,能够系统化地覆盖语法元素及其组合,从而生成在结构上更具多样性的测试输入。评估结果表明,与当前最优方法相比,该算法能显著提高代码覆盖率。
Grammar-based testing uses a given grammar to produce syntactically valid inputs. To cover program features, it is necessary to also cover input features-say, all URL variants for a URL parser. Our k-path algorithm for grammar production systematically covers syntactic elements as well as their combinations. In our evaluation, we show that this results in a significantly higher code coverage than state of the art.