The Test Pyramid: The Boston 4th of July Fireworks Analogy

Photo by Designecologist from Pexels

What can the Boston 4th of July fireworks teach us about the importance of the Test Pyramid?

  • most of your tests should be unit tests*,
  • the least should be UI-based functional tests*,
  • and in between, you should have API-based functional tests*.

Despite lots of efforts to convince and educate developers and test engineers about the importance of following the Test Pyramid guideline, most development organizations still end up with an inverted pyramid — the total opposite!

The Boston 4th of July Fireworks Analogy

If you were given the very important task of testing the Boston fireworks setup to have 100% confidence that it will work as designed on the 4th of July, how would you test it?

The “Trigger Happy” Approach

  • It is very expensive — It will require a lot of staff to set up. It will cost you a lot of money, maybe thousands of dollars worth of pyrotechnics!
  • If anything goes wrong, how would you isolate where the fault is? Where do you start? How can you reproduce it?
  • You cannot test this way multiple times — it will require a lot of effort, time, and money to set it up every time.

For very obvious reasons, it is wise to avoid the “trigger happy” approach at all cost, especially if you value your job.

The “Only Smiles Allowed Here” Approach

Note that you will still have the same challenges with the “only smiles allowed here” approach as with the “trigger happy” approach, just in a smaller scale. But though this approach is still expensive, it is sometimes necessary.

The “Under The Covers” Approach

The “Break It Down” Approach

Back to the Test Pyramid

Some very brief definition of terms

  • Functional testing — testing the functionalities of your application against the desired user acceptance criteria
  • UI-based functional testing — testing the functionalities of your application via the application’s user interface
  • API-based functional testing — testing the functionalities of your application via the application’s API service layer
  • Unit testing — testing units of code or logic in the underlying codebase that make up your application

Good reads

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mary Ann Nazario-Belarmino

25+ years of hands-on experience in software & technology - leadership, engineering, quality, product ownership, program management.