As engineers, developers and designers we deal with complexity every day.

Some of this complexity actually turns out to be easy to comprehend, after all, at the very highest level we are all dealing with the logistics of data. How do we get from point A to point B in the most efficient manner?

Every project has it’s own requirements and every project is wildly different in them. Obviously due to the law of averages, some of those projects are remarkably similar. Others, on the other hand are so different it can be difficult if not impossible to see the similarities between them.

When the requirements are provided to us, they come in a variety of forms depending on the experience and level of technical knowledge of the person supplying them. When I worked in the design industry, often the requirements were as vague as “Build me a website” and their understanding of what they actually wanted was equally as vague. Working in the telecoms industry is usually more details (although not always) and we, as engineers, then need to take the business owners on a journey in order to explore exactly what it is that they expect at the other end.

It is then our job (as engineers) to break those requirements down into something more usable and it is this area where many fail.

In Software development, requirements are managed according to their size. Overall a project can be classed as being an epic in size. Individual elements of the epic are classed as stories and aspects of the stories are classed as features. Features can then be broken down further into technical tasks or it may be that the tasks underneath are actually features in their own right making the parent story an epic and the epic? What does that become?

To answer this question we look to literature where the concept originally came from and the particular example I am going to use throughout this tutorial is The Lord of the rings.

When we look at the lord of the rings, we know that overall this is an epic tale told in 3 parts, however it is much more than that. To be fair I could have chosen any number of authors for this, Robert Jordan, Brian Jaques, Kathy Reichs, the list is endless but any decent author who is capable of spinning a story over multiple books understands the importance of keeping the characters alive.

It is on this point I wish to focus because it is this point that demonstrates most clearly how to break down project requirements either horizontally where a project touches on a large general aspect of the codebase, or vertically where we touch on small, specific areas of the codebase.

In literature we consider the Lord of the rings to be broken down into 3 main stories:

  1. The Fellowship of the Ring
  2. The Two Towers
  3. The Return of the King

If we take the 3 stories in their entirety one after another, when translated into software, this is known as horizontal slicing. Why is this? Well, because in the realms of software we understand that a complete product is made up of various entities.

Consider this website for a moment, in it I have a base system (wordpress), this is the foundation, the main plot if you will. On top of that I have a number of sub-systems. I have a Gallery system for managing images, a source management system for displaying source code from applications, a theme describing how the site looks, and many more. In horizontal slicing, when I change one aspect of the site I will consider all the aspects. All plugins play a role. For example, if I am updating the plot (wordpress), I have to consider each plugin. Has this been updated to work with the latest version of WordPress. Further to that, if the plugin has been updated, have dependant plugins also been updated? If I change one aspect here, how will that affect a system that may be completely unrelated?

When we look at the lord of the rings, it is the interaction between many characters that make the book although some of the aspects of the story we know we can live without. If we took Gandalf out of the story, we could still tell the story. It may not be as good but the story is still there. This is because we have a strong plot, a solid base or foundation if you will. If we took Frodo out however, suddenly the story is not as effective. We can’t tell Lord of the rings without Frodo because it is his story. We’d be telling something else. The same is true with software. I can replace WordPress with Joomla and tell a similar story but it would be different. This is because Joomla is not the same as WordPress. This would be like telling the story of Memory, Sorrow and Thorn instead. Equally as strong a story even if it isn’t as popular or as well known.

When we talk about vertical slicing on the other hand, this is like taking a single book from the series (or even all the books in sequence) but only examining the details of one character. Take Frodo out of the story and only tell his story on its own. How does Frodo get from Bag end to Mordor? Taking out all Frodos interactions with common elements (Sam, Gandalf, Gimli, Aragorn and the rest), we can still tell Frodos story, we can still work with the character although the story is different again. We’re only looking at a small part of it.

The same is true in software development. We can take an aspect of the story and tell it as a story in its own right. Yes it will be different but we are interacting with common elements. We may still interact with the dwarves and the elves but only on a more general level. During vertical slicing we rely on the fact that every other aspect of an element of the story stays the same and we are only changing how our character interacts with it.

For example if we take the gallery system I use on this site (NextGen), the display mechanism (WPSupersized) and an intermediate layer of my own devising (wp-supersized-remote-xml). I can work with, enhance and modify all of these elements on their own without touching on any other part of the system. I have taken a vertical slice and from that I know that what I change will not affect the rest of the application.

So how does this compare to a literary story?

For the gallery system I have broken out the gallery to become a story. Therefore the overall website is now an epic which tells the story of me (Martin Proffitt, Software Engineer). The gallery tells (or is telling) the story of my abilities as a photographer (as opposed to my story as a composer, poet or engineer).

The individual features of the gallery story are now NextGen, WPSupersized and wp-supersized-remote-xml. The plot still stays the same as being WordPress.

Now, I can take the whole of these four aspects together to form a story OR I can break them down further. My plugin (wp-supersized-remote-xml) needs to interact with wordpress, NextGen and WPSupersized, but to me they haven’t changed and even on an update to WordPress my plugin should continue to work. If NextGen changes, I may have to update my plugin to continue to work. This is known as a feature. I only have to change the aspect of my plugin that interacts with NextGen and my story can continue to be told. If all 3 products change then I may have to completely rewrite my own plugin so that it continues to work in the same manner.

When all plugins within this sequence change, this is horizontal slicing again. I have to completely re-write what I have developed and touch on all modules in order to continue to tell the story. If only a small portion of one or two modules changes then I move to vertical slicing, I only change the elements of my own code which interacts with the code from the other plugins and / or base system.

So how does this compare into Lord of the rings?

Well, if the underlying plot changes, I know that the interaction of Frodo (NextGen), Gandalf (WPSupersized) and my own plugin  which fills the role of Legolas will have to be adapted, otherwise the story cannot continue to be told in its present form. If the plot does change but Gandalf is removed then Frodo will never meet Legolas so my plugin has to be removed and an alternative solution devised.

With all this to consider, you may still be thinking “So how do I break down requirements?”. Well the answer is simple.

When we look at the Lord of the rings we see the 3 main books, but when we investigate further, then we see separately the individual stories of the main characters. Requirements breakdown is then about examining each individual aspect of the project (Frodo, Gandalf, Legolas, Aragorn, etc) and asking “How much of the story I am currently telling will change if I remove this character or aspect?”.

When we consider it in this light, whilst WordPress always remains as a global plot (at least in the story I am telling), the characters can change. In my story they have been defined already and each one can either be a story or a feature. If I examine the site as a whole then the 3 elements NexGen, WPSupersized and wp-supersized-remote-xml form one feature (the gallery), yet when examined in more detail they are individual components and then the gallery feature becomes a story in that it can be broken down into individual features, the gallery is a feature of the overall story in that it is a small aspect of my website( but it is a story because it in itself consists of multiple parts, you can have single photos, galleries, albums, you can comment on and describe photos, galleries and albums as individual components. This is because the different elements tell not only the whole story but can exist on their own even if to achieve this they require different characters to interact with.

Some features (such as NextGen) can exist entirely independantly of the others. My own character cannot. It relies on both WPSupersized and NextGen to exist. Others do not. The level of complexity each character is reliant upon is down to the original author. Yes I could have made my character more general but in the light of the story I am telling, there was no need to.

I hope this explanation helps you understand that requirements breakdown doesn’t have to be the scary monster many make it out to be. It sounds more convoluted than it really is. At the end of the day it doesn’t matter what you’re creating, you’re always telling a story and it doesn’t matter if that story is how to sell perfume or how to develop and distribute an operating system. It’s the same story just told in different ways.

Leave a Comment