DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The Evolution of the Testing Pyramid

As software testers, we've all heard about the Testing Pyramid. In my opinion, there's a misunderstanding in how we should apply the Testing Pyramid in our projects.

Elias Nogueira user avatar by
Elias Nogueira
CORE ·
Oct. 20, 16 · Opinion
Like (1)
Save
Tweet
Share
5.75K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

As software testers, we've all heard about the Testing Pyramid. However, in my opinion (and in the opinion of others), there's a misunderstanding in how we should apply the Testing Pyramid in our projects.

If you have never heard about the Testing Pyramid I recommend you read these posts in this sequence (believe me, doing this will help you understand this post better):

  1. Mike Cohn Testing Pyramid 

  2. Test Pyramid by Martin Fowler

  3. Ice Cream Cone Anti-Patter by Alister Scott

  4. Cupcake Anti-Pattern

Let's Think

Now, it's time for some critical thinking.

Question: When we see a model, what is the first thing that we do?
Answer: Follow it!

Let’s be honest with ourselves: we follow the model without question (in most of the cases). But have you realizes that the Testing Pyramod is a model and a analogy?

The first post that I referred to says:

Remember that this is just a model, it is not a hard-and-fast rule that should be adhered to in every software project. (James Willet)

Many people try to use the Testing Pyramid like a hard-and-fast rule, believing that all of the tests should be pushing to the base of the pyramid because we need fewer and fewer tests in the UI. I disagree.

Testing Geometrics

After reading all these posts and concepts, do you agree with me that a strategy for testing automation is more like a Testing Geometrics than a Testing Pyramid?

Obviously, we have a lot of geometric shapes: pyramid, pentagon, rectangle, star, ellipse, and so on (try to google geometric shapes).

Now, consider the following in that mindset:

In a scenario in which you need to test a mobile app, the focus will be the user interface, correct? However, if you keep thinking that the Test Pyramid is a rule, you cannot focus (and put more tests than the other layers) in the UI layer. No, you can put however many tests you find necessary!

When we test a mobile app, at least three layers need to be tested: unit, services, and UI (this fits perfectly in the first Test Pyramid). However, if you miss a bug in the UI layer in production, what do you think is the first thing that the user will do? Obviously, it's not reporting the bug; it's a complete uninstallation of your app! (And the user, probably, will never return or install it again.)

So, wich geometric shape can you use to focus more on the UI layer? I say a cylinder because all of the tests in these three levels are important.

In a scenario in which you need to test microservices, the focus will be the unit tests, correct?

Again, if you keep thinking that the Testing Pyramid is a rule, you cannot focus (and cannot put more tests) in the Service layer.

If you are building a microservices, the UI layer is missing, and you will focus on the unit tests. However, the services are the heart of this. You must test them! Remember, you need to test all of the services.

So, wich geometric shape can you use to focus? I should say a star! 

"But Elias, a star?" Yes! 

You'll do some unit tests, but (in my opinion) the services test will have more focus. You need to integrate each service in another test or suite in order to guarantee the sanity of this integration.

How About You?

Do you agree with this concept? Let me know in the comments below.

Testing

Published at DZone with permission of Elias Nogueira. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Using the PostgreSQL Pager With MariaDB Xpand
  • Kotlin Is More Fun Than Java And This Is a Big Deal
  • What Should You Know About Graph Database’s Scalability?
  • Key Considerations When Implementing Virtual Kubernetes Clusters

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: