Saved in:
Bibliographic Details
Main Authors: Yang, Chen, Chen, Junjie
Format: Preprint
Published: 2026
Subjects:
Online Access:https://arxiv.org/abs/2604.23509
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914507728617472
author Yang, Chen
Chen, Junjie
author_facet Yang, Chen
Chen, Junjie
contents 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. From our industrial study, we summarize a series of lessons and suggestions for practical use and future research.
format Preprint
id arxiv_https___arxiv_org_abs_2604_23509
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Uncovering Business Logic Bugs via Semantics-Driven Unit Test Generation
Yang, Chen
Chen, Junjie
Software Engineering
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. From our industrial study, we summarize a series of lessons and suggestions for practical use and future research.
title Uncovering Business Logic Bugs via Semantics-Driven Unit Test Generation
topic Software Engineering
url https://arxiv.org/abs/2604.23509