From Resource Flow to Executable Tests: Petri-Net-Guided LLM Test Generation for Concurrent Stateful Rust APIs
The paper proposes using Petri nets as the control layer between abstract concurrency scenarios and LLM-written Rust tests.
It models resources, lifecycle states, and causal dependencies as colored tokens and transitions, then derives legal, near-legal, and partial-order concurrent scenarios. Those scenarios constrain the LLM so generated tests are less likely to violate API preconditions or collapse into shallow sequential traces. A repair loop is meant to keep the synthesized code faithful to the modeled scenario, while schedule shaping pushes high-conflict interleavings into systematic exploration. ArXiv · AI/CL/LG's note
It models resources, lifecycle states, and causal dependencies as colored tokens and transitions, then derives legal, near-legal, and partial-order concurrent scenarios. Those scenarios constrain the LLM so generated tests are less likely to violate API preconditions or collapse into shallow sequential traces. A repair loop is meant to keep the synthesized code faithful to the modeled scenario, while schedule shaping pushes high-conflict interleavings into systematic exploration. ArXiv · AI/CL/LG's note
score 4