The testing pyramid is an idea that’s commonly used across the software industry. It’s based on the principle that there should be more tests at low level – unit tests – forming the base of the pyramid and fewer at high level – user interface tests – forming the apex, with service or integration tests falling in between.
The pyramid lends itself to automation of testing as the lower level functions can be tested without the need to access them through the user interface. This means they can be completed using a testing program, whereas UI tests will require human input and will therefore be costlier and more time-consuming. However, in some scenarios, the pyramid model won’t necessarily deliver the level of testing required at all points.
Missing the point
Treating the pyramid testing model as a hard and fast rule, though, is not a good idea. Just because the model assumes you need less testing of the user interface, it doesn’t necessarily mean that’s the case. With an increasing shift towards mobile applications, for example, there’s more emphasis on the functionality and reliability of the UI.
It would be unwise for a mobile software testing company like https://www.bugfinders.com/true-crowdsourced-testing/ to focus on unit and service tests at the expense of the UI. In a mobile scenario, the testing model is more likely to have a flatter top, becoming a ziggurat or even a rectangle, where all the layers are even, rather than a pyramid.
Much modern development actually doesn’t have a user interface at all, such as APIs or services to feed information to other applications, for example. In these instances, we lose the top layer of the pyramid.
There will be more focus on unit and service tests, but with the integration of services at the heart of things. This will need to invert the conventional pyramid structure, with more focus on service tests and less on unit tests. Again, testing can benefit from automation at either layer, adding efficiency and reducing the risk that fixing one bug will lead to another.
The testing pyramid is still a valuable starting point for software testing, but in the modern environment of Agile development and fast changing mobile apps, it shouldn’t be seen as the only way of getting the job done.