API-Knowledge Aware Search-Based Software Testing: Where, What, and How
Xiaoxue Ren, Xinyuan Ye, Yun Lin, Zhenchang Xing, Shuqing Li, Michael R. Lyu
Abstract
Search-based software testing (SBST) has proved its effectiveness in generating test cases to achieve its defined test goals, such as branch and data-dependency coverage. However, to detect more program faults in an effective way, pre-defined goals can hardly be adaptive in diversified projects. In this work, we propose KAT, a novel knowledge-aware SBST approach to generate on-demand assertions in the program under test (PUT) based on its used APIs. KAT constructs an API knowledge graph from the API documentation to derive the constraints that the client codes need to satisfy. Each constraint is instrumented into the PUT as a program branch, serving as a test goal to guide SBST to detect faults. We evaluate KAT with two baselines (i.e., EvoSuite and Catcher) with a close-world and an open-world experiment to detect API bugs. The close-world experiment shows that KAT outperforms the baselines in the F1-score (0.55 vs. 0.24 and 0.30) to detect API-related bugs. The open-world experiment shows that KAT can detect 59.64% and 9.05% more bugs than the baselines in practice.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 08f903ba-044e-4579-b1ab-13bf3fa5847aCited by top-tier papers4
- Learning Project-wise Subsequent Code Edits via Interleaving Neural-based Induction and Tool-based DeductionChenyan Liu, Yun Lin, Yuhuan Huang, Jiaxin Chang et al.ASE 2025 · 1 citation
- Inside Out: Uncovering How Comment Internalization Steers LLMs for Better or WorseAaron Imani, Mohammad Moshirpour, Iftekhar AhmedICSE 2026
- Still Manual? Automated Linter Configuration via DSL-Based LLM Compilation of Coding StandardsZejun Zhang, Yixin Gan, Zhenchang Xing, Tian Zhang et al.FSE 2026
- EditFlow: Benchmarking and Optimizing Code Edit Recommendation Systems via Reconstruction of Developer FlowsChenyan Liu, Yun Lin, Jiaxin Chang, Jiawei Liu et al.OOPSLA 2026
Builds on3
- API-Misuse Detection Driven by Fine-Grained API-Constraint Knowledge GraphXiaoxue Ren, Xinyuan Ye, Zhenchang Xing, Xin Xia et al.ASE 2020 · 62 citations
- Graph-based seed object synthesis for search-based unit testingYun Lin, You Sheng Ong, Jun Sun, Gordon Fraser et al.FSE 2021 · 34 citations
- Defect Prediction Guided Search-Based Software TestingAnjana Perera, Aldeida Aleti, Marcel Böhme, Burak TurhanASE 2020 · 16 citations
Related papers
- Generating Concept based API Element Comparison Using a Knowledge GraphYang Liu, Mingwei Liu, Xin Peng, Christoph Treude et al.ASE 2020 · 28 citations
- Selectively Combining Multiple Coverage Goals in Search-Based Unit Test GenerationZhichao Zhou, Yuming Zhou, Chunrong Fang, Zhenyu Chen et al.ASE 2022 · 8 citations
- Morest: Model-based RESTful API Testing with Execution FeedbackYi Liu, Yuekang Li, Gelei Deng, Yang Liu et al.ICSE 2022 · 52 citations
- Leveraging Large Language Models for Enhancing the Understandability of Generated Unit TestsAmirhossein Deljouyi, Roham Koohestani, Maliheh Izadi, Andy ZaidmanICSE 2025 · 8 citations
- Constructing a System Knowledge Graph of User Tasks and Failures from Bug Reports to Support Soap Opera TestingYanqi Su, Zheming Han, Zhenchang Xing, Xin Xia et al.ASE 2022 · 8 citations
