QA Interview Hub · Knowledge base · Quizzes · Українська

QA Fundamentals › Testing basics

What test levels are there?

The test levels are component (unit), integration, system and acceptance: each covers a larger part of the system and looks for its own class of defects. Developers write unit tests, integration tests check how components interact, system tests check the whole system against requirements, and acceptance tests judge readiness for the business. A defect is sought at the lowest level where it is visible, as higher levels cost more.

QA Fundamentals · Testing basics

The discount is calculated correctly, yet the cart does not show it. Which level should have caught this?

The discount function has unit tests and they pass. The cart was tested too. Yet a user in production sees the full price: the cart module called the calculation with the wrong amount format. Neither test set was wrong, the error lived at the seam. Test levels exist so that each class of error is searched where it is cheapest. The lesson covers the four levels, what each looks at and why one "big test" does not replace them.

How it works

A test level is a group of activities that are organised and managed together and relate to one scope of the system. The scope grows from part to whole:

Levels by scope

Componentfunction, classIntegrationmodules, API, DBSystemwhole systemAcceptancereadiness
Figure 1. The four levels usually named in interviews. ISTQB CTFL 4.0 describes five: component, component integration, system, system integration and acceptance.
  • Component (unit) checks a single function or class, usually in isolation with dependencies replaced. Developers write it. It is fast and points exactly at the place of failure.
  • Integration checks interaction: module with module, service with database, API with a queue. In ISTQB CTFL 4.0 these are two separate levels: component integration (interaction of components inside the system) and system integration (interfaces with external systems and services), which comes after system testing.
  • System checks the system as a whole against requirements: end-to-end scenarios, non-functional properties. The main zone of a QA Engineer.
  • Acceptance answers whether the product is ready for the business or the customer: UAT, operational, contractual and regulatory acceptance, alpha and beta.

Why there are several levels. An error in a function gives a clear red test in a second, an error at a seam needs two parts of the system, and an error in a business process shows only on the whole. The higher the level, the slower, costlier and harder it is to find the cause of a failure. So lower levels should find most defects, and higher ones only what is visible only there.

Example: payment with a promo code on every level

LevelWhat is checked in the scenarioTypical performer
ComponentThe discount function: 1000 with a 10% code gives 900, zero amount and negative percentage are handled.Developer
IntegrationThe cart calls the discount API with the right amount format and the result is stored in the order database.Developer, QA Engineer
SystemFrom the catalogue to payment in the UI: the code is entered, the discount shows in the total, the order is created.QA Engineer
AcceptanceThe business checks that the discount rules match the campaign and accepts the feature.Business, customer

The mismatch from the start of the lesson is found by integration testing: that is where the amount format between the cart and the discount service is checked. A system test could also see it, but diagnosis would take longer.

The test pyramid

E2EfewAPI, integrationmoreUnitthe most, fast and cheap
Figure 2. The pyramid is about the balance of automation: the higher, the slower, costlier and more brittle, so there are few such tests.

Limits and alternatives

  • A level answers "where", while a type of testing (functional, performance, security) answers "what". Different types can run on each level: a unit test is functional, while load is usually measured at the system level.
  • The pyramid is a guide, not a law. For UI-heavy products a "trophy" with a larger share of integration tests is sometimes recommended. The principle is the same: most checks should sit where they are cheap and precise.
  • Levels are not always clearly separated: in microservices the difference between integration and system depends on what you call the system. Agree on terms in the team.

Common mistakes

  • Relying only on e2e. Tests are slow and flaky, and a failure does not show the cause. This is the "inverted pyramid".
  • Assuming developers' unit tests replace system tests. They do not see errors at seams and in scenarios.
  • Confusing system and acceptance. System checks requirements, acceptance answers whether the product is ready for the business.
  • Duplicating checks on every level. What a unit test covers is not repeated by a dozen e2e tests: that only costs more.

Check yourself

The orders service stores the amount in cents, while the payments service expects hryvnias. Unit tests of both services are green. At which level is this found and why not earlier?

Answer

At integration level. Each unit test checks its own part in isolation, with its own assumptions about the format. The mismatch is visible only where the services really exchange data.

How does system testing differ from acceptance testing?

Answer

System testing checks the whole system against requirements and is run by the team. Acceptance testing answers whether the product is ready for the business or the customer: UAT, operational readiness, contractual or regulatory compliance. Its goal is a decision to accept, not finding every defect.

In an interview. Junior: The levels are component, integration, system and acceptance testing. Developers write unit tests, integration testing checks how components interact, system testing checks the whole system against requirements, and acceptance testing answers whether the product is ready for the business. Middle/Senior: A level answers "where" and a type answers "what". The pyramid says there should be more checks where they are fast and precise: many unit, fewer integration, few e2e. I look for each class of defect at the lowest level where it is visible instead of duplicating checks on top. Example: an amount format mismatch between the cart and the discount service is found by an integration test.

More articles in this chapter