Everyone knows that whenever you build something, you should check your work once it is done. Software is no different: we are all well aware of the concept of a "bug" and of errors in programs in general. Some have run into them in Windows itself (or macOS), others in various office programs, and still others met the word while playing games, where bumping into an imperfection in the code could end in laughter or anger. Nobody likes bugs, and we would all happily get rid of them in all sorts of applications, even if they are amusing (the bugs, not the applications). Can it be done? Not entirely, but there are techniques that help.
Of course, a computer program is written as code, that is, a sequence of instructions. It is something that can be expressed mathematically, which in turn means there is a theoretical possibility of formally verifying the correctness of such a program. But apart from probably a few cases, this is not done, for a simple reason: it is hard and, from a practical point of view, impossible when applications today are gigantic, asynchronous, split into many components (including microservices) and depend on a multitude of parameters.
That leaves other methods, including static ones (which include, among others, code reviews) and dynamic ones. Among the latter we find testing, which we will discuss briefly today, showing that it does not concern just a single level of software. Along the way, we will also clear up a few concepts.
What is the V-model?
Let's go straight to the hero of today's text, a concept called the V-model. To understand it better, though, we first need to divide tests into manual and automated ones. The former are conceptually quite simple: a person "clicks through" the application, checking various cases by hand and writing down the bugs they notice. Of course, many people will now shout that this makes no sense at all, since everything should be verified automatically. They are partly right: manual tests have big drawbacks, among which the most often mentioned are the time they take, the lack of repeatability and the human factor in the form of a tester who may get tired or miss something. But, contrary to appearances, manual tests still make sense, because while in the long run they take longer than automated ones, they are perfectly suited to a quick one-off check and you can start right away. They also need no preparation on the code side and, on top of that, let you test the application from the perspective of an ordinary user, which is often very important, and we will come back to that.
On the other hand, you cannot deny the advantages of automated tests: they make repeated verification much easier and also (and perhaps above all) allow so-called regression tests, that is, checking whether new changes have broken existing features. There are drawbacks too: they require suitable libraries and coding, and when something is verified only once, they can take more time than manual testing (although we can never predict whether we will come back to verify something again). They are also not as simple for testing the user interface, or at least will not let you verify everything. Still, it is such a useful tool that it cannot be skipped, and it is the foundation of what we are heading toward, the V-model.
If you look through various sources, you will find presentations of this model that differ from each other. Sometimes one level is missing, other times the layout is slightly different, but they all come down to the fact that testing happens at different levels, each of which corresponds to a specific stage of software development. Let's look at them from the bottom, one by one.
What most people associate with programming itself is creating files with code and classes in the object-oriented paradigm, each containing a separate part of the whole program. For example, we may have a file representing some object, an element of business logic, a controller or a helper class. Each one contains some functions or methods that take specific parameters and return a specific result for them (leaving aside randomness). We can expect the quality of the software to depend, among other things, on whether all methods work correctly, so each of them has to be tested. This is done with unit tests, which let you verify each method against various cases, especially edge cases and exceptional ones (those where the developer might have overlooked something or misinterpreted it). These are the tests run most often, and it is hard to do them effectively in any way other than automatically.
Let's return to the point that software quality depends on whether all components behave correctly. Now I will contradict myself, because that is not quite true: it may turn out that all the class methods within a given module work well, but they are not called properly or do not affect each other appropriately (or affect each other far too much). On the web you can find plenty of humorous examples of this situation, often in the form of GIFs:
- First example: closing a door with a lock.
- Second example: opening windows next to each other.
- Third example: an entrance gate.
That is why larger parts of the software architecture, that is, sets of modules or even entire architectures, are checked with integration tests. They work just like unit tests and are also usually automated, but they focus not on methods (where one test covers one case of a method) but rather on whole sequences of events, the consistency of individual objects with each other and the order in which individual elements are called.
Going further, we must remember that the system architecture is built to satisfy functional requirements and nonfunctional requirements. These are covered by system tests (functional) and nonfunctional tests. As the names suggest, they correspond to the individual types of elements implemented in the software. Nonfunctional tests are far more interesting, because they let you verify, for example, performance, load or the security of the system, issues that cannot be examined with simple methods and in every condition. Some of the verification can be done manually (such as certain security points), but it is hard to imagine taking that path for load: we are not going to ask all the students, say, to open the page at the same moment. Fortunately, there are tools such as JMeter or k6 that can help.
The last, highest level is still requirements, but understood a bit more broadly. We are certainly testing functional requirements here, but it is more about the user flow and, along the way, validating whether everything is fine from a "human" point of view. This may be a good moment to stop for a second and explain that verification and validation are two different concepts. The first means checking whether the software works according to the requirements, so you could say whether all the boxes are ticked and everything adds up "mathematically". Validation, on the other hand, is a "test" of whether, besides being implemented correctly, everything works the way the client expects and meets their requirements, sometimes unspoken earlier. What good is it that the system can add a product to a cart, display that cart and order the product, if none of these functions is easy to reach and together they do not form a scenario that practically imposes itself on a user on the page? You could say it is a repeat of the code: every requirement may be implemented perfectly, but together they do not make a good system. Checking this is the job of acceptance tests, which are often created very early (even while the requirements are being written) and with the client's involvement. We then most often speak of manual acceptance tests (MATs) or their simpler, less formal form, the Definition of Done items, which serve as a signpost for the developer. And it cannot be denied that here manual tests often prove, if not better, then at least necessary, because of validation and a human assessment of the situation. Still, remember that testing at this level can absolutely be automated, and the most popular (though not the only) tool for that is Selenium, which provides both a graphical interface and an API.
Not all tests are equal
It is worth mentioning a few more concepts that are inseparably linked with testing. I already covered the difference between verification and validation above. Now it is time to introduce the terms black box and white box. The first (the popular "black boxes") are tests that any of us can run: not knowing what is inside, we use the software and see what results it delivers. We do not need to know what the implementation looks like underneath. All that matters is the input and output parameters. "White boxes," in turn, also take the implementation into account: the tester knows how a given method is built and where bigger problems can be expected, so they can focus on verifying them. Both paths have their pros and cons. On one hand, it is sometimes easier to verify without knowing what happens inside the application, and on the other, with that knowledge you can aim the tests better or even spot some gaps with the naked eye.
You should also know that testing does not provide proof that the software works correctly. It strengthens our confidence that it does, but verification based on different test cases inevitably cannot cover every possibility that may occur over the years and, mathematically speaking, cannot verify the whole domain of arguments. Not to mention that under different load or with a new version of the tools on which the user runs the software, various "flaws" and faulty behavior not caused by programming mistakes themselves can also show up. So testing is definitely worth it (in whatever way), but it is not the case that 100% of tests passing proves the software is free of bugs.
It is also worth remembering that you should test as early as possible. That is why we create requirements and prototypes at all, to test certain things at low cost. The later a given bug appears, the more it usually costs to fix, and not only in budget terms but also in nerves. There is no shortage of stress in software development, and it is worth protecting yourself from piling more of it on. And in case any bugs slip through to later work or new proposals appear, it is worth setting up a suitable system.
Who should test?
The question seems silly, because everyone will immediately shout that this is what the Quality Assurance department, popularly QA, is for. But that is only part of the truth. Indeed, IT teams often have testers who relieve developers of the duty of verifying every case and who are impartial. But a few things need to be remembered.
First, not every company has a QA department, if only for budget reasons. Second, testers will not be able to verify programs well if they do not know their requirements and the client's expectations. Third, being a tester is, contrary to appearances, quite hard and above all tedious work that demands attention and an eye for detail. For that reason, people sometimes joke that the QA department should not get along with the developers, so that it hunts for bugs with more fierceness and thereby makes the software better.
All this means you cannot dump everything on testers, and a developer should, to some extent, make sure their code works correctly and handles various cases, even just the basic or likely ones. The first reason is plain human decency. In the past I heard of cases where a coder released software that "seems to work" to them, hoping that someone else would catch the bugs, because they did not feel like testing or claimed they had no time. That is not only bad practice but simply shameful and a lack of respect for other people's work. The second point is that while a developer cannot find everything when "fixated" on their own code, being that close to it is exactly what lets them quickly fix, on the spot, the obvious errors visible after a few runs of the code. Later, getting to the source of a problem will be harder.
The V-model under discussion also shows other levels of testing. For example, acceptance tests are not really technical: they are more of a check of the client's expectations of the system. So they can be run both by people representing the IT team and by the client, who can only in this way find out whether they understand how the system works and whether the software house correctly understood their business context.
Summary
This is merely the tip of the iceberg of software testing, and as I wrote, it is only one of the methods of ensuring application quality. The V-model can take a slightly different shape depending on needs, and there is no need to stick strictly to this division or to cover every level in every project. Still, it serves as a guide that helps approach the verification and validation of the work done.
Best regards and thank you, Jakub Rojek.


