Skip to content
Moamen Elmasry
FREN
Your path · 0 of 29 skills
Back to the course

Module 01 · Testing basics · 10 min

The right level for each test

Component, integration, system: test each behaviour at the lowest level that can prove it, and know which behaviours none of them can prove.


Review

From the previous lesson: the rule accepts 20 to 2,000 characters. Which lengths does a boundary test try, and why is testing 500 not enough?

Three levels

Level Proves What the test touches
Component (unit) One unit's logic: a calculation, a validation, a mapping A function or a module, in memory, everything around it replaced
Integration Two real parts agree: ClaimTriage and the claims system, the code and its database The seam between two named parts
System The assembled product meets the criterion end to end The deployed product, through its real screen, API or sign-in

The rule: test each behaviour at the lowest level that can prove it. Going higher only when the behaviour does not exist lower down.

A component test runs in a few milliseconds and tells the developer exactly which function is wrong. A system test takes seconds or minutes, needs an environment and data, and when it fails, the cause can be anywhere. Testing the routing table through the screen proves nothing a component test would not, ten thousand times slower.

To place a behaviour, ask in this order, and stop at the first yes:

  1. Can the unit's code alone decide it, with its inputs controlled? Component.
  2. Does it depend on how two real parts agree (a schema, a protocol, a failure on one side)? Integration, on that seam only.
  3. Does it only exist once the product is assembled and deployed (single sign-on, permissions enforced by the platform, a user journey)? System.

What is not a level

User acceptance testing is not a fourth level. It is a decision by the business that the product does the job, taken by the people who will use it. It comes on top of the three levels, not instead of one.

Some behaviours no level proves. ClaimTriage's two-sentence summary has many acceptable phrasings: no assertion can compare it with one expected sentence. That is the subject of part 2 of this course. Recognising it now matters, because the classic mistake is to test it anyway with an exact comparison, and to fail every good answer that is worded differently.

Six behaviours

At which level is each behaviour proven?
L1 · the routing function returns queue-A for every critical claim
L2 · the card sent matches the claims system's published schema
L3 · an agent without the motor entitlement, signed in through single sign-on, cannot open a motor claim
L4 · the description rule rejects 19 characters and accepts 20
L5 · when the claims system is down, the card is resent later and never lost
L6 · the two-sentence summary keeps the facts the queue owner needs

A developer tests the length rule at component level, and the tester adds the same four lengths through the screen "to be sure". What does the second set prove?