Showing posts with label quality. Show all posts
Showing posts with label quality. Show all posts

Saturday, February 8, 2014

Trying to Understand Why Kanban Works

Recently, I came across a book chapter explaining Little's Law; published by Massachusetts Institute of Technology. This chapter is an excellent read which is simple and yet digs into the heart of Little's Law. Reading about queuing theory is provocative and makes me relate many of the already established ideas to Lean software and Kanban.

One of the issues which I found this book chapter explaining very well is the difference between Little's law in its original formulation (which considers the Arrival Rate as one of the formula parameters) and its application in manufacturing systems (which replaces arrival rate with throughput). Here is an explanation:

Little’s Law
Little's Law state that:
L = λ W
where
L = average number of items in the queueing system
λ = arrival rate of new items to the system
W = average wait time for an item in the system
John Little argues that this law is robust and generic and holds exactly to any queuing system given an essential condition; which is "to have a finite window of observation that starts [when the system is empty] and stops when the system is empty" (p.88). Moreover, Little provides a mathematical proof for the law along with many applications in reality.

Little’s Law in Software Systems
Let's jump into software and map these concepts to Kanban. In Kanban, this is how Little's Law is stated:
WIP = Th * CT
where
WIP (average Work In Process) = average amount of unfinished items (bugs, user stories, change requests, etc.) in the development system
Th (Throughput) = Team output in unit of time
CT (Cycle Time) = Average time it takes the team to finish one item
Two basic differences between the two formulas: The first one talks about input or arrival rate, whereas the latter talks about output rate or throughput. The second issue is the condition which Little stated: that the system should start with 0 items and end at 0 items. In software, we rarely witness a system which has no maintenance requests.

To resolve these differences, Little indicated a more subtle condition of the Law to hold, which is no items to go inside the system and get lost or do not get finished, which he calls “conservation of flow” (p. 93). If we apply this condition to the system, we can easily show that the input rate = output rate, and therefore, we can relate Lambda (λ) with throughout (th).

For the second condition (system should start and end in 0 items), Little argues that the law “still applies, at least as an approximation, as long as we select a time interval that is long enough”. (p. 93)

What’s useful about this Law?
Little’s Law is a very powerful tool to use for managers. If we have two parts, and we can instantly calculate the third.

Increase team throughput
If your capabilities are fixed and want to increase throughput, the only solution is to increase WIP, and increase the team size. If this is not doable, and your input rate is high and getting higher, you may decide to decrease the cycle time instead of increasing the WIP and this may involve automating the deployment process.

Stabilize Cycle time
If you are struggling to stabilize the process so that to meet some SLA, Little’s Law gives insight about what to change in the system. You may either increase/decrease with WIP or empower your team to meet a specific SLA.

Study behavior of specific request types
Little’s Law works for a sample of item in the system as well. You may zoom into the items in the system and study the dynamics of a specific segment (like high severity bugs, for instance).

Wednesday, August 19, 2009

Why collect measurements?

Two main reasons to collect measurements:
  1. To track your project. A basic task of any software project manager is to track the project progress. Examples are the defect rate, the size of finished functionality versus not finished. A very good technique which reads this measurement and displays it in a graphical format is the burn-up/burn-down charts which are heavily used in Agile development.
  2. To improve the process of producing software. Very similar to six-sigma projects, CMMI level 4 and 5 have techniques which starts with an evidence of a mal-functioning process (most commonly supported by measurements).Then, it digs into the root causes, and suggests corrective actions. Finally, it designs measurements to quantify the impact of corrective actions, and start over again. This ‘Continuous Improvement’ cycle is one of the techniques used in any engineering discipline.
Measurements are an invaluable means for management, especially for software development, which is a deep intellectual engineering discipline. I may safely say that without measurements, you may not reach good management decisions what so ever. One of the sayings that is said again and again in Balanced Score-Cards environments is that “you cannot manage what you cannot measure, and you cannot measure what you cannot define”, is really true.

Wednesday, January 28, 2009

All of them are victims, the customer, and the development team!

Very interesting situation. I’m now out-sourced as a project manager to manage some of the IT projects developed by the company I work for. The client is a big telecom customer of my company. In this case, I deal with the end users of the systems and see and hear how they think of the development team. On the other hand, I deal with the development team closely, and they consider me “on their side”, not on the “enemy/customer” side!

The customer is really suffering. He suffers from so many delays, unexpected results while testing, misunderstandings, unmanaged expectations, resistance of changes in requirements, et cetera. In summary, at best, the customer is suffering. The customer says that the IT was much better in the past, but now, they think that the development team is incapable, but they can’t escape dealing with them because simply speaking, all other vendors are alike or even worse!

On the other hand, the development team is also suffering. They suffer from the changing business at the customer side. They suffer from the large scale of the software size, while there is no central architecture team. They also suffer from other things, like the oppressing environment created by middle management who are also oppressed by the frustrated customer. They finally suffer from the fact that they are not appreciated by any means! All what they hear is that the customer is frustrated because so and so, but they are never rewarded of the tremendous amount of effort they exert.

Both of them, the customer and the development team, are victims. None of them should be blamed. Yes, none of them should be blamed.

The fact is that it is the methodology which should be blamed for such miserable situation. There has to be a change in the attitude, a paradigm shift in the operation of producing software. Techniques like iterative development, incremental delivery, automated tests, continuous customer involvement, and central architecture team are all critical success factors.

I’m afraid this situation is becoming the norm in software development. It started to be an accepted situation that software development is a difficult field and we have to accept all these issues as normal and cope with it; very similar to a situation where one has a disability and he has to cope with it!

I’m feeling so bad for these suffering people, both in business and in development.

Sunday, July 13, 2008

Regression bugs, are they really a sign for bad quality, or for innovation and improvement?

The definition for a regression bug may vary from one organization to another. In this blog, I will use the definition of the regression bug as appears in the Wikipedia:
“Regression bugs occur whenever software functionality that previously worked as desired, stops working or no longer works in the same way that was previously planned. Typically regression bugs occur as an unintended consequence of program changes”
In all organizations that I worked for, a regression bug is a big scandal. KPI's are set to count number of regression bugs for every developer, and for every component or business area. There may be another grouping level to categorize regression bugs before and after deployment. While we should acknowledge that a regression bug gives a very bad impression about the development team and the product quality, we should also ask several questions:
  • In which context was this bug opened? Was this a refactoring effort for improving the code? Or was it a side effect of normal day to day development?
Rod Johnson, in one of his excellent lectures: "Why J2EE Projects Fail", identified 10 reasons why projects fail. One of these was not being open for refactoring and change. If regression bugs are due to improvement, or refactoring effort that is done to enhance to code, then, this bug should not be counted against the development team.

Counting such bugs against the development team, and evaluating them accordingly, will effectively kill the open atmosphere for change. If the project old code is never touched, and the team is intimidated not to do so, then the product code will deteriorate over time, the level of complexity will rise, simple bugs will become complex, and complex bugs will become sever. At one point of time, maintaining the product will cost so high and customers will search for other solutions.

Ok, what should be the solution? Here is the key:
  • Never do a refactoring for a component except after writing automated unit tests for the component functionality. This is like writing a contact with the code. If the code does not keep this contract, simply do not deploy the code. For a simple guide for stages of refactoring legacy code, refer to my later blog: Measuring the Progress of Code Refactoring.
  • Write automated test scripts for old bugs. Bugs show a tendency to be reproduced. The reason is that developers think the same way. If a component is refactored or re-written, the bug that the first developer fixed sometime ago and never wrote a test script for it; this bug surely will be reproduced by the developer who is refactoring or re-writing the component.