Retrieval Augmented Generation for Reliable Software Engineering: A Critical Review of Repository Context and Evaluation
Keywords:
Retrieval-Augmented Generation, Software Engineering, Repository-Level Code Generatio, Large Language Models, Software ReliabilityAbstract
Repository-aware coding assistants need access to project knowledge, yet retrieving that knowledge does not establish the correctness of generated software. This critical integrative review examines how retrieval-augmented generation supports code completion, repository-level generation, and issue resolution. A purposively selected corpus of 27 technical publications, supported by one methodological reference, is analysed through structured extraction of retrieval design, task setting, evaluation evidence, and limitations. The technical literature spans 2020–2026, with emphasis on recent repository-oriented methods and benchmarks. Four themes emerge. First, useful context depends on dependency structure, task requirements, and interactions between retrieved fragments, rather than similarity alone. Second, retrieval accuracy, textual agreement, and executable correctness provide different kinds of evidence. Third, repository freshness and the trustworthiness of retrieved material affect reliability independently of model capability. Fourth, additional retrieval and agentic steps require justification against latency, cost, and human verification effort. The review develops a reference architecture and a staged evaluation framework that connect context selection to independently assessed software behaviour. It argues for selective retrieval, version-controlled evidence, explicit failure analysis, and testing that remains separate from model confidence. Current research supports carefully bounded assistance, while broad claims of dependable autonomous maintenance require stronger evidence across repositories, languages, and operational conditions.