The V-model
Last updated
Fold the Waterfall in half and you get a V: the phases that define the software go down one side, and the tests that check each one come back up the other. The V-model's big idea is that every test is planned when its matching phase is written, not at the end. In this lesson you'll pair each phase with its test, and see where the V is still used.
By the end of this lesson you can
- Draw the V-model and pair each phase with the test level that checks it
- Explain why planning tests early catches mistakes sooner
- Say where the V-model is used today
Fold the Waterfall
Take the Waterfall's steps and bend them at the bottom. The phases that define the software go down the left; the tests that check it come up the right, each level facing the phase it checks:
Read it across. Acceptance tests check that the user requirements were met: is it what the users need? System tests check the whole system against its specification. Integration tests check that the parts in the architecture work together. Unit tests check each module on its own. The left side is verification's "what we wrote down"; the top of the right side reaches validation (lesson 1.3).
Plan the test when you write the phase
The V's most useful idea is on the dashed arrows. Each test is planned when its left-hand phase is written, even though it runs much later:
- Writing the user requirements? Write the acceptance tests now, with the users. If you can't say how you'd check a requirement, it's not clear enough yet.
- Designing the architecture? Plan the integration tests now. If you can't say how two parts will be tested together, the boundary between them isn't clear.
This finds mistakes in the documents themselves, long before any code exists. The V is still a single pass, though: the code comes once, at the bottom, and the tests run on the way up. A requirement that was wrong is still found late, at acceptance. Planning the tests early makes that much less likely.
As a UML activity diagram, the V is two lines of work joined across the middle. Walk down and up it:
Press Walk through it to follow the work round the chart, one stop at a time.
- Down the left: user requirements, system specification, architecture, module design.
- At the bottom: code.
- Up the right: unit tests, integration tests, system tests, acceptance tests.
- Dashed arrows, UML dependencies marked «trace», join each test level to the level it checks, planned when that level is written: acceptance tests to requirements, system tests to the specification, integration tests to the architecture, unit tests to module design.
Place eight tests
Which level does each test belong to?
0 of 8 placed right
Ate Cora runs a real Monday morning with the new system and says whether it does the job.
Check that the function that works out a patient’s place in the queue gives 3 when two people are ahead.
Check that when the queue module calls the text-message service, the message really arrives.
Check that the whole system handles 300 patients taking numbers in ten minutes.
Check that the date-formatting function prints “Lunes, 3 Marso” for a Monday.
A senior with a basic phone tries to get a priority number, watched by the barangay’s representative.
Check that the waiting-room screen shows the same number the database says is next.
Check every requirement in the specification, end to end, on a copy of the real setup.
Where the V is used
The V-model is common where software must be shown, step by step, to meet its requirements: medical devices, cars, railways, aircraft and defence. Regulators there want evidence that every requirement was tested, and the V's pairs give exactly that trail (lesson 1.7's "traced line by line").
Its four test levels outlived the model itself. Teams that work in short iterations (lesson 2.4 onwards) still write unit, integration, system and acceptance tests, and the testing profession's standard syllabus, from the ISTQB, still teaches them. Lesson 6.4 returns to them.
Spot the trap: acceptance tests written last
It’s June and the code is finished. Rina starts writing the acceptance tests, reading the requirements from March for the first time in months.
What happens if…
Check what you learned
Sources
Every claim on this page comes from these sources: the standard, the founding text of a method, a study, or the official record of a project, from the body that publishes it. Industry reports are labelled as such.
- ISTQB Glossary: V-model, test level, acceptance testing, integration testing: the testing profession’s definitions of the V-model and its test levels
- IEEE 1012, Standard for System, Software, and Hardware Verification and Validation: verification and validation activities matched to each life-cycle phase
- ISO/IEC/IEEE 12207:2017, Software life cycle processes: verification, integration and validation processes