What Is A Test Automation Pyramid?

Lucia Cavero-Baptista

Automation Expert

A Test Automation Pyramid, or Agile Testing Pyramid, allows us to find the desired balance in testing through a representation of the best possible case for agile software development.

The Agile Testing Pyramid is a concept developed by Mike Cohn in his book Succeeding with Agile. It helps us understand the difference between traditional testing frameworks and testing for agile development. 

Having a clear idea of what a testing pyramid is, and how to execute it, can have a tremendous positive impact on your organization. In this article, we’ll briefly explain the distinction between the different testing pyramids and what tests belong to each level of the pyramids.

Why use a testing pyramid?

A testing pyramid is a visual representation of a testing methodology that can be applied to your QA strategy. It can help you visualize the amount of time your team should be focusing on the different testing categories or groups.

This, in turn, should help you better allocate resources and become more efficient with your QA efforts, and more effective. 

What’s the difference between an Agile Testing Pyramid and a Traditional Testing Pyramid?

Even though both pyramids contain the same layers, these are placed at different levels with varying degrees of involvement. The main three layers or testing categories are:

  • UI Testing
  • Integration Testing
  • Unit Testing

Today, most software organizations suffer from the Traditional Testing Pyramid problem, commonly known as the ‘Inverted Testing Pyramid’. 

Traditional-testing-pyramid

With an Inverted Testing Pyramid, development teams spend most of their time and effort manually checking software within an inefficient framework. Even though some try to add automation here and there, a team can quickly fall into an ‘automation paradox’ - that being when the setup and maintenance of test automation take up more time and resources than what can be saved by automating. 

Test Automation Paradox

On the other hand, the Agile Testing Pyramid, or Test Automation Pyramid, relies more on automation and collaboration between teams. Cohn’s Agile Testing Pyramid attempts to find the perfect balance in testing through a representation of what should be considered the best-case scenario for QA in software development. 

Agile-testing-pyramid

In this scenario, you focus ~70% of your efforts on small and fast low-level unit tests. This will become the foundation of your test suite. Then, an intermediate layer of integration and API tests accounts for ~20%, followed by ~10% of high-level end-to-end UI tests. 

The Agile Testing Pyramid follows the opposite structure from the traditional one, in which there are more low-level unit tests than high-level end-to-end tests running through a UI.

It’s a logical and efficient way to cover different, alternative code paths and test combinations. It is within the unit tests level that we may find problems that successively affect tests on the following layers.

For that reason, the more tests we can do at a unit level through automation, the more efficient the following testing layers will be—the focus shifts from finding bugs to preventing them.

This is not to say that unit tests will prevent all possible bugs. Unit tests are created using developer logic, meaning that a developer writes a piece of code and then he or she verifies that his/her work is functioning as per the requirements. 

On the other hand, end-to-end tests are developed from the perspective of the end-user. They try to imitate all possible interactions of a human with the given software or application. 

What is a Test Automation Pyramid?

In short, an Agile Testing Pyramid and a Test Automation Pyramid are the same. This is because agility and test automation go hand in hand when it comes to testing. 

Test-automation-pyramid

Related reading: How Test Automation Supports Agile Transformation

Agility is a synonym of speed, and testing, especially end-to-end testing, takes a very long time when performed manually. Automating this type of testing and adding them to your regression suite is then paramount if your goal is to achieve development agility.

If you want to learn more about how to execute an agile testing pyramid with automation, read our blog post: How to Execute an Agile Testing Pyramid With Automation?

New call-to-action