arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2006.11639cs.PLcs.SE
收藏

高阶函数的动态符号执行

Dynamic Symbolic Execution of Higher-Order Functions

Shu-Hung You, Robert Bruce Findler, Christos Dimoulas

摘要:

concolic测试的有效性随着程序规模的增加而恶化。一个有希望的方法是模块化地测试程序,例如,在每个函数或类的基础上。唉,这种想法在现代程序设计语言中遇到了障碍。在现代语言中,组件需要函数、对象甚至类作为输入。问题的关键是,现有的concolic测试技术不能忠实地捕捉一个高阶程序和它的输入之间的复杂的相互作用,以提取它在一阶公式,SMT求解器可以工作。在本文中,我们采取的第一步解决问题,我们提供了一个设计,语义和原型concolic测试高阶函数。受高阶符号执行工作的启发,我们的模型构造了具有规范形状的高阶函数的输入。这使得concolic测试器能够跟踪高阶函数的控制流路径的哪些部分取决于其输入的形状,哪些部分不取决于其输入的形状。concolic测试器将不依赖于输入形状的部分编码为一阶公式。随后,类似于一阶concolic测试器,它利用SMT求解器产生另一个具有相同形状的输入,但探索高阶函数的不同控制流路径。作为一个单独的维度,concolic测试器迭代地探索输入的规范形状,并调查高阶函数与其输入交互的所有方式,搜索bug。为了验证我们的设计,我们证明,如果一个高阶函数有一个错误,我们的concolic测试最终将构建一个输入,触发错误。使用我们的设计作为蓝图,我们实现了一个原型concolic测试仪,并确认它发现了各种高阶程序从文献中的错误。

英文摘要:

The effectiveness of concolic testing deteriorates as the size of programs increases. A promising way out is to test programs modularly, e.g., on a per function or class basis. Alas, this idea hits a roadblock in modern programming languages In modern languages, components expect functions, objects, and even classes as inputs. The crux of the problem is that existing concolic testing techniques cannot faithfully capture the complex interactions between a higher-order program and its inputs in order to distill it in a first-order formula that an SMT solver can work with. In this paper, we take the first step towards solving the problem; we offer a design, semantics, and prototype for concolic testing of higher-order functions. Inspired by work on higher-order symbolic execution, our model constructs inputs for higher-order functions with a canonical shape. This enables the concolic tester to keep track of which pieces of the control-flow path of the higher-order function depend on the shape of its input and which do not. The concolic tester encodes the pieces that do not depend on the shape of the input as a first-order formula. Subsequently, similar to a first-order concolic tester, it leverages an SMT solver to produce another input with the same shape but that explores a different control-flow path of the higher-order function. As a separate dimension, the concolic tester iteratively explores the canonical shapes for the input and, investigating all the ways a higher-order function can interact with its input, searching for bugs. To validate our design, we prove that if a higher-order function has a bug, our concolic tester will eventually construct an input that triggers the bug. Using our design as a blueprint, we implement a prototype concolic tester and confirm that it discovers bugs in a variety of higher-order programs from the literature.

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

↑