From Domain Knowledge to Composable Reactive Code: LLM-Assisted Development with Scenario-Based Programming
Abstract
Reactive systems must continuously respond to events and coordinate interacting behaviors, making code generation challenging: reliability depends not only on individual components but on how they compose at runtime. We investigate Scenario-Based Programming (SBP) in two complementary roles: as a structured medium for communicating domain knowledge to a Large Language Model (LLM), and as the target paradigm for generated extensions. We implement the Taki card game in SBP and ask an LLM to generate Python players using progressively richer SBP-cast domain knowledge. Separately, we ask the LLM to generate strategy scenarios that compose directly with the existing implementation. In controlled simulations, all generated strategies that we evaluated complete their runs without observed runtime errors, deadlocks, or draws. The generated SBP strategy also composes with an additional hand-authored scenario without observed execution failures. Richer SBP-cast domain knowledge is associated with stronger generated Python strategies: their win rate against a fixed random SBP baseline increases from 59.4% to 62.5%. The directly generated SBP strategy wins 64.9% against the same baseline and 51.2%--52.3% head-to-head against the generated Python strategies. These results suggest that SBP can serve both as a medium for communicating domain knowledge and as a composable target for reactive-system extensions.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI
- Comments
- Accepted to MODELSWARD 2027
Related papers
Why Johnny Can't Vibe: The Competence Paradox of AI-Assisted Software Development
Shared title terminologycs.SESabbir Bin Abdul Latif, Md Raihan, Md. Mahfuzul Ahsan et al.
Interactive Prompting Assistant: Just-in-Time Requirement Clarification for Agentic Software Development
Shared title terminologycs.SECuong Chi Le, Minh Le-Anh, Long Vu et al.
AI-Generated Code Issues: A Taxonomy from Repository Histories, AI Conversations, and Developer Interviews
Shared title terminologycs.SERosalia Tufano, Nargiz Humbatova, Daniele Bifolco et al.
LLM-Assisted Software Migration: from Module-Level Transformation to Repository-Level Integration
Shared title terminologycs.SEYanan Zhang, Shengqi Liu, Tao Zhang et al.
How developers split roles among them and a coding agent and what "collaboration" means
Shared title terminologycs.SELinus Ververs, Helya Dadkhah, Lutz Prechelt
Privacy Signals in Developer Narration
Shared title terminologycs.SESarah Santos, Thomas Norton, Aniket Kesari et al.