marcinklimek's avatar
17 days ago
Status:
New

Mock Enhancer – Making API Testing More Realistic [SmartBear MCP Hackathon]

Our team recently worked on a prototype called Mock Enhancer, built during the SmartBear hackathon. The idea came from a simple but persistent challenge: VirtServer mocks are great for simulating APIs, but too often the data they return is too perfect, too static, too predictable, and not quite reflective of what happens in real-world systems.

The Problem

When testing integrations or UI flows against a mocked API, teams usually get the same small set of example responses. That’s fine for basic validation, but it doesn’t simulate the messier, more varied data we see in production. With only minimal examples in the SwaggerHub VirtServers, testers can’t fully exercise the edge cases, and developers can’t validate how their apps behave with diverse inputs.

This gap limits how far mocks can go in helping teams prepare for real-world conditions.

The Idea

That’s where Mock Enhancer comes in. The concept was to use the SmartBear MCP server to automatically expand the number and diversity of examples in an existing API spec.

The prototype worked like this:

We used the MCP to fetch the mcp_hackaton_mock_enhancer API from the SmartBear organization. Then, for the endpoint findByStatus, we generated 20 new example responses using the available status values and appended them to a new OpenAPI file. The result was a richer spec, one that could power VirtServer with a broader, more realistic dataset for testing.

In other words, the tool “enhances” mocks, making them feel much closer to production behavior while keeping the convenience of local, isolated testing.

The Prototype

This is still very much an early prototype, built to test the idea and validate its potential. It’s not production-ready yet, but the proof of concept worked: we were able to automatically generate and save a new YAML spec with enriched example data.

From here, the next steps would be:

  • Adding configuration options (e.g., how many examples to generate, value ranges, data variety).
  • Extending support to more endpoints beyond a single path.
  • Automating the upload of the enriched spec back to SwaggerHub.

Why It Matters

Testing against richer, more dynamic mock data improves coverage, highlights edge cases earlier, and builds confidence before a single line of backend code is deployed. It also saves time. No one has to manually write out dozens of example payloads.

In the long run, tools like Mock Enhancer could make VirtServer even more valuable for teams looking to move faster without compromising realism in their test environments. For now, Mock Enhancer remains a working prototype from the hackathon, but we’re excited about where it could go.

If your team relies on mocks for testing, we’d love your feedback. How valuable would richer example datasets be for your workflows? What kinds of variation would help you test better?

No CommentsBe the first to comment