Uncovering Business Logic Bugs via Semantics-Driven Unit Test Generation (Experience Paper)
Chen Yang, Junjie Chen
Key points
From the paper's conclusion- We present SeGa, a semantics-driven unit test generation technique for uncovering business logic bugs.
Abstract
Business logic bugs violate intended business semantics and are particularly prevalent in enterprise software. Yet most existing unit test generation techniques are code-centric, making such bugs difficult to expose. We present SeGa, a semantics-driven unit test generation technique for uncovering business logic bugs. SeGa constructs a semantic knowledge base from product requirement documents, represented as a set of functionality entries that group related requirements under a common business intent. Given a focal method, SeGa retrieves the relevant functionality entries and derives fine-grained business scenarios with explicit preconditions, triggering actions, expected outcomes, and semantic constraints to guide LLM-based test generation. We evaluate SeGa on four industrial Go projects containing 60 real-world business logic bugs. SeGa detects 22~25 more bugs than four state-of-the-art LLM-based techniques and improves precision by 26.9%~34.3%. Deployment across 6 production repositories further uncovers 16 previously unknown business logic bugs that were confirmed and fixed by developers, demonstrating SeGa's practical value. From our industrial study, we summarize a series of lessons and suggestions for practical use and future research.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Beyond Coverage and Mutation: A Blind-Spot Analysis of LLM-Generated Unit TestsarXiv · 2026
- AgenTest: Mining Business Rules to Test LLM Agents for Business Logic BugsarXiv · 2026
- Do Coverage and Mutation Scores of LLM-Generated Test Suites Correlate with Their Effectiveness? (Replicability Study)Proceedings of the ACM on software engineering. · 2026
- Benchmarking LLM Agents for Behaviorally Adequate Test Generation from Software RequirementsarXiv · 2026
- SmartFuzz: Leveraging Large Language Models and Feature Composition to Generate High-Quality Seeds for Database FuzzingProceedings of the ACM on Programming Languages · 2026
- Evaluating and Mitigating the Misguidance Effect of Buggy Code in LLM-Generated Unit TestsProceedings of the ACM on software engineering. · 2026