Semantic bug seeding: a learning-based approach for creating realistic bugs
Jibesh Patra, Michael Pradel
Abstract
When working on techniques to address the wide-spread problem of software bugs, one often faces the need for a large number of realistic bugs in real-world programs. Such bugs can either help evaluate an approach, e.g., in form of a bug benchmark or a suite of program mutations, or even help build the technique, e.g., in learning-based bug detection. Because gathering a large number of real bugs is difficult, a common approach is to rely on automatically seeded bugs. Prior work seeds bugs based on syntactic transformation patterns, which often results in unrealistic bugs and typically cannot introduce new, application-specific code tokens. This paper presents SemSeed, a technique for automatically seeding bugs in a semantics-aware way. The key idea is to imitate how a given real-world bug would look like in other programs by semantically adapting the bug pattern to the local context. To reason about the semantics of pieces of code, our approach builds on learned token embeddings that encode the semantic similarities of identifiers and literals. Our evaluation with real-world JavaScript software shows that the approach effectively reproduces real bugs and clearly outperforms a semantics-unaware approach. The seeded bugs are useful as training data for learning-based bug detection, where they significantly improve the bug detection ability. Moreover, we show that SemSeed-created bugs complement existing mutation testing operators, and that our approach is efficient enough to seed hundreds of thousands of bugs within an hour.
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 1aacf1b5-72fe-4946-9680-b22dcd84bd6dCited by top-tier papers20
- Self-Supervised Bug Detection and RepairMiltiadis Allamanis, Henry Jackson-Flux, Marc BrockschmidtNeurIPS 2021 · 145 citations
- NatGen: generative pre-training by "naturalizing" source codeSaikat Chakraborty, Toufique Ahmed, Yangruibo Ding, Premkumar T. Devanbu et al.FSE 2022 · 101 citations
- On the Reliability of Coverage-Based Fuzzer BenchmarkingMarcel Böhme, László Szekeres, Jonathan MetzmanICSE 2022 · 91 citations
- Large Language Models of Code Fail at Completing Code with Potential BugsTuan Dinh, Jinman Zhao, Samson Tan, Renato Negrinho et al.NeurIPS 2023 · 59 citations
- Nuances are the Key: Unlocking ChatGPT to Find Failure-Inducing Tests with Differential PromptingTsz On Li, Wenxi Zong, Yibo Wang, Haoye Tian et al.ASE 2023 · 51 citations
Builds on10
- Coverage-based Greybox Fuzzing as Markov ChainMarcel Böhme, Van-Thuan Pham, Abhik RoychoudhuryCCS 2016 · 1,026 citations
- Driller: Augmenting Fuzzing Through Selective Symbolic ExecutionNick Stephens, John Grosen, Christopher Salls, Andrew Dutcher et al.NDSS 2016 · 1,021 citations
- Learning and Evaluating Contextual Embedding of Source CodeAditya Kanade, Petros Maniatis, Gogul Balakrishnan, Kensen ShiICML 2020 · 438 citations
- LAVA: Large-Scale Automated Vulnerability AdditionBrendan Dolan-Gavitt, Patrick Hulin, Engin Kirda, Tim Leek et al.S&P 2016 · 354 citations
- T-Fuzz: Fuzzing by Program TransformationHui Peng, Yan Shoshitaishvili, Mathias PayerS&P 2018 · 326 citations
Related papers
- Hoppity: Learning Graph Transformations to Detect and Fix Bugs in ProgramsElizabeth Dinella, Hanjun Dai, Ziyang Li, Mayur Naik et al.ICLR 2020 · 212 citations
- Contextuality of Code Representation LearningYi Li, Shaohua Wang, Tien N. NguyenASE 2023 · 2 citations
- SoFi: Reflection-Augmented Fuzzing for JavaScript EnginesXiaoyu He, Xiaofei Xie, Yuekang Li, Jianwen Sun et al.CCS 2021 · 34 citations
- BCFuzz: Bytecode-Driven Fuzzing for JavaScript EnginesJiming Wang, Chenggang Wu, Jikai Ren, Yuhao Hu et al.ASE 2025 · 1 citation
- IdBench: Evaluating Semantic Representations of Identifier Names in Source CodeYaza Wainakh, Moiz Rauf, Michael PradelICSE 2021 · 2 citations
