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
相关论文
共 42 条
[31]   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
[32]   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
[33]   Improvements of Directed Automated Random Testing in Test Data Generation for C plus plus Projects [J].
Duc-Anh Nguyen ;
Tran Nguyen Huong ;
Hieu Vo Dinh ;
Pham Ngoc Hung .
INTERNATIONAL JOURNAL OF SOFTWARE ENGINEERING AND KNOWLEDGE ENGINEERING, 2019, 29 (09) :1279-1312
[34]   A Test Case Auto Generation Algorithm Based On Sensitive Path of Program With Taint Analysis and Symbolic Execution [J].
Zhang, Xing ;
Feng, Chao ;
Zhang, Bin ;
Zhang, Quan .
2016 INTERNATIONAL CONFERENCE ON COMPUTER SCIENCE AND INFORMATION SECURITY (CSIS 2016), 2016, :364-370
[35]   Generating test sequences using symbolic execution for event-driven real-time systems [J].
Lee, NH ;
Cha, SD .
MICROPROCESSORS AND MICROSYSTEMS, 2003, 27 (10) :523-531
[36]   Automated test data generation and stubbing method for C/C plus plus embedded projects [J].
Tung, Lam Nguyen ;
Duong, Nguyen Vu Binh ;
Le, Khoi Nguyen ;
Hung, Pham Ngoc .
AUTOMATED SOFTWARE ENGINEERING, 2024, 31 (02)
[37]   A Multi-Layer Fault Triggering Framework based on Evolutionary Strategy Guided Symbolic Execution for Automated Test Case Generation [J].
Duan, Zhiyu ;
Li, Yujia ;
Ma, Pubo ;
Gou, Xiaodong ;
Yang, Shunkun .
2022 IEEE 22ND INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY, AND SECURITY COMPANION, QRS-C, 2022, :255-262
[38]   UnitTestBot: Automated Unit Test Generation for C Code in Integrated Development Environments [J].
Ivanov, Dmitry ;
Babushkin, Alexey ;
Grigoryev, Saveliy ;
Iatchenii, Pavel ;
Kalugin, Vladislav ;
Kulikov, Egor ;
Kulikov, Egor ;
Misonizhnik, Aleksandr ;
Mordvinov, Dmitry ;
Morozov, Sergey ;
Naumenko, Olga ;
Pleshakov, Alexey ;
Ponomarev, Pavel ;
Shmidt, Svetlana ;
Utkin, Alexey ;
Volodin, Vadim ;
Volynets, Arseniy .
2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS, ICSE-COMPANION, 2023, :380-384
[39]   Automated test data generation using a scatter search approach [J].
Blanco, Raquel ;
Tuya, Javier ;
Adenso-Diaz, Belarmino .
INFORMATION AND SOFTWARE TECHNOLOGY, 2009, 51 (04) :708-720
[40]   FSX: A Tool for Fine-Grained Incremental Unit Test Generation for C/C plus plus Programs [J].
Yoshida, Hiroaki ;
Tokumoto, Susumu ;
Prasad, Mukul R. ;
Ghosh, Indradeep ;
Uehara, Tadahiro .
FSE'16: PROCEEDINGS OF THE 2016 24TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON FOUNDATIONS OF SOFTWARE ENGINEERING, 2016, :1052-1056