The Mobile Test Pyramid

Anyone who is involved in software testing and software test automation should know the test automation pyramid introduced by Mike Cohn.

As you can see in the following image, the typical pyramid consists of three layers. At the bottom, there is the automated unit-testing layer, in the middle the automated integration testing layer and at the top there is the automated end-to-end testing layer (including the user interface tests). Each layer has a different size, indicating the number of tests that should be written within each stage. Manual testing is not part of the test pyramid, hence it is shown as a cloud for additional testing work.

typical pyramid

Typical Mobile Testing Pyramid

But this pyramid is not applicable to mobile apps and mobile test automation.
Mobile testing requires a totally different set of testing activities like movement, sensors, different devices and networks compared to other software like desktop or web applications. Lots of manual testing is required to be sure that a mobile app is working as expected in the different usage scenarios.

Mobile test automation tools are not currently as mature as their counterparts for web and desktop applications, which leads to a flipped test automation pyramid. As the tools become increasingly mature, this pyramid is likely to flip back again because the default test automation pyramid is based on a more stable foundation (see the pyramid image below).

The default pyramid therefore can’t be used as an indicator for test automation and manual testing in the mobile world.

The flipped testing pyramid looks like this:

flipped pyramid

Flipped Mobile Testing Pyramid

In this version of the pyramid, the automated unit testing layer is the smallest one. This is the case because not every unit or method of mobile apps can be tested in an isolated manner. In some cases, different APIs, layers or systems may need to be faked or mocked in order to get the small unit to work. This is also the case for every other software application, but in some cases mocking or faking other systems for mobile apps is much more complex. This is not efficient from a technical or economic point of view. However, it’s no excuse for not writing mobile unit tests at all. The business logic of an app must be tested at unit level.

The next stage is the end-to-end test automation layer. Within this layer, the whole app is tested from a user perspective. It will be tested to make sure the whole system is working, from the app’s user interface through to the backend system via a wireless network, including integration testing with different libraries or APIs. The integration testing layer is therefore part of the end-to-end layer.

The biggest change in this pyramid is that manual testing is part of it. Mobile testing requires lots of manual testing, and this can’t yet be replaced by test automation or any other tools.

Nevertheless, mobile test automation is a really important topic and every mobile tester should be able to write automated regression tests that provide fast feedback about the current quality state of an app. Furthermore, test automation helps the team build a reliable and robust mobile app that makes the customers happy.

The Mobile Test Pyramid

The flipped testing pyramid has no stable foundation and mobile testing requires lots of manual testing, which is why I created my own mobile test pyramid consisting of four layers including manual and automated steps. The biggest layer of the pyramid is manual testing and forms the strong foundation for every mobile app project, followed by end-to-end testing, beta testing and a top layer comprising unit testing. The grey parts of the pyramid indicate the automated steps and the white parts are the manual testing steps. The beta-testing layer is new to the pyramid but essential to every mobile app project. Keeping the high expectations of the mobile users in mind requires this layer to be part of every mobile project to get early feedback from your mobile customers. You can either use a crowd testing approach for your beta testing or you can ask your colleagues to beta test early versions of your app to provide important feedback.

mobile testing pyramid

Mobile Testing Pyramid

Keep the problem with the flipped pyramid in mind and use the mobile test pyramid in your project to have a good mix of manual and automated testing. I’ve used the pyramid in several projects and it has helped me set up a reliable, effective and valuable testing process.

About the author

Daniel Knott has been working in the field of software development and software testing since 2003. He started his career as a trainee at IBM where he was involved in enterprise software development and testing. After his time at IBM, Daniel studied computer science at the University of Applied Sciences in Wiesbaden, Germany. Software testing soon became a passion during his time at university and the reason why he chose a career in software testing. Daniel has worked at several companies in various different industries where he was responsible for testing web, desktop and mobile applications. During a number of projects he developed fully automated testing frameworks for Android, iOS and web applications.

Daniel is a well-known mobile expert, speaker at various conferences in Europe, and a blog author. Furthermore, Daniel is the founder and organizer of a local software testing user group in central Germany. If you want to learn more about mobile testing please have a look at his book, Hands-On Mobile App Testing, or get in touch via LinkedIn, Xing, Twitter or email.

You might be interested in... The Dojo

Dojo Adverts-05

Tags: ,

3 Responses to “The Mobile Test Pyramid”

  1. Amy PhillipsNovember 5, 2014 at 4:46 pm #

    I think you make a good point that we should consider mobile testing to be distinctly different from desktop or web testing and alter our approach accordingly.

    However I’m not sure the test pyramid is the best explanation of your point. I find it strange to represent something that you assign a numerical value to (number of test cases that we should have at each level) on a sizeless graphic. The pyramid appears to say that if I have 20 Integration test cases then I should only have 10 E2E test cases when in fact they probably share very little relationship to one another.

    A more useful measure would be to focus our testing depending on the time we have available. If I have 5 weeks for mobile testing wouldn’t it be easier and more useful to say that I will spend 1 week on unit tests, 2 weeks on E2E test and 3 weeks on manual testing?

    Every test should be applied at the most useful level and at the correct time. We should definitely be applying mobile specific testing to mobile apps and sites. If we do both of these things then I don’t think it will really matter if our tests can be considered as a stable pyramid or not.

  2. Daniel KnottNovember 5, 2014 at 6:26 pm #

    Hi Amy,

    thanks for your comment. It was never my intention to put numbers to each stage of the testing pyramid and I don’t like that :). Every project is different in the amount of features and the time a project must be finished. I totally agree with you to focus on the time we have to test an application and to choose the right levels and steps to test the software.

    I used the pyramid to visualize that manual testing must be part of mobile projects, because lots of mobile test automation tools are not yet mature enough compared to web testing tools to cover all important parts.
    I made also the experience that a lot of companies focus always just on test automation rather to have also a focus on manual testing.

    That was the reason why I created the mobile test pyramid aligned to the traditional one and to mix it with manual and automated testing for mobile projects :). I want to show that mobile apps require lots of manual testing and I thought a pyramid is a good symbol to do that and by the way I like pyramids :).

    Have a great day.


  3. Lalitha YennaJuly 14, 2016 at 6:19 am #

    Very nice article Daniel. When I started out as Mobile tester, I had this slight confusion about not going by the testing pyramid, but the nature of mobile testing is manual focused.

    Could you please explain at what level E2E tests should be covered as part of mobile testing. Sometimes it gets complicated as we need to use more than one app to complete a flow. Can you please outline at which point we need to draw a line?