KIT | KIT-Bibliothek | Impressum | Datenschutz

Can Formal Specifications Be Synthesized from Tests Alone?

Liu, Tianhai ORCID iD icon 1; Müller, Maximilian 1; Hey, Tobias ORCID iD icon 1; Lüntzel, Vitus ORCID iD icon 2; Minhas, Muhammad ORCID iD icon 1; Koziolek, Anne ORCID iD icon 1; Beckert, Bernhard ORCID iD icon 1
1 Karlsruher Institut für Technologie (KIT)
2 Institut für Technik der Informationsverarbeitung (ITIV), Karlsruher Institut für Technologie (KIT)

Abstract:

Formal specifications offer strong guarantees, but remain costly to write manually. Recent LLM-based approaches automate this by inferring specifications from source code, yet their reliance on white-box access poses barriers to industrial adoption due to intellectual property risks and deployment costs. Our approach uses LLMs to infer candidate specifications solely from test code and dynamic execution traces: the LLM observes only the program interface, selected inputs, and corresponding outputs or state changes, while the implementation internals remain hidden. Candidate specifications are validated locally using bounded model checking, with feedback guiding iterative refinement. Initial results on the SpecGenBench benchmark suggest that tests can guide LLMs towards meaningful Java Modeling Language specifications, while also highlighting checker compatibility and diagnostic feedback as key challenges for reliable refinement.


Verlagsausgabe §
DOI: 10.5445/IR/1000199048
Veröffentlicht am 11.11.2026
Cover der Publikation
Zugehörige Institution(en) am KIT Institut für Technik der Informationsverarbeitung (ITIV)
Publikationstyp Proceedingsbeitrag
Publikationsdatum 07.10.2026
Sprache Englisch
Identifikator ISBN: 979-8-4007-2882-2
KITopen-ID: 1000199048
Erschienen in Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering
Veranstaltung 41st IEEE/ACM International Conference on Automated Software Engineering (ASE 2026), München, Deutschland, 12.10.2026 – 16.10.2026
Verlag Association for Computing Machinery (ACM)
Seiten 4575 - 4579
Externe Relationen Siehe auch
Schlagwörter Test-Derived Formal Specifications, LLM, BMC
Nachgewiesen in OpenAlex
Scopus
KIT – Die Universität in der Helmholtz-Gemeinschaft
KITopen Landing Page