Tuesday, April 23, 2019

Lessons for a coder from the Boeing 737 Max crashes

Before you read any further, you may want to read this rather long article explaining the reasons behind the two Boeing 737 Max crashes. It is quite technical in nature and will surely appeal to engineers. A couple of quotes from the article should make you read it fully:

A funny joke about the way automation (and now AI) is taking over our lives:
Long ago there was a joke that in the future planes would fly themselves, and the only thing in the cockpit would be a pilot and a dog. The pilot’s job was to make the passengers comfortable that someone was up front. The dog’s job was to bite the pilot if he tried to touch anything.

About the difference between a computer and a human:
The flight management computer is a computer. What that means is that it’s not full of aluminum bits, cables, fuel lines, or all the other accoutrements of aviation. It’s full of lines of code. And that’s where things get dangerous.
Those lines of code were no doubt created by people at the direction of managers. Neither such coders nor their managers are as in touch with the particular culture and mores of the aviation world as much as the people who are down on the factory floor, riveting wings on, designing control yokes, and fitting landing gears. Those people have decades of institutional memory about what has worked in the past and what has not worked. Software people do not.

On the difference between a hardware glitch and software bug:
The 737 Max saga teaches us not only about the limits of technology and the risks of complexity, it teaches us about our real priorities. Today, safety doesn’t come first—money comes first, and safety’s only utility in that regard is in helping to keep the money coming. The problem is getting worse because our devices are increasingly dominated by something that’s all too easy to manipulate: software.

Hardware defects, whether they are engines placed in the wrong place on a plane or O-rings that turn brittle when cold, are notoriously hard to fix. And by hard, I mean expensive. Software defects, on the other hand, are easy and cheap to fix. All you need to do is post an update and push out a patch.

I wanted to highlight some points that are quite relevant to developers and implementers of various technology solutions at an organization.

  • Software applications are becoming increasingly powerful and controlling machines and eventually affecting humans. A case in point is the code that goes into meal coupon system at JGU. This system generates a random 5-digit code for each student that is entered on a tab to record the meal consumption. One line of code affects the way students respond to the system as it actually impacts their “time-to-eat”. For a hungry stomach, it can mean a change in behaviour. You would recollect this Snickers advt below and I have actually seen this in action in the campus!

  • The tendency to release software (in a hurry) with the intent to fix things in future releases makes a compelling argument but it could mean the difference between success and failure. I have been a culprit too and now I am more careful about prioritizing the feature list so that the first release doesn’t fail.
  • Sometimes we trust our own ability to think about the user requirements and that influences our design thinking. This is quite dangerous as Boeing would have found out by replacing experts with software designers in certifying a plane to be airworthy. We can be great at designing and developing code for a user but the starting point must be the user. Otherwise, we will only see disasters on the ground. Of course, the designers need to go deeper into the requirements and prod the user to go deeper too.
Let’s try to make things better- by not taking short-cuts but by producing the best-in-class solutions!

Monday, April 08, 2019

Revisit your assumptions...with a bit of caution!

This famous Belgian boy was in the news last week. He isn't really the one to seek attention while being listed as one of the major world tourist attractions. But there was something that everyone missed reading into over the last 400 years of his existence in Brussels. The little boy's statue was peeing 1,000 to 2,500 litres of clean drinking water into the drain every day! I do wonder why the huge variance in the daily figure though. I am sure statues don't exhibit this change due to seasonal temperature changes.

Coming back to the point, it is quite surprising that nobody questioned the premise of the design of this utter wastage all these years. The discovery was made by Régis Callens, an energy technician, after a meter was installed in the 61cm (24in) statue.

“We thought it was a closed circuit and that he wasn’t consuming anything,” Callens told La Dernière Heure. “Since the counter for Manneken Pis is just one out of 350 or 400, nobody paid much attention.” (Source: The Guardian)

But then, it shouldn't be surprising at all. If you look around you, there will be umpteen instances that will indicate the same indifferent approach to routine stuff. After some thought, I could come up with these questions that might explain the level of indifference.

  1. Does it impact me directly? We tend to question more when our own existence is affected due to their impact on our economic, social or physical health. For community impacting yet glaring instances like pollution, water wastage etc. we feel them but don't act. 
  2. Are the costs obvious? The cost calculation is an important metric to determine our response scale to an instance. More the vagueness (and difficulty) of the cost estimate, the harder it is to question. This is probably because we can't have the data to counter nay-sayers.
  3. Is the answer easy to find out? Complex analysis calls for more effort and today's busy schedules don't allow for such luxuries. If the answer can be found out easily, there is a far higher incentive for someone to act.
  4. Who will I upset if I ask? We live in a society that puts tremendous power in the authority that is the "owner" of the practice. The authority could be an elder at home for a religious practice or a politician (or a group) for a prevailing social convention. The person who wants to question might not have the perceived right to do so without inviting ire of this authority.
With these questions in mind, I set out to examine some of the common instances of how the status quo is accepted in our societies. I recollect querying about why we shouldn't cut our nails after evening hours. The prevailing notion about the Gods not being happy about my nails didn't really go well with my young inquisitive mind. Ditto about the practice of not using the broomstick after evening hours. I wondered why the Lord might be interested in such petty things instead of worrying about the larger things in the world. And then some elder put some light on the fact that the houses in earlier era didn't have lights (pun not intended). So it was advisable not to have nails lying around to avoid pricking someone. Similarly, the Goddess of wealth wouldn't want you to lose your valuables if you brushed out anything of value in the dark hours.
In another context, I have repeatedly noted that it takes that one person to open up the second door panel in a movie theatre when a crowd is trying to squeeze in from just one open panel. And then others have that awkward feeling of why didn't they think of this simple step.

But then, not all things can be explained some logic and reason. Moreover, who could possibly guarantee that this was the right logic when someone established this practice. In the case of the peeing statue, who could have thought of water scarcity in the next centuries when all water available was clean to drink! The pitfalls of a wrong assumption at different times can't be underestimated. I learnt this during my tenure as the administrative head of a K-12 school.

While taking rounds of my school, I used to wonder about the peculiar (and dangerous) placement of some flowerpots right next to the railings of the staircase. I felt very alarmed about the possibility of a child tripping on them down the stairs. The children were always in a hurry to fly down the stairs. And finally one day, I asked the staff to move them out of the way.

The School Principal came to notice this the next day and met me about this seemingly nice act. However, to my surprise,  she gave an entirely different perspective on the same situation. She had earlier asked for the flowerpots to be placed that way to dissuade children from using the railing as a slide. I then recollected sliding down the railing during my school days and some children might have been hurt too! The years passed by and took away those memories too.

At times, in our zealousness to "set things right", we overlook the very reason of why things are the way they are. Had the Principal left the school without transferring this logic to someone else, I would have probably ended up doing more harm than good to a child. In fact, someone might have just committed the same mistake now that both of us have left the school. Hopefully, there will be a staffer from those times who will remember the rationale for the placement of those flowerpots. 
For the sake of safety, I wish I had made some remark about the Goddess of Learning getting upset if the flowerpots were removed from that place...