Linkedin

AI Agents Turn Documentation into Bug Detection: LASIGE Research at ASE 2026

Date: 17/11/2026

Code documentation oftentimes contains rules that should be followed but are not enforced. For example, it might seem obvious that we need to connect a socket before we send data over it or that we cannot read from a closed file. However, these rules about the state of an object throughout its lifetime are only written in natural language, and not automatically checked when developers are coding. 

The paper “Barista: Synthesizing Typestate Specifications with LLM Agents” presents an agentic workflow in which agents read Java class documentation and translate the state rules to LiquidJava, an extension to Java also developed at LASIGE that encodes these rules and provides verification for clients that use the encoded classes. This approach relies on an intermediate representation of the protocol as a state machine, the generation of unit test cases, and the iteration over the verification and the test suite to ensure they capture the protocol. For the evaluation, the paper uses 35 classes from the Java standard library, achieving 87.0% precision and 68.3% recall, and 75% of the classes’ annotations could be used directly or with minor edits. Overall, this workflow provides a bootstrap mechanism for translating class rules into verifiable specifications, making verification widely available for large codebases.

Catarina Gamboa led this project and presented it at ASE’26 (Core A*) in Munich this October. The paper, co-authored by Paulo Canelas, Ricardo Costa, Márcio Milisse Caetano, Jonathan Aldrich, and Alcides Fonseca, is available in the ACM Digital Library, and an interactive introduction to the research is available here.