Purpose

"Sharing is the best way of Learning" - Unknown

Saturday, March 14, 2020

From Burka to Bikini - My journey of transformation


Disclaimer: This blog is neither wearing a burka nor wearing a bikini. This blog is also not judgmental of any women's wear. I have no intentions to undermine any women's wear. It is about my transformation as a person. Transformation of my thoughts. Burka and Bikini are mere similes

It was a Saturday morning. I started for my weekly medium long run/walk. I wore a T-shirt from my previous marathon runs. I was lazy to shift into a running shorts. Or should I say lazy to search for my running shorts in the pile of washed clothes. I was wearing Jockey cotton boxers. I slipped in to SUBEA aqua shoes by Decathlon (I use these as my bare minimum running shoes). I bolted myself out and started for my walk.

While I was walking, I noticed a medium to heavy build man wearing a heavy track suit, a green locally made Calvin Klein top with heavy sports shoes jogging at a pace of 15 mins/Km (well this could officially be called as crawling)
I looked, and went past him. I felt he was over dressed for this run. My thoughts went wild.

Within a second I could see myself in him. A new bee runner. A ten year younger self calling me out harshly - "Have you not ever dressed heavily for your daily run???? - covered every inch of body with all the wearable that are available in the market. Have you not wore all the attire which sometimes toke at least 20 mins to search and dress?. Have you not wrapped the whole body even though the season did not support?"

Approx., Ten years ago, in 2011 July I started running to keep myself fit. I was a heavy weight, weighing almost 98 Kgs. I did not want to make a century - an achievement which most of us would never be proud of.

I was dressed in a cyan colored track suit with inner lining, a heavy shoes, a thick t-shirt. A pouch to carry my wallet and a mobile. A pouch to carry a small water bottle. Almost a 5 kgs of baggage.
I had a jacket which had a hood. In Winters, I used a woolen head gear to cover my ears. A muffler to cover my neck. A sweeter.
It's not just physical weight that I carried, I was also carrying tons of mental baggage.

I used to cover my face with the hood. Run looking down. I was embarrassed to run, covered all my flab with all sorts of clothes, covered all my scars on my legs with full pants. I felt everyone on the road had no other business but to watch me and comment.
Some of these inhibitions sometimes discouraged me from running. Especially my scars on my legs. The chicken pox scars on my legs were awkward. There are times when people approached me while I was running and advise about those scars. How they can be removed by surgery and by naturopathy clinic and what not. These encounters definitely discouraged me more and more.

Another discouragement for me running is my laziness.  Though I wake up at 5:30 am every day, the ritual of searching for my running attire and wearing them lazily take almost 20 to 30mins. Within these 30 mins my brain would remind me 100 tasks that are more important that this run. It's after all a simple run. It can always be done next day. If these tasks are not done, there will be apocalypse. Since they are so important tasks, they need better planning.
The best planning would be on a bed under a warn blanket. I returned back to sleep thinking that I need not feel embarrassed today. A thought that the lean old man at the corner of the road will not recognize me and feel pity about my condition. These thoughts justified my decision of better planning the tasks that will avoid apocalypse

Today, I am still lazy. If I don’t plan my run (search and keep my running shorts available upfront), I don’t give myself time to change my mind. I buckle up and lock myself out within mins.
I care for none. I am not embarrassed. I feel proud of my scars. I feel they are part of an artistic design, a unique way my body is tone. I love each and every spot/scar/flab I have.

I feel that the lean old man no more feels pity about my condition but is feeling proud that I am doing something about it.

Is that it? Changing from a full attire for a run to almost nothing because of laziness and/or unplanned way of life.

No it is not about the attire at all.
The transformation, I am talking about is about being protective of your body to being confident of what body we have.
From being embarrassed of your body to loving it. From being what others think to what we want. A transformation of procrastination to being active.

I am in the middle of this transformational journey. The gentleman whom I met today morning might have just started his journey. The journey is challenging and with lot of hurdles. I crossed my hurdles and faced the challenges. I am at the stage where the ride is smooth and I am enjoying it.
I wish that gentleman all strength to cross his hurdles and his challenges. 

Keep running and keep smiling

Wednesday, November 27, 2019

Disruptive Technology - Role of scrum master


Context

The disruptive technology is a technological innovation that creates a new market by disrupting or destroying the existing market and value.

Not all technologies or innovations are disruptive or revolutionary. Some of the technologies take time or additional improvements to cause a disruption.

Though the word disruptive technology is coined and popularized in 1995, the disruption of continuity was always there. Sometimes it was visible and sometime it is a surprise

Consider early days of transportation, the road transport of goods is mainly by animal driven carts and personal transport is by horses.  The invention of internal combustion engines in 1859 by Ettienne Lenoir and perfection of this by Nikolaus Otto in 1876 were potential disruptive technological evolution. The transport industry was not disrupted immediately.

The subsequent invention of Car by German inventor Karl Benz in 1886 (10 years later) too did not disrupt the industry. It was in 1908 when Ford Motors revolutionized the production of cars that transport industry was completely disrupted. It took 50 years and a series of technologies to disrupt the industry.

Some of the recent disruption would be in postal services caused by E-Mail; Computers in banking sector; photographs to digital photography; Mainframes to mini computers to personal computers and now to smartphones and tablets the pace at which disruption is occurring is ever increasing. 

It does not take fifty years to disrupt an industry now. It would be 2-5 years at maximum. If you put this in generations the lost generation saw one disruption in their life time whereas Gen Y the Millennial would be seeing at least 10 to 15 disruptions in their life time

Generation scale


Software industry is no less disruptive. It has several emergent technologies that can disrupt the current software product. Some of them are Machine learning, Cloud, SAAS etc that could disrupt the software product that we are managing.

Process changes are also disruptive. For example scrum process vs water fall method of software development process.

Managing a disruptive technology
Awareness is the key to manage disruption. Most of the time, the products disappear because they are caught off guard when an existing technology manifest itself as a disruptive technology. Understanding the potential of existing technologies, tracking its evolution of these technologies are some of things that can be done proactively

When a potential disruptive technology is identified, we should either
  1. Accept
  2. Defend
  3. Counter with similar technology

Accept is simplest of all strategies, in terms of investment. When a potential disruptive technology is identified ensure that the organization adopts this technology. This strategy is mostly a low risk proposition.

Defend is a strategy that is best when the cost of disruption is minimal. Stakes are low. This will only delay the disruption but not avoid disruption completely.

Counter is the strategy that can be adopted when you know there is an alternative technology which is also promising and easy to adopt. Investment is high in this strategy and risk is also high.

Role of scrum master    
It is essential that everyone plays an active role in managing a disruptive technology. As a scrum master, the role is to ensure the team members be aware of emerging technologies and be trained in the technologies.
He should ensure that requirements that are coming in are also looked at from prism of emerging technologies.

Incremental Learning
Scrum teams should not be off guard when organization adopts a strategy to manage a potential disruptive technology.
The cost of training ahead is much lower than cost of training or hiring when a strategy is adopted. There is an impact of cost of lost time and a potential fear of late start which can jeopardize the organization strategy.

Scrum master should encourage the team to explore the emerging technologies within a sprint. He/she should timebox some effort for this training, exploring emergent technologies, discussing/analyzing them in the context of current requirements.

Scrum master should allocate 8 hours per scrum member in a 4 weeks sprint. This seems to be a huge cost but in long run it will be beneficial to organization and individual members.

Currently if we consider 1 weeks sprint we have following structure of 1 week sprint.

Current 1 Week Sprint 

Scrum master should encourage the team to train 2 hours in emerging technologies in a 1 week sprint.
In backlog grooming meetings scrum master should encourage the team to look at the current requirements from the prism of emergent technologies. It is not necessary that the technology is adopted but discuss the possibility of different approach.

Proposed 1 Week Sprint Overview

Prism of emergent technologies
When the team meets for backlog grooming,  after securing the backlog, reserve the last 10-15 mins to discuss the backlog from the prism of emergent technologies.

The team should understand that this discuss has no immediate impact on the backlog that is groomed but is to encourage evaluation and validation of current requirement with future emergent technologies.

Team should try to answer some of the following questions
  1. Is there a way to achieve similar or higher value using any other approach or technology?
  2. How is the current value be improved?
  3. Is the current requirement valid if an emergent technology disrupts?  




More Reading

Sunday, October 6, 2019

My adventures with improving test automation


I want to share some thoughts and experiences that I worked on for over a year now - "Improving test automation in our product". It has be a great experience, learning and very challenging one for me.
Before I move on to my next adventure, I would like to pause, look back, retrospect and document my experiences and learning. 
Background
     Two years ago (2017) as part of an organizational goal, we had to improve our automation. Our product is a huge enterprise product with approximately 2.5 million lines of Java code (not counting Java script, angularJs, JSP, HTML, XML lines). The product has a code coverage on higher side of 30% with about approximately 90K tests. It had a good mix of unit tests, integration tests and selenium tests

Though we started writing tests for the new code where ever possible, It is the majority of critical old code that is not covered by any automation.

Goal
   - Our goal was to increase code coverage in critical areas by 8% in FY19.

Challenges:
While driving this effort, we faced several challenges.
    - Managers/team members were not convinced that unit tests for legacy code is possible or of any value.
    - Some generic questions/comments from my peer managers have been
  • What is the ROI of this effort?
  • Are we investing in right area?
  • How will it add value to customer?
  • Is the code coverage right metrics for judging effectiveness of automation?
  • With the effort spent on automation, I could have fixed more customer reported issues.
  • I have already spent improving code coverage in my area, but there are still large number of customer reported issues
  • My area has lot of automation tests and the maintenance cost of these automation is  huge. - we doubt if increasing tests an effective strategy
  • For more effective test automation, it should be end to end testing or UI based testing involving customer scenarios and it should be QA Engineers problem

    - Many developers are problem solvers and are not truely extreme programmers - equipped with test driven development - Automation tests/testable code is always an after thought

    - Some code areas are no go areas. No one dares to touch it and hence automation has always been on back burner.


Challenges can be broadly categorized into two
   1. Mindset problem
   2. Gap in skill set

Execution
Overcoming the mindset
   To be frank, though I have tried to reason with many managers about importance of focused effort of increasing automation and code coverage, It was very difficult to convince managers. The conclusion of all our private talks was, our product is different. It is legacy code and the effort is not worth spending.

Here are some of my views about this effort.

It is not worth spending the effort on automation for legacy product. It can be effective for new product
I don’t agree with this view. If the product is almost dead and/or is living on life support ( is on maintenance revenue,  the customers are not upgrading to new products or version) then it could be a case where we need to evaluate if we want to spend on such effort.

For a product that is  growing, such an effort can give the product a new lease of life. The effort can reduce the cost of testing by many folds. With greater automation, developer can get faster feedback of newly added feature which in turn will reduce the development cycles. A unit test help developers refactor and clean the code.

Is code coverage a right metrics for effective automation?
   Yes code coverage could be deceiving for a product like ours. Let's take an example, lets' say, I have 100 lines of code in my module and the module has automation tests that covers 90 lines of the code.
If the customer majorly uses features that are part of uncovered 10 lines, my 90% code coverage has no meaning. (In other words these 90 lines should be relooked at if they are really required. It could be that they are not needed in the first place)

In short mindless code coverage improvement is worthless. You would not achieve value.
 Before we start this kind of effort, we need to analyse the areas within the product that are critical and needs coverage.
   Some strategies could be where
  • There are more customer reported issues
  • The code is frequently changing
  • Critical "No Go" areas
  • Difficult to understand code.  

    Code coverage is one of output variable - "metric" which indicates that we are in right direction and at right pace.

The other outputs of effective automation are reduced customer reported issues, refactorability of code, increase developers productivity. These variables can only be measured in long run. We cannot measure these in a short term. For short term measure to guide us through this effort, code coverage seems to be the right metric.

It is an involved effort. What is the ROI of this effort? How do we measure the effectiveness of this effort at the end of the year?
    It definitely an involved effort. But once it gets rolling it becomes easier.
    The ROI of automation effort would be to reduced feature regressions and reopen or rework in long run. In short run it is improved code coverage.
To see the benefits we need to reach certain point of code coverage. – A tipping point. In my opinion it is at 60% of your code.
There are several input variable to achieve this
  • Focused and strategical automation efforts. No point in automating those areas where the footfall is less or rare.
  • Writing Unit test which will enable refactoring of code.
  • Covering customer or internal QA filed issues with automation (These are missed use cases)
  • Removal of dead piece of code. This can be easily identified after writing some unit tests.

It is legacy code. What is the point of automating to improve code coverage?
  More so, it needs automation. Tests also work as documentation which help us in future refactoring.
Those modules in functional areas which are currently stable, critical but don’t have automation test are good candidates to be automated first.

We lose out on new product development capacity?
Initially those teams who have less code coverage and spent less time in automation will have a pinch.
Once the teams mature and start a habit of coding with TTD, the new product development effort will increase, build breaks and rework will reduce.

Such focused effort may not go down well with developers?
The increase automation effort should not be projected as dirty work. It is managers duty to ensure it is projected in right way. Few of my thoughts here.
  • If you recall the progression of developers over years, they began with procedural programming, then to OOPS then to extreme programming. When we are taking this effort we are asking our developers to move on to become an extreme programmer. - Simple, effective, refactorable, testable coding.
A way to start is change the mind set of developers from fixing problems to writing testable code.

TDD works only for new code and new products?
May not be true. The first step in TDD is to write tests and keep refactoring. This works for old legacy code too.
  • It is managers responsibility to make this effort interesting. One interesting way is to spend whole team 1 day to automate. May be first day of the sprint.
    
What is the point of writing tests which have no meaning but only improves code coverage?
   Yes agreed. This is where teams should have strategy to go thru the customer filed issues and other available data to automate the critical modules and critical use cases. Automate those areas so that you would secure them from future regressions.

After all these explanation and reasoning , there are managers who still have problems with this effort.
Yes the benefits of this effort seems very less and invisible in short term. But the benefits of these if implemented correctly in long run will be huge.  

Gap in skill set
Writing unit tests for legacy code is a big challenge. Sometimes it is difficult for developers to write unit tests for legacy code without refactoring and refactoring cannot be done with confidence without the tests backing it. A vicious circle which needs to be broken by writing tests…

Developers need to be skilled in writing unit tests with mocks. There is a learning curve for some developers and managers need to understand this. The code reviewers have to be cautious in this phase as the unit tests sometimes can be  too shallow.

A pair programming with a senior developer will help learning writing tests quickly.
Coding forums will help propagate best practices of writing tests across the teams.

Our Plan for increasing automation

Increase in code coverage and improving effective automation can be achieved by following
  1. Adding more tests
  2. Refactoring tests and code
  3. Removing dead code

Adding more tests
Adding more tests should not be arbitrary. You need to identify which tests are apt.

Automation Strategy: 
Test automation pyramid pattern of test automation are ideal pattern for teams to reach. This pattern should be ultimate goal to reach for developing team.


Why automation pyramid?
If we look at the cost of test automation we have cost of creation, cost of execution and cost of maintenance.

The cost of automation depends on type of testing, availability of test frameworks and tools. There are good tools available for automation like junit, jsunit, jasmine, selenium. Assuming that every team has good tools and framework the cost of test automation mainly varies on type of tests.
 
  


Every time the code needs to be changed the automation tests need to be run

As the code keeps changing with more feature additions, there is an amount of maintenance cost associated with automation tests.  Test automation pyramid achieve more code coverage with optimal maintenance cost. 

To get the team to the best patterns of test automation, you need to understand where the team currently is.
Identify the teams with no automation, heavy on unit tests, heavy on integration tests or heavy on UI tests.
The goal of the module is to get a right automation pattern either by writing unit tests, integration tests and selenium tests  

Refactoring code and Remove dead code
As developers we sometimes believe that adding more code, more features are important and forget that clean-up is as important as adding new features. This effort gave us opportunity to clean up or refactor some code.


Conclusion
Though we have completed this exercise and met our yearly goal of improving code coverage, some of the "Nay Sayers" are still not convinced that the effort was wisely spent. The short term code coverage shows an improvement, but we don’t have reported metrics of increased developer and QA members productivity nor we have metrics to show there is reduction of customer issues.
The immediate change that I could see is a cultural change. The developers now believe that code written/changed has to be testable.


Some nice reads that helped me in the process

https://martinfowler.com/articles/practical-test-pyramid.html
https://abstracta.us/blog/test-automation/best-testing-practices-agile-teams-automation-pyramid/
https://www.guru99.com/code-coverage.html

Wednesday, May 4, 2016

Understanding Ramanujan's Magic Square & Creating your own Magic square

Few days back I watched the trailer of "The Man who knew Infinity" a film about Ramanujan, Greatest Indian Mathematician. It was a wonderful trailer and a movie worth watching. Search for Ramanujan you would find internet is full of Ramanujan's Magic Square. 

Srinivasa Ramanujan was born on 22nd Dec 1887.  The two digit numbers from his date of birth are 22, 12, 18, 87.
Using these numbers from his date  of birth Ramanujan created a wonderful square which, when you add four digits  diagonally, horizontally, vertically and different way would give you 139.


 

Now is there a pattern to this square?
 Looking at the square closely you will find that it has some pattern. If you consider the first row, It is Ramanujan's birth day in dd mm cc yy pattern. ie 22th day Dec month 18 Century 87th year. 
Rest of the numbers are close numbers (consecutive numbers) of 22, 12, 18 and 87 

The square is filled with unique numbers
Some of them are consecutive numbers
for example the numbers are 
  • 22,23,24,25           for 22 
  • 9,10,11,12               for 12 
  • 16,17,18,19,            for 18
  • 86,87,88,89           for 87

If I consider 22=a, 12=b, 18=c, 87=d then I have this square as
  • a, a+1, a+2, a+3
  • b-3, b-2, b-1, b 
  • c-2, c-1, c, c+1
  • d-1,d, d+1, d+2

I place this in a square, it looks like below and some lucky ones like Ramanujan can create thier own magic square.

For example if your birth day is say 28th Nov 1948 your magic square will be
 
Why only lucky few? 
Ramanujan's Magic square is based on the birth day digits.
For those born in Jan, Feb, March the square will go into negative numbers.

For those who are born in other months, but if the day is closer to century or to month or to year (for example 19th century, day between 14 to 20) will result in negative or zero numbers or non distint numbers, distorting the magic square.

For those who are born in 2000, 2001 or 1900, 1901 too the magic square distorts.
 
Who are the lucky few?
The person who is born after March, whose day is more than one more than century. 

Note: Some of these too will have non unique numbers when their date, month, century, year are too close (closer by 3)

Are you the lucky one? Do you have the magic square? 
Above are some quick observations. So try out with your date of birth to see if you have a magic square. 

Oh I dont have a magic square?
Actual magic square is based on distinct integer numbers. So that includes negative numbers too.

Unfortunately those born with number (Day, month, century, year) too close, you will not have a magic square.
 

What is its basis?
In Mathematics there is something called "Magic Square". 
Magic square is  an arrangement of distinct numbers (i.e., each number is used once), usually integers, in a square grid, where the numbers in each row, and in each column, and the numbers in the main and secondary diagonals, all add up to the same number.

The sum of every row, column and diagonal is called the magic constant or magic sum, M. Every magic square has a constant dependent on n order of square, calculated by the formula M = [n(n2 + 1)] / 2. For magic squares of order n = 3 squares, 4 squares, 5 squares, 6 squares, 7 squares, and 8 squares, the magic constants are, respectively: 15, 34, 65, 111, 175, and 260  
Ramanujan's Magic square is n=4 (4 squares) , but the squares are not fill with digits from 1 to 16 but with two digit from date of birth.

The original Magic square of order n filled with 1 to 16 digits would be  
 
 Ramanujan's magic constant is [n(n2 + 1)] / 2 + K
where K is (dd-1) + (mm-15) + (cc-14) + (yy-4)