Overview
一些特点:
- 11年出现了Csmith以及CReduce等易用有效的工具,11年到18年中50%的工作基于这些软件
测试程序生成
Overview
挑战
- 测试程序的有效性
- 测试程序的多样性
- 测试方法施加的具体要求
测试样例生成
以语法为导向的方法
Context-free grammar
- A sentence generator for testing parsers —— 1972
目标:测试解析器
输入:上下无关语法
期望:尽可能多得覆盖解析器的状态和过度
缺陷:难以表达语言的上下文敏感特征
改进:在此基础上,研究者添加上下文敏感属性,形成two-level grammars:W-grammars, attribute grammars, affix grammars.
Affix grammar
提出的原因:通过参数扩充上下无关语法
- Automatic generation of test cases —— 1970
形式: < l a b e l d e c l a r a t i o n > → < d e c l a r a t i o n i d e n t i f i e r > < l a b e l > → < < l a m b d a > > <label \; declaration> \to <declaration \; identifier> \;\;\; <label> \to <<lambda>> <labeldeclaration>