Quality assurance of applications via UI and service-level tests have become an integral part of software projects. While this stage is responsible for catching defects and testing systems against user expectations, its cost makes people seek alternatives.

The problem lies in the low efficiency of high-level tests for quality assurance. Executing a single intricate scenario against a complex system might take hours, if not days. For instance, a process of order fulfillment typically takes a couple of days from order receipt to shipment. Hence, testing this scenario through a service endpoint or a UI interaction is a lengthy process. If a given system has multiple such functions, you may need to allocate a considerable amount of time to testing. This necessity extends the length of a feedback loop, delivery cycles, and perhaps customer wait-time. Therefore, it is essential to find more efficient ways of checking the quality of software solutions.

The above-described issue is the reason why the techniques that target code-level testing are so popular. Tests that developers can run against code are much more efficient than those for high-level quality assurance. For example, while executing a single scenario via UI-targeted tests can take hours, you can run thousands of unit tests in a minute.

You can see this difference in efficiency between the two approaches by looking at a well-known testing pyramid. Unit-testing is at the bottom of the shape due to its speed and granularity. On the contrary, service and UI tests sit on the upper side, as they take longer to run while providing end-to-end feedback.

If you are a developer and want to master code-level testing techniques, you should learn about unit testing, test-driven development (TDD), acceptance of test-driven development (ATDD), and behavior-driven development (BDD). We will talk more about these exercises in the next sections.

Get hands-on with 1200+ tech skills courses.