Why is modular testing isolated dependence?
Is the use of OBD directly from poor tone tests? Or is it a private case of testing when it is not necessary to verify the correctness of adding and removing the data to and from the database?
In modular tests, it's not just bad tone, it's unacceptable.
In good condition, modular testing shall meet all these conditions:
- Each test has to check only one modular behaviour theory
- The test class shall be isolated from any dependents, including the classes with which it works. Moreover, there should be no extra-project relationships, such as databases, time, networking and inter-process interaction. All dependence shall be replaced by manually written or automatically generated plugs.
- The test must never be performed for more than one second. The less time is spent on each test, the better, otherwise the developers will simply be lazy to wait for all the tests in every redesign of the project, and this will give up modular testing over time.
Real dependence cannot be used because of the parallel nature of modular tests. When you have more than one real dependency test in your test project, there will always be conflicts and mistakes of interaction between them.
Say, you have a table in your database. In one test, you remove the lines from it, in the second add, and in the third you get. Yeah, you can put this table back at the end of every test, but in modular tests, you have no guarantee that at the time of receipt of a third test from the table, the first row test will not remove the necessary chaos.
You want to test the living base, living dependence - do it in. integration and/or functional functional functions Tests.
Integration tests - In fact, the same modular tests in which real dependence is used and which are performed not in parallel but in turn in one strict sequence. In contrast to modular tests, their purpose is to test the behaviour of modules in a single system.
They use almost the same tools as modular testing. In projects using IoC-containers, sometimes integration and modular tests have a common test code - when integrated testing creates a test environment (the net system puts the necessary packages/Annexes, alters the necessary designs, deploys databases), IoC-container replaces the plugs with real dependency, followed by tests in order to be consistent.
The most useful integration tests for testing the invisible user of the part of the project(beked).
Functional tests - simulate the actions of a real person working with a programme product.
In this test, the test servers/equipment shall be equipped with a complete, working version of the project that is not different from the one with which users work. Tests upload the project site in the browser or start an application on the PC/mobile devices and, for example, click on the buttons, introduce the text, reset the interface elements, etc.
Thus, the consistency of the external conduct of the application to which the user expects an annex is checked, and the correctness of the conduct (see - is it true that the html-page is displayed in a dozen different browsers on different platforms, and does it work on all the stated functions?)
It is beneficial to use them when a complex and functional user interface(s) is available in the project.