PICKLES: a Natural Language Framework for Requirement Specification and Model-Based Testing
This paper introduces PICKLES, a natural language framework that bridges Behaviour-Driven Development and Model-Based Testing by translating human-readable scenarios into formal models to enable automatic test generation with significantly higher coverage than standard BDD.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to teach a robot how to drive a car. You have two main ways to do this:
- The "Strict Engineer" Way (Model-Based Testing): You write a complex mathematical blueprint of every possible road, weather condition, and traffic light. It's incredibly precise and covers every scenario, but only a mathematician can read it. If you want to show the boss what the robot will do, you have to translate the math back into English, which is hard and prone to errors.
- The "Storyteller" Way (Behavior-Driven Development): You write a story: "Given the car is on the road, When the light turns red, Then the car stops." Everyone understands this. It's easy to write and read, but it's like writing a recipe for just one specific day. If you want to test every possible traffic light timing, you have to write thousands of separate stories, which becomes a messy, unmanageable pile of paper.
The Problem:
In the real world, companies want the precision of the "Strict Engineer" but the readability of the "Storyteller." Usually, they have to pick one or the other. If they pick the story, they miss hidden bugs. If they pick the math, nobody understands the tests.
The Solution: PICKLES
The authors of this paper created a new framework called PICKLES (Precise Input and Control-flow Keyword-based Language for tEst Scenarios). Think of PICKLES as a "Universal Translator" that bridges the gap between stories and math.
Here is how it works, using a simple analogy:
1. The "Smart Recipe" (The Language)
Instead of writing a story about one specific car stopping at one specific red light, PICKLES lets you write a "Smart Recipe."
- Old Way: "The car stops at the red light on Main Street." (Too specific).
- PICKLES Way: "The car stops at any red light, provided the light is red and the car is moving."
- The Magic: You can define rules like "The light can be any color from Red to Green" or "The car can be any speed between 0 and 100." This is called parametrization. It turns a single story into a rule that covers thousands of possibilities at once.
2. The "Automatic Architect" (The Translation)
Once you write these "Smart Recipes" in plain English (using a format similar to the popular Gherkin language), the PICKLES tool acts as an Automatic Architect.
- It reads your English rules.
- It instantly builds a Formal Model (a complex mathematical map) behind the scenes.
- This map is so detailed that it knows every possible path the system could take, even paths you didn't explicitly write down.
3. The "Master Map" (Combining Stories)
In traditional testing, you test Story A, then Story B, then Story C, separately.
- The Flaw: Story A might work, and Story B might work, but if you do A then B, the system might crash. Traditional stories often miss these "handshake" errors.
- The PICKLES Fix: The tool takes all your separate stories and stitches them together into one giant "Master Map." It figures out how Story A connects to Story B, and how Story B connects to Story C. It creates a complete picture of how the system behaves over time, not just in isolated moments.
4. The "Back-Translation" (Readable Results)
This is the most clever part. The tool uses the Master Map to generate hundreds of specific test cases automatically.
- Usually, these tests would come out as confusing math code.
- PICKLES takes those math results and translates them back into English stories.
- So, the tester gets a report that says: "Here is a specific test where the car was going 50mph and the light turned red at 2.5 seconds. The car stopped correctly."
- The human can read it, understand it, and verify it, even though the heavy lifting was done by the math engine.
The Real-World Test (The Traffic System)
The authors tested this on a real traffic management system used by a company called Technolution.
- The Setup: They took existing stories about traffic sensors detecting broken detectors.
- The Result:
- Using the old "Storyteller" method (running stories one by one), they only tested about 30% of the possible system behaviors.
- Using PICKLES (combining the stories and using the math engine), they achieved 100% coverage of the system's logic.
- They did this without writing hundreds of new stories. They just made the original stories "smarter" by adding variables (like "any lane" or "any position") and let the tool do the rest.
Why This Matters
PICKLES allows non-technical people (like project managers or business analysts) to write requirements in plain English that are unambiguous and mathematically rigorous. It ensures that:
- No one is confused: The requirements are clear to everyone.
- No bugs are hidden: The math engine finds edge cases humans might miss.
- Less work: You write fewer stories to test more scenarios.
In short, PICKLES is like giving a robot a storybook that is smart enough to understand every possible variation of the story, solve the math problems inside it, and then write a clear report back to you in plain English.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.