Monday, August 31, 2009

Linear Vs Parallel

Suppose we have to select two complementary food items for a party and there are two different people who are going to do it.
We have given them instructions that the first person must select a drink and the second person a starter.

Should we let both the people do their tasks parallely or should they do it one after another.

Let's look at the problems which can be caused if the activities are done parallely

Parallel Activities

Issues of each item
Each of the individual items itself could have some issues associated with it.
So if the first person selected Wine, he might have selected Wine which is Corked, Oxidized, Maderized or Refermented.
Hence there could be an inherent bug in each of the food products itself which might not get spotted till the party started and then we see all the guests politely refusing when we open the wine bottles. Same could be for the other item we selected.

Issues of complementing
The different food items selected might not complement each other. So one person might have selected white wine and the other might have selected poppadums. I for one would not want to eat them together.
Since either of them does not know what the other person is selecting there is a low probability that the items will complement

Issues of missed opportunity of complementing
Let us assume that they magically are able to select complementary food items, say wine and cheese, we run into the third level of issues.
They might complement each other no doubt but we could have done better.
Wikipedia tells me that Gouda is more of a fit with Riesling, Beaujolais, Merlot and Zinfandel while Brie goes better with Chardonnay, Pinot Noir, Sparkling wine and Ice Wine.
So while I have been able to pair Wine and Cheese and my guests will be happy, some of the more discerning ones would have loved that the wine and cheese have a deeper relationship. So rather than an issue the third level is more an opportunity which we missed out to please our guests

Now let's look at the same two tasks if they are done linearly

Linear Activities

Issues of each item
As above the first person could have selected a wine which is Corked, Oxidized, Maderized or Refermented.
However when we start the selection for the starter, since the wine will be taken into consideration, it is possible that the issue might get spotted.
The Wine is available right through the process of selecting the starter so there is some probability that somebody might spot that the Wine is bad. So the second activity acts as a QA for the first activity. Visualise this in a project where coding is done after all the screens have been already designed. If there is an error in the screen say a spelling mistake, the coder might notice it even though he has nothing to do with it.

Issues of complementing
Since the Wine is available to the second person there is a greater possibility that he will select a more complementing starter like cheese.
Again there is no guarantee, but the probability of the items fitting is significantly enhanced
So if the screens for a Module are already designed chances are higher that the coder will better fit the code to the screens.

Issues of missed opportunity of complementing
The linear approach gives us the chance to create a better fit. So now that we already know the wine which has been selected, we can read up Wikipedia and select the cheese which goes best with it.
So if the screens are ready, the coder might realise that there is a better way of coding the screens than he was planning to because the screens are available to him. For example he might see that every screen displays the current User's Name which might encourage him to store it in the session, rather than pass it through the query string because the frequency is too high. Similarly if it is only visible on the home page he might not store it at all.
So based on the GUI the code could be optimised accordingly.

Increase in Calendar Time
The classic problem pointed out with linear models is that it takes more time. So if we were selecting both the items together we would have taken say two hours. Now we will end up taking four hours. Note that the effort has not increased. We will still take four hours, two hours of each person. Its the calendar time which has increased from two to four hours.
While this looks like a problem, in a project this is really not an issue because there are always other activities available to be done. So if these same two people had to choose food for twenty different parties then this would not be a problem since while one person is complementing food for one party the other could be choosing food for another party.

This is the major reason why I have seen Project managers schedule things parallely. The percieved increase in them leads them to believe that they are better off doing things parallely. However they end up introducing the three different problems which are mentioned above which actually ends up increasing the calendar effort also as all the bugs in the system have to be solved. Add to that the people related issues with one team blaming the other for the issues and you have your hands full.

So until you have a very small project where you do not have more than one module it is always better to work linearly than parallely.

Saturday, August 22, 2009

Self - Explaining and Forgiving Roads

The yearly cost of road accidents in the countries which are part of the European Union is estimated to be around 160 billion euros. Beyond the monetary cost, the human grief and suffering is incalculable. Across the globe we are no better. Approximately 1.2 million people die every year in road accidents and more than 50 million are seriously injured. Road accidents are a leading cause of death in people between the ages of 10-24.

Alarming figures when you look at it on paper.

Most of these accidents are caused because of human mistakes. To err is human seems to come with a baggage of death and lifelong suffering.Since accidents are caused by human error, the obvious solution has been to educate humans. So all the initiatives have focused on educating the driver (I see people whizzing past huge hoardings saying Speed thrills but kills), having motors to adhere to tougher guidelines and finally strict enforcement. However this approach has not really helped much with no significant drop in accidents.

Around the turn of the century various countries got together and started the European Road Assessment Programme (EuroRAP) an initiative to reduce death and serious injuries on Europe's roads. From here emerged the concept of Self- Explaining and Forgiving Roads.

The vision of "The self explaining and forgiving road" is a new way of thinking in planning and designing road infrastructure. Design of roads must focus on simplicity and clearness instead of complexity and ambiguity. Whatever we do about design - including use of information technology - with the aim to help the road users to manage traffic situations in a safe manner - road users will make mistakes and accidents will occur. The higher the speed the more serious the consequences will be from making mistakes in traffic. (ARRB Conference October 2006)

Self-explaining roads are designed and constructed to evoke correct expectations from road users, eliciting proper driving behaviour.Forgiving roads are designed and constructed to avoid and / or mitigate negative consequences of driving errors

Finally many governments agreed that humans are liable to error and just because they have committed an error they should not have to be punished with consequences upto death. Thus was born the concept of forgiving roads. A road which would forgive and minimise the impact of a mistake, which recognised that mistakes were inevitable and would try to minimise the impact of an accident.So rather than people having to protect themselves from oncoming obstacles in case they have skidded, the obstacles were themselves moved away as far as possible. And obstacles which could not be moved away were made flexible, so as to cause minimum damage.For years we had tried to convince people not to sleep while driving. And we are yet to succeed. But the consequences were dramatic, to the extent of death. So while education was still important, roads were made forgiving. So now you had rumbling strips at the edges and the divider. So if you were going towards the edges the car would start vibrating and hopefully you would wake up before you hit the edge. And hopefully the flexible objects would cause less damage even if you hit them.
Also was added the concept of self - explaining, an approach which forces you or makes it very easy to follow traffic guidelines. Roads which would shout out about themselves so that humans caused less mistakes. A bright colored 3d divider so obvious that nobody could miss it.
From childhood students are taught to look right, look left, and look right again before crossing the road. But just because you did not pay attention in school does not mean that you should be run over by a car. From here emerged the concept of Pedestrian refuges.

Pedestrian refuge islands are raised median islands that provide a location for pedestrians to safely wait for a gap in the traffic so they can finish crossing the road. This makes crossing the road easier for pedestrians by allowing them to cross in two stages and deal with one direction of traffic flow at a time.(http://www.irap.net/toolkit/default.asp?p=treatment&i=92)Easier than the looking in all directions. This approach becomes critical in cases of major intersections which could have sixteen or more points of conflict (http://www.tfhrc.gov/safety/pedbike/pubs/05085/chapt11.htm)

Not only was it made easy to follow driving guidelines but in various cases the guidelines were created such that people would be forced to follow them. Roads were created in such a way that you would automatically avoid mistakes. So straight roads were curved forcefully to make sure that you would not take it easy and sleep. Or instead of crossings many roads had roundabouts. The fact that roundabouts are difficult to manoeuvre makes people more conscious and reduces the number of accidents. Sometimes increasing the effort may be beneficial if it reduces the errors in the system

So why should most of us who have nothing to do with designing roads learn about Self-Explaining and Forgiving Roads.Well because this same approach can make highly usable Websites and also gives us insight into better Project management Systems.

But first to Websites.Look at Google, the number one search engine. It is designed on similar ground either accidentally (no pun intended) or intentionally.
Self Explaining - That is an obvious one. With one text box and one button in the page how many mistakes can you make anyways.
And then the Suggestions as You Type reduces the number of errors you make. It also points me towards the right direction without having to read any signboards.

The forgiving nature of Google is more interesting. So type http://www.gogle.com/ or http://www.gooogle.com/ and you reach google. Type "self forgivng" in the search box and it will ask you if you meant "self forgiving". Rather than you getting frustrated that you are not getting any relevant results and then breaking the laptop, it points out the possible error and saves mass destruction.

And what do we as project managers have to learn from all this. Plenty actually.A lot of the pain from the systems and environment can be taken away if we design them in the same way as the self-explaining and forgiving roads.

The forgiving roads approach tells us to create systems with the objective of
a) Minimising the error caused by humans
b) Understand that beyond whatever we do, we will cause errors. So create a system which minimises the damage if an error is caused.

This is in sharp contrast with the traditional approach where systems have been designed for intelligent, sensible and logical people to work in an efficient way.
But wont the approach increase the effort like the roundabouts. Definitely. But like the forgiving roads creating small local problems to sort out the global problem of accidents, we also create systems which might increase the initial effort but reduce the errors in the system. And since a significant effort of a project to the tune of 40-60% is in rework, we significantly reduce the overall effort.

This approach teaches us some interesting things -
a) Not to plan activities back to back because then the system is not forgiving. A delay in one activity creates a cascading effect which leads to all the other activities having to be rescheduled and maybe even lead the whole project getting delayed
b) It points out that most probably the agile approach of creating User Stories is a good approach. Like the pedestrian refuge it allows us to only focus on a few activities at a time. The User Stories approach creates small islands between tasks which reduce the effort of trying to understand the magnitude of the whole project every day and just focus on a few tasks.
c) Daily deadlines is bad because it assumes that humans will work methodically and systematically something against the human grain. Shifting to more forgiving models of one or two weeks could be more desirable
d) Rather than pretend that the Parkinson's Law ("Work expands to fill the time available") and the Student Syndrome("Given a deadline, people tend to wait until the deadline is nearly here before starting work.") do not exist or ticking the team off every day a better approach is to create short iterations where work automatically gets timeboxed forcing people to complete their work. It is the same thing which I had discussed in shifting things from being Important to being urgent.

e) Having good versioning systems. Versioning systems are designed to forgive humans who realise that they need the document five seconds after they have pressed Shift-Delete. Versioning systems allow people to make mistakes and recover without telling the Project Manager that they need two days to recode the module.

It is interesting this new thought process. From trying to create a disciplined and structured set of humans to creating simple systems which understand and work with rather than aginst human beings. Maybe we will see more of this in day to day objects as I still try to figure out how to scroll thorugh excel sheets on my Blackberry.