← Latest papers
💻 computer science

Systematic API Testing Through Model Checking and Executable Contracts

This paper introduces IcePick, a framework that combines TLA+ model checking with a new executable contract language called Glacier to systematically generate stateful API test sequences that achieve provable behavioral coverage and overcome the limitations of traditional black-box testing.

Original authors: Ana Ribeiro, Margarida Mamede, Carla Ferreira

Published 2026-04-13
📖 5 min read🧠 Deep dive

Original authors: Ana Ribeiro, Margarida Mamede, Carla Ferreira

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 the manager of a massive, automated theme park. This park is made up of hundreds of tiny, interconnected booths (APIs) that sell tickets, assign seats, and manage rides. You want to make sure every booth works perfectly, not just when you press a button, but when you press them in a specific order, like buying a ticket before trying to enter a ride.

The problem? The blueprints (the API specifications) only tell you what the buttons do, not how the booths react to each other. They don't tell you if the ticket booth remembers you bought a ticket, or if the ride booth knows you're still in line. This makes testing incredibly hard because you don't know what a "correct" result looks like.

This paper introduces ICEPICK, a new tool that acts like a super-smart, paranoid tour guide to test these systems. Here is how it works, broken down into simple concepts:

1. The Problem: The "Black Box" Mystery

Most automated testing tools are like blindfolded people throwing darts at a board. They guess what to click and hope for the best. If the system says "200 OK" (Success), they assume it worked. But what if the system is lying? What if it says "Success" but actually deleted the wrong user?

Current tools struggle because they lack context. They don't understand the story of the system.

2. The Solution: ICEPICK (The Tour Guide)

ICEPICK changes the game by using two main tricks: Model Checking (the map) and Executable Contracts (the rulebook).

Step A: Drawing the Map (Model Checking)

Instead of guessing, ICEPICK first builds a perfect, mathematical map of the theme park. It uses a language called TLA+ to create a simplified model of how the system should behave.

  • The Analogy: Imagine drawing a map of every possible path through the park. It shows every room you can enter and every door you can open.
  • The Magic: It uses a tool called TLC to walk through every single possible path on this map. It doesn't just guess; it exhaustively checks every combination to see which paths are valid. This ensures no stone is left unturned.

Step B: Writing the Rulebook (GLACIER)

The map tells you where you can go, but not what you should see when you get there. That's where GLACIER comes in.

  • The Analogy: Think of GLACIER as a set of strict rules written in plain logic. For example: "If you delete a ticket, the gate must be empty." or "If you buy a ticket, your name must appear on the list."
  • The Innovation: Usually, these rules are hard to write. ICEPICK automatically writes most of them by looking at the standard blueprints (OpenAPI specs) and inferring common sense rules (like "you can't delete something that doesn't exist"). If a rule is too complex, a human can add it manually.

3. The Execution: The Test Run

Once the map and the rulebook are ready, ICEPICK starts the actual testing:

  1. It generates a list of trips: It looks at the map and creates a list of the shortest, most efficient routes to visit every corner of the park.
  2. It walks the path: It sends real requests to the actual theme park (the software) following these routes.
  3. It checks the rules: After every step, it checks the GLACIER rulebook.
    • Did the ticket booth actually add your name to the list?
    • Is the gate still locked after you tried to break in?
    • Did the system return the right error message when you tried to do something impossible?

If the system breaks a rule, ICEPICK doesn't just say "Error." It says, "You tried to delete a ticket that didn't exist, and the system said 'Success,' which is a lie!"

4. Why This Matters

  • Finding Hidden Bugs: Standard tools might miss a bug where deleting a user doesn't actually remove them from a group. ICEPICK finds this because it tracks the state (the memory) of the system.
  • No More Guessing: It doesn't rely on "maybe it worked." It relies on mathematical proof that the system followed the rules.
  • Scalability: The authors tested this on real-world systems. They found that while the map can get huge (like a maze with millions of rooms), their method is smart enough to handle it, provided the system follows standard design rules.

The Catch (The "But...")

The paper admits that ICEPICK is like a high-performance sports car: it needs a smooth road to drive on.

  • The Road Condition: The system being tested must follow standard "REST" rules (like a well-organized theme park). If the system is messy, uses weird naming conventions, or lies about its status codes, ICEPICK can't build its map, and the test fails before it starts.
  • The Effort: You still need to translate the messy real world into the clean mathematical map (TLA+). While the tool helps automate this, it still requires some human effort to get the model right.

Summary

ICEPICK is a framework that stops guessing how software behaves. Instead, it:

  1. Draws a perfect map of how the software should work.
  2. Writes a strict rulebook for what success looks like.
  3. Walks every possible path on the map to find where the real software breaks the rules.

It's the difference between a blindfolded dart thrower and a detective with a complete blueprint and a magnifying glass, ensuring that every single interaction in your software is safe, correct, and honest.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →