NELKINDA SOFTWARE CRAFT

An Analogy Between Test Pyramid And Waste Pyramid

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
First Published:
by NNelkinda Software Craft Private Limited
Last Modified:
by Bharati Koot
Approximate reading time:

1 The Pyramids

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?

Figure 1-1: 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

Figure 2-1: 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.

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

Figure 2-2: 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.

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 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 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 crisis. Yes, the ice-cream cone fits well only in ice-cream parlour 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 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.

Figure 4-1: 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.

Reducing Waste is Software DevelopmentReducing Waste in Real-Life Environment
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
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!

Figure 6-1: 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 few references for further reading,