Lift Buttons and Requirement Tracing

Sometimes everyday items teach us a lot. All we need to do is pay attention. Most of the time we are like walking robots and letting our subconscious mind operate us. Our office has 8 lifts, 7 for everyone of us and 1 is a service lift. In software engineering one of the major activity is requirement tracing. It is a boring activity but it has to be done. In my case I was part of medical application development for cancer treatment, tracing has to be done religiously. If we don’t do that with care, someone’s life is at stake. So everyone of us are very careful about it. During this entire process it never occurred to me what would be the consequence if the tracing was not done with care.


Ok let me get to the story. Recently one evening I was standing in the lift lobby. I pressed the lift button to get to another floor. For some reason the lift button didn’t take my request. I came to know because the lift button didn’t light up. I tried to press a bit more, it still didn’t work. I just went to another lift, pressed the button and it worked. While waiting for the lift to arrive, suddenly the engineer inside me woke up, all these buttons have Braille letters written (up button has up written in braille and down as d{n in braille) so a blind person can operate the lift. But if the button didn’t take the request how the blind person would know? he cannot see the light in the button. I thought the designers should have given an audible alert (acknowledging the request) so a blind person would know the button press worked. Then the lift came and I entered the lift. I saw the buttons inside the lift also had Braille inscriptions. But when I pressed the buttons there it was an audible alert. The request was accepted visually via the light and audibly by the bell sound.

Now I hope I understood the problem. Most probably the lift designers got a requirement that “a blind person should be able to operate the lift”. They did design the operation properly. All the places where a person will interact with touch will have Braille inscriptions and all the feedback will be given back audibly. I can hear the bell when a lift arrives, when someone presses the button inside the lift & many other instances. The team which did the external interface (lobby request buttons) forgot the audible alert somehow. You cannot expect people to remember everything, that’s why we write things down and follow the document process in engineering.

In software or system design such things are bound to happen. To avoid such inconsistencies we do follow a process called requirement tracing. I won’t go in detail what requirement tracing is about(It is boring). In short we take the high level requirement and trace it below in the hierarchy and make sure the design/implementation is consistent. If not done the result is a system that is incomplete.

The lift button taught me the effort I spent doing the requirement tracing was useful and worth the time spent.


Conflicting Requirements – Interesting Solution

Software architect’s job is interesting because often there are requirements that are conflicting with one another. As a software architect one has to come up with a solution that caters to both the requirements. And it is mostly a compromise that works. To give an example in the software world, People install an antivirus to safeguard the computer. Every user installing such a software has 2 requirements

  • The software shall protect the user from all the malicious (ok most of the malicious) software in the world in real-time.
  • The software shall not slow down the machine for regular use.

This looks to be a simple requirements from user perspective. Actually this translates to something like this “When a program is started, the antivirus should find out that it’s not malicious as soon as possible (under a second)”. But to do a complete check it will take lot more time. If you choose one over the other the product will fail. A software architect often takes inspiration from other real world situations. So in this case it is similar to an airport security check. There the goal is

  • Make sure all the passengers are safe and are carrying only safe stuff.
  • Board the passengers as soon as possible.

The same dilemma exists here too. If the check is extensive the boarding time will increase. If the check is not extensive passengers might take some dangerous stuff into the flight. How did they solve it? did they optimize for one and discarded the other goal? No the airport designers came up with an interesting solution.

  • Put all the things to be checked inside your handbag and send for a x-ray check.
  • Then walk through metal detector.
    • If there is nothing detected then you just collect the bag and walk to your boarding gate.
    • If a metal is detected then the security personnel will do an extensive check.

This way the security is not compromised and at the same time the whole process is fast enough. Now coming back to our software example, how does an antivirus software achieve both requirements? Here is how (I am not a security architect, I am only writing this for an example)

  • Check the software whether it is safe
    • See if it is digitally signed
    • If the user has white listed
    • The program didn’t originate from internet
  • If any of the above condition is met then let it run
  • If not then take the program for an extensive check

This way a trusted program starts very fast while a suspicious program will take time. And as always nothing works for all the 100% use cases. You can read up an instance when this method failed. There is a lot from the real world scenarios and solutions.


Upgrading my desktop machine


I myself and my tech guru Nirmal assembled a machine back in 2009. It is a Core2 duo E7500, Gigabyte G41, 2GB RAM, Intel on board X4500 graphics, 7200rpm 500GB Seagate HDD and normal ATX case. Even though I hated that big case, it was running win7 32 bit fine. Recently I upgraded the machine to Windows 10 64 bit. And the machine started to show its age. It was sluggish, YouTube can play only 480P and visual studio was crawling. My first option was to sell this machine off and buy a new one (It has served me 8+ years without any major problem). Assembling a machine is always done for a need. In my case when I assembled the machine I wanted it to run for a long time. So I just removed the thought about selling it and started to search for the root cause for the sluggishness. After some measurement I found out the root cause was the graphics card. Windows 7 gave it a rating of 1. In addition to this 2GB has become quite less for a Windows 10 64 bit.

I went in search of a graphics card that can replace my onboard card. I didn’t want to buy a graphics card for gaming. I found a zotac nvidia 210 card for 1200Rs and additional 2GB of DDR2 RAM for 745Rs. To my surprise I also found an Intel xeon quad core L5420 with 12MB cache for 800Rs (a core 2 quad Q9650 costs close to 8000 Rs). Even though the xeon was for Socket 771 with a little bit of hack it can be used inside a socket 775 motherboard. I upgraded the processor, RAM and the graphics card. The processor gave big boost in the performance and also reduced the power consumption from 65W to 50W. The graphics card takes care of the media playback and graphics well. The additional RAM gave extra breathing space for the Windows 10 64 bit. The machine is running fast enough and youtube is back to 1080p.

The moral of the story is, a big ATX case and all that assembly might look ugly, but when it comes to upgrading and saving our hard earned money there is no match. Cashify gave an estimate of 1000Rs for my machine and building a similar machine would have cost me somewhere around 20K. I think with this small upgrade of 2745 Rs I saved some 15K (building a new machine from scratch). I hope the machine serves me some more years.

First IOT home project – Bus announcement system

Recently my daughter’s school came up with some fancy application called falcon parent. It basically provides tracking of the school bus and the student’s commute information. The application is quite good. It provides

  • Live tracking of the bus location on a map
  • Send alert once it is near to the boarding point
  • Send alert about the student boarding and alighting

Initially I check the app and alert my family members when the bus is nearby. Engineers in general have a common trait, they come up with the most complicated solution so that they need not do the simple thing (basically laziness). In my case I wanted to automate my work (alerting the family regarding the bus). All solutions (journey) start simple.

Simple Solution

I have tasker for android(the app I don’t regret paying for) & NotificationListener plugin. I did the following

  1. Intercept the notification from falcon app in my phone.
  2. Use Google TTS and speak out the notification.


Simple thing worked fine. But it works in my phone and if I leave early to office the alert was of no use to me and my family. Actually during an official interview presentation my phone spoke “Fathima boarded the bus” in full volume.


It works only in my phone

I thought the solution should work independent of my phone. Then I remembered my sister’s galaxy note that I spoiled (tried to replace the glass and burnt the display). No one was using it. Everything works but the display was unusable (became black & white). I thought just move the solution to that phone and it works independently. But past always haunt the present solution. It had android 4.1 and notification intercept is not supported. Either I have to root or find another alternative. At last PushBullet came to my rescue. It can intercept pushbullet message and trigger an action in tasker based on a trigger word. The solution became

  1. Intercept the notification from falcon app in my phone.
  2. Send a message to galaxy note via push bullet.
  3. Based on a trigger word the galaxy note will trigger an action.
  4. The action use Google TTS and speak out the notification.

Usability study

I thought everything was fine. I kept pestering my mother, wife & sister regarding the feedback. They said it was ok. But the Google tts announcement was like our railway station announcements. People just understood that the system is trying to tell something and ignored it most of the time. After doing some study and breaking my head, I found that we can identify known music easily even with lot of noise. Now I tweaked the solution like

  1. Intercept the notification from falcon app in my phone.
  2. Send a message to galaxy note via push bullet.
  3. Based on a trigger word the galaxy note will trigger an action.
  4. The action use Google TTS and speak out the notification.
  5. Based on the type of notification play a known music(for eg airtel ad, bond theme music, MI theme music, bus honk)

Sustaining the solution

I thought all is fine the system is working fine. Now on hearing the bus honk my kids hurry and go down to catch the bus. After couple of days I checked and found that the phone switched off due to low charge. Initially I thought of keeping the phone always connected to the power (battery might go off soon) or to save the battery I have to charge it manually. But like I said earlier the laziness kicked in again. I wanted a solution that will charge automatically and also save the battery. Again I had a Kankun sp3 smart plug lying around for some time without any use. That came to my rescue. I did the following to charge the phone

  1. Connect the smart switch to wifi with a static IP.
  2. Installed a REST api inside the smart switch (Thanks to Hackaday) .
  3. Connect the phone charger to smart switch.
  4. Tasker switches the charger ON (using the REST api) when the battery level is <50%.
  5. Tasker switches the charger OFF (using the REST api) when the battery level is 99%.

Now the automated solution is part of our day to day activities. The system just works now. May be some surprise might come in future. Cheers.


Software Architect & Big Picture

In this post I am going to cover an important responsibility of a software architect. A software architect should know and own the big picture. The big picture is a collection of important decisions, if broken has a system wide impact. Often software teams come up with the following arguments for not having an architect

  • Architects don’t code. They are costly resource.
  • We need the architects at the start of the project then we don’t need them.
  • Architect just write power points and don’t understand the details.

But in reality a software architect is not a role with all the details. This role works with all the abstraction of abstractions. A software architect is responsible for ensuring that all the quality attributes are achieved. For a simple small project a software architect may not be needed. But the moment project becomes huge and complex the team needs someone to take up the role of software architect. To do this a software architect needs to know and own the big picture. The component teams often make lot of local design decisions. A software architect should be able to identify decisions that might have an impact on the big picture. And if a local decision will break this big picture then it’s the architect’s job to communicate and do a course correction. Ok enough of abstract talk. Let me give a real world example.

I used to visit one of my friends who run a cell phone repair shop. One day a customer came to the shop with lot of anger. He mentioned that the helper broke his mobile and the camera is not working any more. My friend inspected the phone and found the memory card was filled up. There is no space left for storing a new picture. He explained this to the customer. But the customer mentioned that the camera was working until he gave the phone for servicing. Now my friend enquired the helper regarding the service he performed. The helper mentioned that as a part of service the customer asked for some songs to be loaded to the phone. The helper filled up the memory card with songs. Now my friend said to the helper that the memory card is a shared resource. At least 30% of it should be left empty. This is a basic rule of servicing. The helper freed up this space, learned the lesson and gave the mobile back to the customer. Customer mentioned “I normally don’t give my phone to your helpers directly. Next time I will give my phone for servicing only during your presence”.

In this story the helper was focusing on one aspect “Loading the music to the phone”. He decided to fill the entire memory card with music to delight the customer. But he was not aware of the implication it might have on the other subsystem (camera operations). And he broke the rule of leaving 30% space free. In real life software projects each of the component team is thinking about its component and makes such local design decisions without knowing its implications on the other subsystems. And they may break an architectural decision. Here my friend is like the software architect and the helper is like the component designer. A software architect needs to communicate with his fellow designers on a regular basis and ensure that the architectural decisions are not broken. But during the course of software architecture and design lot of such mistakes are bound to happen. During all these times a software architect should patiently course correct his fellow designers and ensure that his big picture remains valid.

The customer in the end mentioned that he wants someone to own the big picture in a subtle way. In real life software projects too we need someone to know and own the big picture throughout the project.


Design for People

As a software engineer one has to make design decisions. I always ask my fellow engineers to keep the people factor in mind. The decision should follow the principle of least astonishment(POLA). To explain the POLA I am going to take a real world example. It is easy to remember real world examples better.

In the recent times I have accumulated lot of mobile devices. Out of them I am going to take only the following 3 devices

  • Nexus 7
  • Samsung Galaxy s3
  • Apple ipad

I myself and my family members use them interchangeably. One of the major use case is to adjust the volume. After using these devices I know that the volume button is somewhere in the side. I try to use the muscle memory, search for it and adjust the volume. But the experience differ between the devices. I will list them in the order of worst to best.

  • Nexus 7 – This the worst one among all the three. The volume and power button are placed on the right hand side. I tend to push the power button instead of the volume button and then press the power button again and get back to volume control. For a human being its hard to remember the exact location of the button unless otherwise one is using the same device for a long time.
  • Samsung Galaxy 3 – In GS3 the volume buttons are on the left hand side and the power button is on the right hand side. Even though this looks better, again correctly remembering the type of button and left/right side is hard. I tend to do the same thing here too. I press the volume button and course correct later.
  • Apple ipad – Here the volume buttons are placed on the right hand side. The power button is placed on the top. There are couple of advantages here.
    • In the above 2 cases I actually cross checked the devices for correctness of my post. In case of ipad it was not needed. I can remember top & sides. But its not easy to remember whats on left & right.
    • I always end up pressing the volume button and never enter an alternate operation by mistake.
    • This provides the best experience for me.

Now the third case of ipad satisfies the principle of least astonishment. In the other 2 cases I intend to do something, but end up doing something else and then after a moment of surprise I course correct. Now if you are an engineer make sure the design decisions follow the principle of least astonishment. It definitely saves lot of time for your fellow engineer/human being.

To give an example from the software side guess what the following object represents

var d = new Date(2011,1,23);

Any one would make a guess that it represents 23 January 2011. But if you are programming in JavaScript then it represents 23 February 2011. While the date and year start from 1, the month start from 0. When I was programming in JavaScript the question I had was hours,minutes,seconds all start from 0. That is natural. But why does month start from a 0? That was my moment of surprise.

Hope you consider the people first when making the design decisions.

Learning Microsoft Azure


Cloud computing is growing day by day. More and more business are adopting it. Being a software engineer one has to learn the recent technologies and be relevant in the days to come. So I decided to spend some time and learn Microsoft’s azure cloud computing. In this post I am going to list down the list of road blocks and how to cross that without violating the corporate security regulations

Pay per use

Learning cloud computing involves money. A valid credit card is needed. Once a credit card is registered azure makes a test transaction of $1. Then the subscription is setup.

Azure provides a one month free trial with $150 credit. But this is too short a time to try and learn the azure offerings. Initial set of months I did pay from my own pocket and learned the azure services. The bill was not huge but it is a pain.

MSDN Subscription

As a part of our regular software upgrade I received a visual studio 2012 with MSDN subscription. MSDN subscription is a programmers treasure box. There are so many things that are available as a part of the subscription. One among them is the $50 azure credit every month. If one is careful a lot can be learned with this small credit each month. Now I don’t spend my hard earned money but use this credit. Thanks to those folks at Microsoft and our procurement 🙂

Access Azure from Powershell

Azure has 2 management portals. They provide a nice UI for every management task.

And like me if you hate UI and like the command line then there are 2 offerings from Azure

  • Powershell cmdlets
  • Node.js based cross platform command line tools

Being a windows user and having power shell readily available, I installed the powershell cmdlets. But because of our proxy authentication I couldn’t access the azure service from these cmdlets. After some search I found a solution. Including the following line in powershell profile, makes powershell talk to the azure REST api through our proxy.

[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials

Programming for Azure

Azure SDK provides 2 emulators. So before deploying the program to Azure one can locally build and test with these emulators.

  • Azure compute emulator
  • Azure storage emulator

And at times when I had to access the azure service from a local program through our proxy authentication then the following trick similar to the powershell one works. Add the following block to the app.config

    <defaultProxy useDefaultCredentials="true" />

SSH is blocked

To feel the power of windows azure finally I reached the point when I had to create and use the virtual machines. Here again our proxy blocks both RDP & SSH for the security reasons. Without these protocols I cannot do anything with the virtual machines. I thought of solving this problem using the cloud itself and found a nice solution. After some searching around I found the awesome “shell in a box”  from google code. This exposes a shell through a web interface. It also supports https. Now this is how I have made my setup.

  • I have one small VM (Basic/A0) with shell in a box running at 443 (It is speaking https for security reason). This has to be setup onetime from outside office.
  • I start this machine using powershell and ssh into it using a browser.
  • From that VM I ssh into any other machine if needed. (yes the whole world is just a ssh away)
  • Once I am done I shut down this machine using powershell.

Keep an eye on the $$$

Last and important point is the money that is involved in learning cloud computing. Always do the following without fail or else all the free credit will be burnt soon and one has to wait for a month to continue the exciting journey.

  • Always keep a tab on the azure credit.
  • Based on the utilization it will be green or red.
  • Green means no need to worry. But in case if its red then the money in the subscription will not last for the entire month.
  • Always shutdown the VM/service instances that are not needed immediately (not at the end of the day).
  • If there is a need to preserve the IP keep the cloud service running and shutdown only the VM.
  • For some services like websites, database etc there is a free tier available. Use them instead of the paid tier.
  • Some services like redis cache are way too costly. Be careful with them.
  • And my rule of thumb is compute is always costlier than the storage.

I am still exploring the technologies. I hope this helps someone who wants to learn cloud computing…