Stop Treating APIs Like UIs Without Buttons
Let’s be honest: Most people are doing API testing wrong.
They treat APIs like they’re just “UI without the buttons.” They take their bloated, fragile E2E mindsets, swap out a Selenium script for a Postman collection or a RestAssured suite, and wonder why they’re still drowning in maintenance and “flaky” results.
If you’re just checking that a 200 OK comes back with the right JSON keys, you aren’t testing the API. You’re just checking if the server is still plugged in. This, to me, is why some people call automation checks rather than tests.
Your API Tests Are Probably Useless Link to heading
Here is the part where people get uncomfortable: An API test that passes 100% of the time in your CI pipeline is often a sign of a bad test suite.
Why? Because most API suites focus on the “Happy Path” to make the dashboard look green. They validate the contract (which a Schema should be doing anyway) rather than the behavior.
We’ve spent years telling people to “shift left” and move away from the UI. But what did we do? We just moved the same bad habits one layer down. We created “Integrated Tests” (as J.B. Rainsberger calls them), tests that require three databases, a mock service, and a prayer to run.
That’s not an API test. That’s a distributed monolith headache.
How to Stop Being “Productively Busy” and Start Being Effective Link to heading
If we want to actually be productive, rather than just writing code that generates reports no one reads, we need to change the approach:
1. Stop Testing the Schema, Start Testing the State If your API documentation says a field is a string, and your test confirms it’s a string, you’ve achieved nothing. A linter or a static type checker could have told you that.
The Fix: Test the side effects. If I POST to /orders, does the stock level actually drop? If I try to refund an order twice, does the system stop me? Test the business logic that lives behind the endpoint, not the shape of the envelope.
2. Embrace the “Negative” (It’s where the bugs live) Happy path testing is for demos. Real engineering is about how things fail.
The Fix: Spend 70% of your time trying to break the API. Send it garbage. Send it SQL injection strings. Send it a payload that’s 10MB too large. If your API doesn’t fail gracefully with a meaningful error code, your “testing” has failed.
3. Kill the “Mega-Suite” We often see teams with 2,000 API tests that take 20 minutes to run. That’s not “fast feedback”; that’s a coffee break.
The Fix: Contract Testing (Pact, etc.) handles the “will these two things talk to each other?” question. Component testing handles the logic. Your “API tests” should be lean, mean, and focused on the integration points that actually matter.
Automation isn’t Scary… but Waste is. Link to heading
The scariest thing in automation isn’t a failing test; it’s a green suite that provides zero confidence.
API testing should be the bedrock of your strategy, but only if you treat the API as a first-class citizen of your architecture, not just a shortcut to avoid using a browser.
Let’s stop clicking “Run” on suites we don’t trust. Let’s start building tests that actually tell us something we didn’t already know.
P.s. I had a great conversation with Kristin Jackvony about this recently on the BrowserStack Podcast.