swiss_cheese_model_of_accident_causation

I often get into a debate with people about the type and the extent of testing that has to be done for software. One of the key arguments I hear is that developers should focus on creating only the happy path and leave the rest to the testers to find or have SDETs write extensive automated tests while developers can skip unit tests and focus only on writing useful code.

I have used the swiss cheese model to explain to people about the need for layered coverage instead of concentrating all the effort onto one layer. I first heard this term while watching an air crash investigation episode in nat geo. The narrator explains that though there are millions of parts in commercial airliners, the chance of getting into an accident is far lesser than motorcycles.

How an aircraft with millions of parts is able to get back on to the sky within a few hours after landing from a long trip? The answer lies in layered testing. The pilot has a pre-flight checklist, the ground staff do a routine check for visible damages, the maintenance crew notice the hours of usage and do preventive maintenance, there is a strong network of weather monitoring and routing, ATCs manned with trained staff and modern radars, aircrafts fitted with collision avoidance systems, a long series of protocols for ground and sky movements etc.

It is the same across many engineering and medical disciplines. The risk of something slipping through all the layers of test is very rare and if it happens then it is immediately plugged. In software engineering it is a combination of static checks, unit tests, integration tests, automated ui tests, heuristics & exploratory tests, performance tests etc. No one type of test can be removed altogether and replaced by another. We need the layers to move fast and yet deliver what is required.

Image courtesy: Davidmack, Swiss cheese model of accident causation, CC BY-SA 3.0

When you open the newspaper in the morning, mostly the front page ad will be by some builder luring buyers with a remarkable investment offer that is bound to appreciate in value with unheard levels of return on investments. One question I always wondered about was ‘why don’t these people hold on to their assets instead of selling if the prices are always upwards and skyrocketing’.

Many of the investment opportunities are nothing but spending disguised as investment. Buying a new flat involves taxes, registration, premium, loan fees, interest etc. It is good to buy one to live, but buying solely for investing that too on loans is nothing but a huge spend. We have grown up to see property yielding good returns, but that was largely due to the developments and migrations that happened to some of the cities. Stories of selling inherited houses and making a fortune were told to us which primed us into thinking that buying a property is an investment.

Investment is something that always carries a risk, for example cost of property during 1980s in North Chennai suburbs (like Minjur) and South Chennai suburbs (like Urapakkam) were same, but people who invested in the south reaped the benefits. The risk here was non development, the risk surfaced for some buyers and they ended up just getting inflationary returns. Investment needs knowledge of the market, environment, a bit of knowledge about the economy, a good amount of time and some dose of luck. There is a lesson for investing, do not put all your eggs in one basket but property is such an investment that it is a large egg which sucks up all your savings and locks it up.

Savings does not carry a big risk, but in the long term it definitely erodes away with inflation. Savings can be treated as a low risk investment with a very less return on investment, does not require much market knowledge, it is to cater to short term finance cushion. One should have around 3-6 months of expenses in readily drawable savings, anything more will be eaten by inflation.

What is safe then? Nothing is safe, we need to spend prudently and at the same time invest and save in different baskets to offset the risk of exposure in one area like real estate to the other like stock markets. Don’t succumb to greedy marketing and planned obsolescence, many things last really long.

Baskets for savings (immediate liquidity)

Bank deposits (fixed or savings bank), inflation will eat it over time.

Hard cash and foreign currency, if you travel often. Forex might move with inflation but hard cash will be eaten by inflation from day 1.

Gold, it can be held long as it does not lose too much value but gives less RoI.

Baskets for investments (Risk involved, but always pays over long periods like 15-20 years)

Stocks & mutual funds, equity should be held very long to reap the benefits of compounding and shield from short term market fluctuations.

Plots & farm lands in the fringes of the cities, will take a long time to sell and depends on the development around. If you are lucky could land in a major windfall.

Rental real estate, only if the rental yield is around 7+ % of the cost of the purchase and that too purchased outright without loans.

Spendings

A comfortable house in a locality that brings peace,  when bought on loan; should not burden more than 40-50% of family income as it has a long repayment period. Keep in mind the high costs associated with registration, taxes and fees. Long term returns in the current market conditions pegs flats bought on loan to perform the worst in terms of RoI, treat it as if you are buying a car for yourself not an asset.

A good vehicle, as many people commute a lot. Better to avoid a loan and go for outright purchase which will make people negotiate hard and keep the existing vehicle for long. If you go for a loan then buy only if your outflow is around 20% of your family income and you can finish it off in 2 years.

There are plenty of marketing going on to make us spend a lot more than necessary like changing home appliances every few years, expensive and lifestyle brands etc. Create a budget for spending and try to stay within it as much as possible. Your spending budget per month is best limited as 3 times the rental rate in your area. The rest should be saved and invested.

During my school days, I have noticed doctors prescribing glucose to patients with weak digestion due to a recent illness. I was curious and asked one of the elders about glucose and got to know that it readily provides energy, you need not to wait for it to digest like food. I got so impressed that I decided to have glucose instead of food. Bought a box of glucose from my pocket money and started having it instead of my regular meals. Just within a day I fell sick because of not having enough food.

I did not realise why I fell sick but the elders at home scolded me a lot and made me eat regular meals. A few years later I studied more about the digestion system and nutrition in my biology class. We do not need just energy like how cars need only fuel to run, we need a balance of minerals, nutrients, some complex compounds and energy food in terms of not only glucose but also complex carbs, fat, protein and also undigestible roughage.

Undigestible roughage? Why would someone eat something that cannot be digested, I came to know later that it is as necessary as any other nutrient you have because our systems are designed to process food moving through the digestive system and roughage is the train that passes through the system unbroken. We are not machines, we are an assembly of symbiotic cells.

On a parallel; for people who are deep into work and only work for a long while, we can see them taking a wild break sometimes not even returning back to the same intensity that they were involved earlier. Similar to our digestive systems, our mind also requires roughage; we can’t keep hammering on high intensity work for ever to achieve great heights. Our mind should get a sense of living through the days instead of working through the days. Roughage for the mind can be anything that is done in leisure but not on targets and deadlines. It can be reading, gardening, walking around, playing etc. Go ahead and go easy on those long days. Find the balance, have enough roughage.

dog-1310545_1920

All work and no play makes anyone a zombie.