Dataset links real user stories to actual code changes
STORY2DIFF: A Dataset Linking Real-World User Stories to Code Changes
Software Engineering
Summary
Understanding how written requirements turn into working code is hard because existing examples often use made-up or isolated texts. The authors created a dataset called STORY2DIFF that connects nearly 8,000 real user stories to the exact code changes that fulfilled them, taken from public Java and Python projects. Each entry shows the user story, related code changes, and file differences before and after the update. This resource helps developers and tools better understand how requirements relate to code.
What this means in practice
- •For software developers: Identify and trace real user requirements directly to their implemented code changes for better project understanding.
- •For software project managers: Estimate the impact of proposed changes by reviewing actual code modifications tied to user stories.
Authors
Benedetta Donato, Daniele Franchini, Alessandro Greco, Oliviero Riganelli, Daniela Micucci, Leonardo Mariani
Abstract
Research on requirements-to-code tasks needs examples in which a genuine requirement is paired with the change that implemented it. Existing user-story collections, however, largely contain isolated or synthetic text. To address this limitation, we present STORY2DIFF, a dataset of 7,785 English user stories linked to merged pull requests from January 2017 to July 2026. The dataset is mined from a set of 982 public Java and Python repositories. Each record in the dataset combines the original issue, extracted Connextra elements, the associated pull request and commit metadata, a file-level diff capturing the code changes introduced by the associated pull request, and the affected files before and after the change. The tool we built to mine STORY2DIFF can be used to repeat the automatic extraction of the records, using different parameters (e.g., a different timeframe). The dataset can support a variety of tasks, including requirement discovery, traceability, change- impact estimation, and requirements-aware code generation. Dataset: https://github.com/riganelli/user-story-mining-pipeline/ releases/tag/V4.0.1. Video: https://youtu.be/qOhXUeyeiTQ.