ISSTA 2026
Sun 4 - Fri 9 October 2026 Oakland, California, United States
co-located with SPLASH/ISSTA 2026

Unit testing is essential for software quality assurance, where a test case typically consists of a test prefix and an oracle, expressed as assertions. In practice, crafting high-quality assertions is non-trivial and time-consuming, as it requires developers to reason carefully about program states and expected behaviors. While recent advances in Large Language Models (LLMs) have shown promise for automating assertion generation (AG), current AG methods often rely on two unrealistic assumptions: (1) the \textit{Single-Assertion Formulation} (\textbf{A1}), which assumes tests contain only one assertion, and (2) the \textit{Known-Position Formulation} (\textbf{A2}), which treats AG as a “fill-in-the-blanks” task with pre-defined insertion points. Despite being widely adopted, the realism and implications of these assumptions have not been systematically examined. This paper revisits AG under a realistic \textit{Mixed-Assertion Scenario}, where tests may contain one or multiple assertions and insertion positions are unavailable at inference time. To examine \textbf{A1}, we first conduct a large-scale empirical study of 358,117 developer-written tests from 7,061 projects. The results show that multi-assertion tests are prevalent, accounting for 40.32% of all tests and appearing in 92.87% of projects. Through manual analysis, we derive a taxonomy comprising ten fine-grained assertion patterns, showing that assertions in multi-assertion tests are rarely independent checks (4.69%) and instead coordinate to validate a unified test objective. To examine \textbf{A2}, we remove ground-truth insertion cues and observe substantial performance degradation, with Exact Match dropping by 11.80%-23.18% overall. This suggests that position cues affect not only where assertions are placed, but also the quality of what to assert. Motivated by these findings, we propose DA-AG, a two-stage framework designed for the realistic \textit{Mixed-Assertion Scenario} with unknown insertion positions. In the first stage, it predicts assertion insertion positions to construct an assertion skeleton with explicit insertion cues. In the second stage, it generates assertion content conditioned on the resulting skeleton and retrieved exemplar assertion sequences. Extensive experiments across 13 diverse LLMs show that DA-AG consistently outperforms the corresponding one-stage baselines, which directly generate the completed test from the focal method and raw test prefix. DA-AG improves Exact Match by 32.24%-78.08% and CodeBLEU by 2.80%-8.63%, and further increases bug exposure on Defects4J by 6-39 exposed bugs and 7-23 unique exposed bugs. Moreover, DA-AG outperforms representative closed-source LLMs (e.g., GPT-4o and Claude-3.5) in both generation quality and bug-finding effectiveness under the realistic setting.