mlsanityData to 7 Oct 2026

Agent-Based Test Assertion Generation via Diverse Perspective Aggregation

arXiv 2608.05822 ↗First posted 6 Aug 2026cs.SEcited by 0

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

Test assertions are critical elements of unit tests, serving as checkpoints to validate expected behavior and ensure software correctness. Numerous techniques have been proposed to automate assertion generation, with recent progress notably driven by large language models (LLMs). Despite the promise, existing approaches such as ChatAssert suffer from modest accuracy, heavy reliance on oversampling, and vulnerability to model randomness due to one-shot prompting. To address these limitations, we propose AssertMate, a novel agent-based assertion generation framework that enhances the quality and reliability of LLM-generated assertions through three key components: (1) actual value construction that identifies assertion targets via static analysis and type-aware heuristics; (2) multi-perspective expected value prediction using code generation, retrieval-augmented generation (RAG), and chain-of-thought (CoT) reasoning agents; and (3) an LLM-as-a-Judge collaboration mechanism to select the most appropriate assertion. Evaluation on the Defects4J benchmark demonstrates that AssertMate significantly outperforms state-of-the-art techniques in compilation success and pass rates, along with substantially higher bug detection capabilities. Integration with EvoSuite further validates AssertMate's practicality, yielding superior mutation coverage and kill counts. Ablation studies reveal that each of the three components makes a significant and complementary contribution to the overall performance. This work affirms the great potential of aggregating diverse perspectives to enhance the effectiveness of LLM-based assertion generation.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 22 of its 50 references that are in the map. First posted on arXiv 6 Aug 2026.

Builds on

22 of 50 references.

References · 22

  1. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
  2. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  3. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  4. 2024Large Language Model based Multi-Agents: A Survey of Progress and Challengescited by 752
  5. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
  6. 2020Unit Test Case Generation with Transformers and Focal Contextcited by 118
  7. 2023ChatUniTest: A Framework for LLM-Based Test Generationcited by 94
  8. 2024Self-Contrast: Better Reflection Through Inconsistent Solving Perspectivescited by 71
  9. 2021TOGA: A Neural Method for Test Oracle Generationcited by 57
  10. 2020On Learning Meaningful Assert Statements for Unit Test Casescited by 42
  11. 2016A Survey of Symbolic Execution Techniquescited by 36
  12. 2024On the Evaluation of Large Language Models in Unit Test Generationcited by 33
10 more
  1. 2023Learning Deep Semantics for Test Completioncited by 31
  2. 2024TOGLL: Correct and Strong Test Oracle Generation with LLMscited by 23
  3. 2024Hybrid Automated Program Repair by Combining Large Language Models and Program Analysiscited by 22
  4. 2023Fixing Large Language Models' Specification Misunderstanding for Better Code Generationcited by 16
  5. 2025AsserT5: Test Assertion Generation Using a Fine-Tuned Code Language Modelcited by 7
  6. 2024Large Language Models for Equivalent Mutant Detection: How Far Are We?cited by 6
  7. 2023Revisiting and Improving Retrieval-Augmented Deep Assertion Generationcited by 5
  8. 2025Improving Deep Assertion Generation via Fine-Tuning Retrieval-Augmented Pre-trained Language Modelscited by 4
  9. 2025Clarifying Semantics of In-Context Examples for Unit Test Generationcited by 3
  10. 2022Variable-Based Fault Localization via Enhanced Decision Treecited by 1

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026TDD-Agent: Test-Driven Reasoning for Code Generation
  2. 2024SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents
  3. 2026VibeCheck: Assessing the Quality of LLM-Generated Unit Tests: A Multi-agent Empirical Study across Heterogeneous Repositories
  4. 2026Consistency Meets Verification: Enhancing Test Generation Quality in Large Language Models Without Ground-Truth Solutions
  5. 2025TestForge: Feedback-Driven, Agentic Test Suite Generation
  6. 2026Multi-Agent LLM Collaboration for Unit Test Generation via Human-Testing-Inspired Workflows
  7. 2026Grounding AI Agents in Contracts: An Empirical Evaluation of Spec-Driven Test Generation
  8. 2026Rethinking the Value of Agent-Generated Tests for LLM-Based Software Engineering Agents