arXiv:2611.01173cs.SEOct 2026

Manuscript Offprint

arXiv:2611.01173

From Stories to Bugs: Story-Based Semantic Fuzzing of Interactive Systems

Yeshayahu Weiss, Achiya Elyasaf, Gera Weiss

YESHAYAHU WEISS, Ben-Gurion University of the Negev, Israel

ACHIYA ELYASAF, Ben-Gurion University of the Negev, Israel

GERA WEISS, Ben-Gurion University of the Negev, Israel

Complex interactive systems hide business-logic failures along two complementary axes: deep state-dependent behaviors that require long valid prefixes and concurrency-sensitive failures that depend on the ordering of otherwise legal operations. We present story-based semantic fuzzing, a methodology that treats semantically constrained compositions of behavioral stories as primary search objects. Implemented through Behavioral Programming, semantic binding and state constraints preserve legal prefixes, while event eligibility, schedule selection, and replay expose failure-relevant interleavings. We evaluate the methodology on Magento and four stateful REST APIs. On Magento, overlap-aware ranking increased reproduction of a sporadic Shipping Fee race from 3.6% to 41.2%; a controlled ordering intervention reduced a second failure signature from 100/100 initial executions to 0/200 constrained executions. For the REST study, a versioned end-to-end pipeline took each frozen public OpenAPI contract as its sole benchmark-specific model-generation input and automatically generated the Basic and Complex stories, dependency structure, and interface bindings. Under a shared black-box task and sequence-local evaluation contract, Basic and Complex confirmed 0/11 and 11/11 semantic fault classes, while RESTler and EvoMaster confirmed 2/11 and 0/11. A paired binding ablation produced 250/250 valid dependent operations with binding and 0/250 without it, while supplementary prefix controls localized the difference to preservation of legal relational state. Together, the studies show that searching admissible semantic compositions provides a unified and effective representation for reaching deep states and exposing concurrency-sensitive business-logic failures.

CCS Concepts: • Software and its engineering → Software testing and debugging; Concurrency control; System testing.

Additional Key Words and Phrases: semantic fuzzing, story-based testing, stateful API testing, business-logic race conditions, concurrency testing, bug amplification, model-based testing, behavioral programming

1 Introduction

Modern software systems are increasingly concurrent and stateful. In domains ranging from e-commerce to enterprise Software as a Service (SaaS), business behavior emerges from interactions among multiple user sessions, background services, roles, and long sequences of dependent operations [34]. Although individual workflows may appear simple, their combinations create a large space of system states and execution orders [13]. Critical defects can therefore remain hidden along two complementary dimensions: deep state-dependent behaviors that require long valid prefixes, and concurrency-sensitive failures whose manifestation depends on the relative timing of otherwise valid operations [19].

Prior work establishes each difficulty separately. Systematic concurrency testing controls schedules to expose and reproduce order-dependent failures [34, 39], while stateful REST API fuzzing constructs dependent request sequences to reach deeper service states and documents the rapid growth of the sequence space [6, 35]. We connect these difficulties through semantic reachability: a failure remains hidden when testing loses either the valid state-building prefix or the failure-inducing ordering of otherwise valid operations.

Authors' Contact Information: Yeshayahu Weiss, Faculty of Computer and Information Science, Ben-Gurion University of the Negev, Be'er Sheva, Israel, weissye@post.bgu.ac.il; Achiya Elyasaf, Faculty of Computer and Information Science, Ben-Gurion University of the Negev, Be'er Sheva, Israel, achiya@bgu.ac.il; Gera Weiss, Faculty of Computer and Information Science, Ben-Gurion University of the Negev, Be'er Sheva, Israel, geraw@bgu.ac.il.

In this paper, we use the term business-logic race condition to denote an externally observable application-level semantic violation whose manifestation depends on the relative timing or interleaving of valid operations across concurrent actors or sessions. This notion is intentionally broader than a code-level data race. A business-logic race condition can be observed as incorrect application behavior without determining whether the internal cause is a shared-memory race, transaction ordering, stale state, synchronization, caching, or another implementation mechanism. This black-box perspective is important for distributed and web systems, where the tester often observes only externally visible operations and outcomes.

Existing automated testing techniques address important parts of this problem. Stateful API fuzzers construct multi-request tests by exploiting interface dependencies, search objectives, or execution feedback, substantially extending testing beyond isolated requests [5, 6, 32, 41]. Other black-box approaches enrich schema-driven generation with explicit dependencies, constraints, or generic behavioral properties [30, 36]. However, preserving a difficult business-level prefix may require domain-specific information that is not explicit in the interface schema alone, such as which entity created earlier must be reused later, which relationship between entities must remain valid, which state transition is admissible, or which business invariant determines failure. Similarly, exposing a business-logic race condition may require exploring the relative scheduling of meaningful operations across multiple actors rather than generating another valid request sequence.

We address these challenges through story-based semantic fuzzing, a methodology for transforming business-level behavioral stories into an executable search space of semantically admissible compositions [25, 27]. The methodology separates behavioral intent from system interaction, preserves entities and relations through shared semantic context and binding, constrains compositions to legal executions, and evaluates outcomes with business-level oracles. It explores this space in two complementary ways: composing stories into long, state-building prefixes and varying the relative order and overlap of concurrently active stories.

Provengo [8] operationalizes the methodology by providing the Behavioral Programming runtime for composing executable stories and constraints, while API and Selenium bindings connect high-level events to the SUT. The methodology supplies the scenario-construction rules, semantic context and binding, constraints, and class-specific oracles that determine which compositions preserve business meaning. Within the resulting model, semantic binding preserves state-building prefixes, while the BP scheduler generates admissible interleavings by repeatedly selecting requested events that are not blocked. Provengo's sampling and ranking facilities support practical selection from this space for execution against the SUT, while targeted replay amplifies observed failure-prone schedules. The resulting search object—an admissible story composition—therefore supports both dimensions evaluated in this paper.

These capabilities correspond to two axes of the verification problem. The interleaving axis concerns the relative ordering and overlap of operations across actors or sessions. In Magento, for example, overlapping cart updates and checkout activity across sessions can expose business-logic race conditions that occur only under particular schedules. Once such a failure is observed, overlap-aware ranking and replay can prioritize schedules that exhibit the failure characteristics and increase the probability of its reproduction. The depth axis concerns long semantically valid prefixes. In stateful REST APIs, reaching a target operation may require creating the correct entities, preserving relationships among them, and carrying the resulting identifiers through several dependent requests before a business invariant can even be exercised. Story-based semantic guidance makes these relationships explicit and allows generated executions to remain semantically admissible as they explore deeper states. Thus, the two axes involve different manifestations of the same underlying challenge: preserving the semantic conditions that make a difficult failure reachable.

To evaluate how story-based semantic fuzzing addresses these two dimensions, we organize the study around three research questions:

  • RQ1 (The Interleaving Axis): Can story-based semantic fuzzing characterize schedule sensitivity in multi-session business-logic failures through controlled ordering, and, for sporadic manifestations, can overlap-aware ranking amplify reproduction relative to unguided replay?
  • RQ2 (The Depth Axis): To what extent does automatic, parameterized scenario construction preserve the long, valid prefixes required to expose deep business-logic faults? We evaluate its effect through Basic and Complex profiles generated from the same frozen OpenAPI by the same pipeline, and assess external relevance against schema-driven black-box API fuzzers under a shared sequence-local evaluation contract.
  • RQ3 (Cross-Axis Mechanism): How does a common representation based on semantically admissible story compositions support both long-prefix reachability and interleaving-sensitive failure reproduction, and which mechanisms account for the observed effects?

This paper makes three contributions. First, we introduce story-based semantic fuzzing, a methodology that transforms behavioral requirements into executable spaces of admissible story compositions for exploring long state-building prefixes and cross-session interleavings. Second, we evaluate both dimensions. On Magento, selected schedules increased reproduction of the sporadic Shipping Fee race from 3.6% to 41.2%, while a separate Empty Cart intervention assessed ordering sensitivity. Across four REST APIs, automatically generated Basic and Complex profiles of the same pipeline confirmed 0/11 and 11/11 semantic fault classes from the same frozen public inputs, isolating the contribution of parameterized composition richness. Common-task comparisons with RESTler and EvoMaster assess external schema-driven methods under shared contracts, SUTs, and sequence-local confirmation rules. Third, we provide a reproducible artifact containing both SBT profiles, frozen inputs, generator provenance, retained executions, generated tests, sequence-local evaluators, canonical evidence, and replay and analysis scripts.

References (24)