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

被引:0
作者
Ming-Zhe Zhang
Yun-Zhan Gong
Ya-Wen Wang
Da-Hai Jin
机构
[1] Beijing University of Posts and Telecommunications,State Key Laboratory of Networking and Switching Technology
来源
Journal of Computer Science and Technology | 2019年 / 34卷
关键词
automated unit testing; program constraint; symbolic execution; static analysis;
D O I
暂无
中图分类号
学科分类号
摘要
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.
引用
收藏
页码:670 / 689
页数:19
相关论文
共 40 条
[21]   An Automated Testing Tool for Java']Java Application Using Symbolic Execution based Test Case Generation [J].
Monpratarnchai, Supasit ;
Fujiwara, Shoichiro ;
Katayama, Asako ;
Uehara, Tadahiro .
2013 20TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC 2013), VOL 2, 2013, :93-98
[22]   Non-Semantics-Preserving Transformations For Higher-Coverage Test Generation Using Symbolic Execution [J].
Converse, Hayes ;
Olivo, Oswaldo ;
Khurshid, Sarfraz .
2017 10TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION (ICST), 2017, :241-252
[23]   Quantifying the Characteristics of Java']Java Programs that May Influence Symbolic Execution from a Test Data Generation Perspective [J].
Eler, Marcelo M. ;
Endo, Andre T. ;
Durelli, Vinicius H. S. .
2014 IEEE 38TH ANNUAL INTERNATIONAL COMPUTERS, SOFTWARE AND APPLICATIONS CONFERENCE (COMPSAC), 2014, :181-190
[24]   BigTest: A Symbolic Execution Based Systematic Test Generation Tool for Apache Spark [J].
Gulzar, Muhammad Ali ;
Musuvathi, Madanlal ;
Kim, Miryung .
2020 ACM/IEEE 42ND INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS (ICSE-COMPANION 2020), 2020, :61-64
[25]   Protocol testing with symbolic execution and rule based specification using multicore approach [J].
George, Sherin Mariam ;
Sangeetha, U. .
INTERNATIONAL CONFERENCE ON EMERGING TRENDS IN ENGINEERING, SCIENCE AND TECHNOLOGY (ICETEST - 2015), 2016, 24 :1609-1615
[26]   Tackling the Path Explosion Problem in Symbolic Execution-driven Test Generation for Programs [J].
Krishnamoorthy, Saparya ;
Hsiao, Michael S. ;
Lingappan, Loganathan .
2010 19TH IEEE ASIAN TEST SYMPOSIUM (ATS 2010), 2010, :59-64
[27]   Symbolic execution based test-patterns generation algorithm for hardware Trojan detection [J].
Shen, Lixiang ;
Mu, Dejun ;
Cao, Guo ;
Qin, Maoyuan ;
Blackstone, Jeremy ;
Kastner, Ryan .
COMPUTERS & SECURITY, 2018, 78 :267-280
[28]   Automated Generation of Buffer Overflow Quick Fixes Using Symbolic Execution and SMT [J].
Muntean, Paul ;
Kommanapalli, Vasantha ;
Ibing, Andreas ;
Eckert, Claudia .
COMPUTER SAFETY, RELIABILITY, AND SECURITY, SAFECOMP 2015, 2015, 9337 :441-456
[29]   Test Image Generation using Segmental Symbolic Evaluation [J].
Jameel, Tahir ;
Lin, Mengxiang .
INTERNATIONAL JOURNAL OF NETWORKED AND DISTRIBUTED COMPUTING, 2014, 2 (03) :135-147
[30]   A Program Simplification Method for Generating Test Input Values Using Symbolic Execution [J].
Soga, Ryo ;
Yonemitsu, Tetsuya ;
Inagaki, Mitsuo ;
Fujisaki, Yasushi ;
Sugou, Hiroo ;
Kanuka, Hideyuki .
2020 27TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC 2020), 2020, :507-508