Original title:
Nástroj pro automatickou tvorbu asercí pro testy pomocí LLM
Translated title:
LLM-Based Automatic Assertion Generation for Software Tests
Authors:
Dvořák, Radim ; Rogalewicz, Adam (referee) ; Smrčka, Aleš (advisor) Document type: Bachelor's theses
Year:
2026
Language:
eng Publisher:
Vysoké učení technické v Brně. Fakulta informačních technologií Abstract:
[eng][cze]
Tato bakalářská práce představuje nástroj pro doplňování testovacích asercí z požadavků, popisu rozhraní systému a existujících testů. Velký jazykový model vytváří pomocí schémat Requirement IR, Interface IR, Test Trace IR a Assertion IR obsahující sémantiku aserce, informace o návaznosti a symbolický odkaz na místo vložení. Výstupy jsou validovány pomocí modelů Pydantic. Knihovny LibCST nebo Tree-sitter převedou odkaz na konkrétní pozici a aserce je následně vygenerována pro pytest, JUnit nebo Jest a vrácena jako jednotný diff. Neúspěšné kandidáty systém opakuje a poté přeskočí bez ovlivnění ostatních testů. Přesná správnost dosáhla 92,59\,\%, 86,67\,\% a 77,78\,\%. Hlavním omezením je konstrukce spustitelných cílových výrazů.
This thesis presents a tool for completing test assertions from natural-language requirements, system interfaces, and existing tests. A large language model generates schema-constrained Requirement IR, Interface IR, Test Trace IR, and Assertion IR, which contains assertion semantics, traceability, and a symbolic insertion reference. The outputs are validated using Pydantic models. LibCST or Tree-sitter resolves the insertion reference, after which the assertion is rendered for pytest, JUnit, or Jest and returned as a unified patch. Failed candidates are retried and then skipped without affecting other test cases. Evaluation achieved exact correctness of 92.59\%, 86.67\%, and 77.78\% across three experiments. The main limitation is the construction of executable target expressions.
Keywords:
automatické generování asercí; testování softwaru; testování založené na požadavcích; transformace zdrojového kódu; velké jazykové modely; vnitřní reprezentace; automated assertion generation; intermediate representation; large language models; requirements-based testing; software testing; source code transformation
Institution: Brno University of Technology
(web)
Document availability information: Fulltext is available in the Brno University of Technology Digital Library. Original record: http://hdl.handle.net/11012/260630