An Analogy Between Test Pyramid And Waste Pyramid

Bharati Bastade Koot
9 min readJul 13, 2018

The waste in software development and our daily life could harm the People, perhaps the Universe. TL;DR: Being an Environmentalist and Software Craftsperson, in this blog, I have tried to establish a link between Test Pyramid in Software and Waste Pyramid in Daily life by showing an analogy between them and ways to minimize the waste in software development and our own lives which will lead to Better Software, Better World! Just one simple thing that I recommend: Respect the Universe!

Author: Bharati Koot Software Craftsperson at Nelkinda Software Craft Pvt Ltd

1. The Pyramid

The pyramid is a monumental structure with a square or triangular base and sloping sides that meet in a point at the top. Yes, that is true. But they exist in Egypt, don’t they? So, where they come from into our software development and our real-life living?

What is the pyramid in test and waste context? (Image is drawn using online drawing application https://sketch.io/sketchpad/)

Well, that is quite interesting and important to know. And we will wonder by the end how they are closely related to each other and how people mindset can sustain software and real life with the help of the hierarchy of these pyramids.
And remember, for any built-in structure the base is very very important and so is for the pyramid, especially for Test Pyramid and Waste Pyramid in the context of which, we will be connecting here.

1.1 The Test Pyramid

The test is a code that verifies and validates that the software is meeting the user and business requirements.
The Test Pyramid is a pyramid-shaped structure that defines and helps to build well organized and well balanced automated software test structure. It is a layered structure that signifies the amount and type of software tests a software should possess to remain highly sustainable in the hands of its end users.

1.2 The Waste Pyramid

The waste is unwanted or unusable material. It is any substance which is discarded after primary use, or it is worthless, defective or of no use. The Waste Pyramid is an again a pyramid-shaped structure that defines the hierarchy of guidelines to reduce and manage the people or nature generated waste of all kinds. It is a layered structure that signifies the sustainable living standards and protecting the planet resources.

2 Inside these Pyramids

As both the pyramids possess certain layers and each with a significance of own, one should be pretty aware of what they really signify and how they help to build sustainable lives.
Let’s look into layers of both the pyramids and what they say.

2.1 The Test Pyramid in a nutshell

The Test Pyramid (Image is drawn using online drawing application https://sketch.io/sketchpad/)

The Test Pyramid primarily consists of 3 layers viz. Unit Tests, Integration Tests, UI Tests, but not necessarily only these layers. These are basically the important test aspects of a software to ensure it is performing expected end to end functionality.

  • Unit Tests

Unit tests are the tests that run faster and give quick feedback. They are testing every smallest unit of our software system. Due to early feedback and highly automated and precise nature unit tests are essential for a good software system. That is why they are at the bottom of the pyramid, highly preferable and large in number.

  • Integration Tests

They are similar to user interface tests but rather than going through user interface they will call the underlying services, for example, they use HTTP requests. They ensure everything works fine and well, but if something goes wrong, they do not tell it precisely. That level of precision is achieved with the help of unit tests.

  • User Interface Tests

These test would give the real-time experience of software behavior. They reproduce the user interactions with our software that is why the name user interface tests. They give the confidence that software would work as expected in the production environment. But they are expensive in terms of speed. They are slow and very fragile in nature as changing the user interface will break these tests. So due to the slow and fragile nature, they are expected to be at the top of the pyramid and expected less in number.

As we see the Test Pyramid, each layer is essential but the bottom layer is preferable to achieve the best quality software system. The trade-off of one layer is overcome by the next layer in the pyramid moving upside. And if we understand them clearly, they are helping to reduce or remove the waste generated in software development which can be anything like, defects, delays, unnecessary complexity, fragility, no test coverage, extra documentation etc. More precisely they help to remove the cause of the waste in software development. So they all are important for a sustainable software functionality.

2.2 The Waste Pyramid in a nutshell

The Waste Pyramid (Image is drawn using online drawing application https://sketch.io/sketchpad/)

The Waste Pyramid talks about the hierarchy of how we should deal with the waste that is generated on daily basis by all of us. Taking the responsibility for our own waste and protecting the environment from the potential harms is a need of today. So here is the layered approach to achieving this.

  • Refuse

Refusing the generation of waste is the base thing in waste management. And it solely depends on personal habits.

  • Reduce

The reduction of waste is another key element which talks about how to minimize our waste. As like eat what we can consume, reduce is, buy what we can use kind of thing.

  • Reuse

It says, instead of going for a fresh start always, if we can reuse the earlier stuff if it is possible to do so, we should first go for it.

  • Recycle

We can recycle the materials if they are useful and save the raw resources for making the new material instead. This will save not only cost, efforts and energy but the waste generation as well.

  • Treat

The treatment of waste is done such that they leave less impact behind on the environment. It is usually done in bulk on public and industrial waste by corporations and government bodies. But it is possible to do at an individual level as well through simple acts of composting for example.

  • Segregate

The segregation of waste is very important for processing the generated waste at a larger scale. Starting with a few initial segregations like the dry waste, wet waste, e-waste, sanitary waste, plastic waste will help to overcome around 80% of waste related issues.

  • Dispose

The disposal of waste out of the source of waste is the last stage of dealing with the waste. That is considered as least preferable option under the Waste Pyramid.

All these layers are pretty self-explanatory by their names. So, as it is seen disposal of waste is at the top of the pyramid which is least recommended and the bottom layer is most preferable. That means we should avoid the waste going into landfills, and if we see the bottom-most layer it says we should generate less waste as far as possible.

3 An Analogy between Test and Waste Pyramid

Testing is not just writing the tests for our software but managing the test architecture of our software. Similarly, when it comes to waste, it is not just generating the waste but it should also be about managing the generated waste in a way. So often the right terms that we should say are Test Management Pyramid and Waste Management Pyramid.
They are actually closely related to each other because they are having a common factor called People. This is because the software is for people and the environment where we live is for people. The more waste in the software or in the environment, more trouble we are going to give to the people. If we do not respect the hierarchy of both of them, it is going to generate more and more waste and leading to waste of precise time of an individual required to clean up the mess. And more than that it is going to impact the lives of the living being and sometimes it may take the lives of them as well.
So the analogy is, a common mindset of reducing waste in software and in real life living is a way for sustainable living.

3.1 Changing the Mindset

Be software development, be real life, one thing that difficult to achieve is changing the mindsets. The reasons behind that are, we are so much used to old practices and we are afraid of or not ready for changing that mindset. We just need to tell ourselves that it is high time to change the mindset, change can happen only if we step forward in the direction of the desired change. And, Changing the Mindset should be “Inspect and Adapt” style with changing requirements of time and people. We want our software and our lives to be highly sustainable and we need to minimize the waste and cost of waste management in all the sense.
So,

Be the change you wish to see in the world.

— Mahatma Gandhi

4 Ice-cream Cone — Why it Fits Well Only in Ice-cream Parlour?

If we look at both the pyramids and imagine them in inverted form just like an ice-cream cone, it will lead to a crisis. Yes, the ice-cream cone fits well only in ice-cream parlor because it’s lifespan is short, known and completely in our hands. We can tilt it, invert it, melt it, and ultimately we are going to consume it. The software we write goes into the hands of somebody else sitting in another corner of the world and the irresponsible behavior towards waste can impact the entire world. So the intention is to make it clear that the layers of both the pyramids shall be respected and followed to stop impacting the people and the entire world from the respective waste, otherwise.
So there is no as such an Ice-cream cone going to work out in software and real life when it comes to managing and minimizing the waste.

Ended up in mess with inverted Test and Waste Pyramid (Image is drawn using online drawing application https://sketch.io/sketchpad/)

5 How can we Minimize Waste in Software World and Real World?

Well, for that as said above first and foremost thing is to change our legacy mindsets. Ultimately if we tend to respect the Universe, we are going to get it done. It’s that simple: Respect Universe, and we will automatically respect the software we are writing and the environment we are living in.
Following table depicts few practical things I would like to recommend, of course not a complete list, but to start with a practice and possibly to make a habit of or to keep in mind in our daily In software and Out of Software life cycle, the list is good enough, I suppose.

For, Reducing Waste is Software Development, go for:

  • Agile principles
  • ATDD, BDD, TDD
  • Automation
  • Clean Code principles
  • Continuous Integration, Continuous Delivery
  • Knowledge sharing and transparency
  • Design patterns
  • Lean principles
  • SOLID principles
  • Right tools for productivity and right process

For, Reducing Waste in Real-Life environment, go for:

  • Being more with less waste
  • Being responsible for own waste: you should anyway because you are
  • Generating less waste or heading towards zero waste
  • Segregation of waste
  • Stop: Littering
  • Stop: Use and Throw attitude
  • Recycling the waste
  • Reuse of the stuff
  • Treating waste at source (for example: start composting at home)
  • Use of biodegradable products (environment-friendly)

6 Better World — Better Software — Better World

Yes, that’s what we all need and we all want to achieve. As we are reading these last lines of this blog, I am very sure that we all would be taking a step forward to bring that change needed for sustainable software life and real life! After all, in a way, one is linked with another, so one step ahead in either of them and we are heading towards zero bugs software and zero waste lifestyle!

Better World — Better Software — Better World (Image is drawn using online drawing application https://sketch.io/sketchpad/)

Happy Coding! Happy Breathing!

7 Further Reading

Giving a few references for further reading:

Author: Bharati Koot #BBK

Originally published at nelkinda.com on July 13, 2018.

--

--

Bharati Bastade Koot
0 Followers

• Self Employed for Self Discovery | • Eco-Warrior | • Humanist | • Software Crafter | • Minimalist | • Writing for Impact | #BBK