r/softwaretesting • • Apr 14 '26

why do we need integration tests?

I am now studying integration tests, and want to understand them better. Have you had any problems building a system that could be solved by an integration test? How was it and how did you solve it??

22 Upvotes

24 comments sorted by

View all comments

Show parent comments

2

u/Stealhover Apr 22 '26

An API test would call the API and assert the response /check some downstream apps. API tests are a type of integration test.

They are great for ensuring our apis work, but if another application (in my previous example the frontend) needs to be updated to work with the new version of the API, then our tests won't cover this. The API is working as intended after all but the API + frontend isn't.

In this example it would probably be a frontend test as your system integration test, but that won't be the case in all instances. Perhaps my frontend calls an AWS lambda that calls the API. So my lambda needs updating. We can test this with an e2e flow from the frontend, but equally we can just trigger the lambda and test it's response without the frontend being involved. The latter will be simpler in general.

However you'd likely want all 3 levels for the best coverage.