Unit Test Data Generation for C Using Rule-Directed Symbolic Execution

来源 :计算机科学技术学报(英文版) | 被引量 : 0次 | 上传用户:ydahu
下载到本地 , 更方便阅读
声明 : 本文档内容版权归属内容提供方 , 如果您对本文有版权争议 , 可与客服联系进行内容授权或下架
论文部分内容阅读
Unit testing is widely used in software development. One important activity in unit testing is automatic test data generation. Constraint-based test data generation is a technique for automatic generation of test data, which uses symbolic execution to generate constraints. Unit testing only tests functions instead of the whole program, where individual functions typically have preconditions imposed on their inputs. Conventional symbolic execution cannot detect these preconditions, let alone converting these preconditions into constraints. To overcome these limitations, we propose a novel unit test data generation approach using rule-directed symbolic execution for dealing with functions with missing input preconditions. Rule-directed symbolic execution uses predefined rules to detect preconditions in the individual function, and generates constraints for inputs based on preconditions. We introduce implicit constraints to represent preconditions, and unify implicit constraints and program constraints into integrated constraints. Test data generated based on integrated constraints can explore previously unreachable code and help developers find more functional faults and logical faults. We have implemented our approach in a tool called CTS-IC, and applied it to real-world projects. The experimental results show that rule-directed symbolic execution can find preconditions (implicit constraints) automatically from an individual function. Moreover, the unit test data generated by our approach achieves higher coverage than similar tools and efficiently mitigates missing input preconditions problems in unit testing for individual functions.
其他文献
期刊
中国,北京(2019年2月11日)— 美国约翰迪尔公司宣布在中国推出两款迷你型液压挖掘机E18zs和E60.rn这两款挖掘机代表了约翰迪尔在继20吨级、30吨级、10吨级和40吨级产品之后,
期刊
期刊
患者 女 ,5 7岁。主因胸闷气短 1年 ,右侧胸疼、咳嗽、咳痰、痰中带血丝 3个月入院。查体 :T 3 6℃ ,Bp 2 0 /13kPa( 1kPa =7.5mmHg) ,双侧胸廓对称 ,右侧呼吸动度减低 ,语
通过对表层土壤样品测定及统计分析,塔城市耕地有机质含量集中在10~30克/千克之间,全氮含量集中在0.75~1.5克/千克之间,从极差来看,塔城市耕地有机质和全氮含量均存在明显差异;塔城市不同土类表层土壤有机质含量和全氮含量之间有明显的正相关关系,土壤中有机质含量的高低影响土壤氮素供应水平;利用回归方程,可以从有机质含量估算出全氮含量。
花椒小吉丁虫(Agrilus sp.)在白龙江上游一年发生一代,以幼虫在寄主皮层隧道里越冬,成虫羽化期,树体喷布浓度为0.125%的灭多威+高氯菊脂,防治率达85%以上,成虫刚羽化后喷施25
Increasingly there is a need to process graphs that are larger than the available memory on today’s machines. Many systems have been developed with graph repre
段建伟经历了从带有原乡情感的中原叙事向绘画本体觉醒的过渡,以至走向自觉的绘画性和形而上化的感性形塑。在近两年的绘画中,人物形象带有极强的形式感,人物表情大多显得极
以湖南省“十一五”期间建设项目征占用林地需求量预测为例,探讨了运用SPSS13.0统计软件,对建设用地总规模回归分析建模,进而预测建设项目征占用林地需求量的方法。 Taking