Blogg
Här finns tekniska artiklar, presentationer och nyheter om arkitektur och systemutveckling. Håll dig uppdaterad, följ oss på LinkedIn
Här finns tekniska artiklar, presentationer och nyheter om arkitektur och systemutveckling. Håll dig uppdaterad, följ oss på LinkedIn
So you think you are in control of your software delivery process? What if I told you that your software delivery process is governed by laws just as the physical world you are living in? In this article, I will explore these often-hidden principles, helping you better understand the challenges and frustrations you may encounter in your daily work. I will offer practical strategies and suggestions to overcome these challenges and improving your teams ability to deliver software successfully.
What I will describe are not laws in a sense that implies inevitability as the physical laws. I like to think about these laws as mental models that will help frame and explain what we see in the world of software development. If you understand these mental models, they can be key to better planning, more effective meetings, and great teamwork. They could even lead to a more effective and fun software delivery process, which in turn leads to product success.
The team is on a roll; we have focus, flow and we have a goal. We feel so productive, we have finally found the space to put our heads down and get to work.
Then the boss comes in with the great news! They had found two new “resources” that would join the team tomorrow, to help us get back to the promised release date.
So much for focus and flow; now it’s gone. The next days and weeks are consumed by: Setting up dev environments for the new team members( and discovering the documentation is out of date and our machines have been tweaked in all kinds of ways); Replanning to find work for the new resources (which involves revisiting conversations and questions we already dealt with); getting new team members up to speed on domain knowledge, the system architecture and so forth; creating access tickets to various systems; getting to know the new team members and how to work together. The team is back to the storming1 phase.
After all is said and done, the delivery is four weeks later instead of two. That right there is an example of Brooks law in action!
Adding manpower to a late project makes it later
What can you do when a delivery is at risk of being late? Here are some ways that have worked for me:
“How many pull requests are merged each week for project Parachute?” Once we had the metric in place, the questions came. “Why are there not as many pull requests this week as it was the week before? We should have at least 15 pull requests merged a week!”
We start to create pull requests for every little thing, even for things that should be a unit of work and should have been combined in one pull request. Which leads to that we spend more and more time reviewing pull requests and fixing code conflicts, an extra overhead on our valuable time without crating value in code. Additionally, we incur increased costs due all the extra CI/CD runs.
Goodhart’s law states:
When a measure becomes a target, it ceases to be a good measure
Or restated, when we focus too much on one metric, we start to optimize for that metric even if it means neglecting other important dimensions.
Here are some things you can do avoid the pitfalls of Goodhart’s law:
“How long will it take to replace the third party component? We need to save on the license payment.” After carefully considering the ask from the stakeholder, I used knowledge of the system and component to come up with an estimate. The estimate contains a good amount of padding to account for unknowns.
I give an estimate of four weeks, which I was confident we could meet. Still, after four weeks, there is still plenty of work to be done before we could deliver. Why is that? Hofstadter’s law reminds us:
It always takes longer, even when you take Hofstadter’s law into account.
Several factors conspire to make this so: Life happens - Team members get sick, switch jobs or win on the lottery! We get pulled into new projects and ideas in the organization to provide information or feedback; The complexity turns out to be higher than you thought; And it turns out there is, in fact, a good reason why this is a third party component; And people are involved! And when people are involved anything can happen and will happen (see Murphy’s law); We as humans are not very good at comprehending all the variables that will affect a delivery. There’s so much we don’t know; Software development is inherently a complex task with lots of unknowns and exploration involved; We end up in recursive loops of estimations, development, learnings and so on. Even if you have done something similar before, there is always something that is new, novel or unknown that arises. Our work is rarely a linear, predictable process.
Is there a better way then spending time and energy estimating hours, days, weeks or what have you? Yes, there is!
Or shall we call it the Just one more thing, I’m almost done or I’m soon done law?
A common observation is when arriving at a meeting room on time and there is a ongoing meeting. As soon as I knock on the window, everyone packs up, closes the video call and stumbles out. Apparently there was nothing important being discussed at the end! Or vice versa, where I was the one in the room, quickly picking up my stuff and rushing out with the last conversation in mind, completely forgetting the decision taken earlier during the meeting, which was the purpose of the meeting to begin with.
Another situation is when you realize the project will be done before the delivery date and suddenly feel the urge to add “cool” and nice-to-have stuff, stuff that might ultimately cause the project to be late. The risk you take when starting something new to fill the time is that you might not have time to finish it. And you end up with multiple tasks in parallel and invoking Little’s law.
Parkinson’s law shows up in many situations such as meetings, projects and tasks and states:
Work expands so as to fill the time available for its completion
Here are some things you can do to take back the time that becomes available when you finish before deadline:
Little’s law2 is a very tangible and useful tool when analyzing and optimizing team workflow. This law is a little different; it actually have a formula! I first came across it taking college class about simulation, where we were to simulate wait times for customers arriving at a bank. It took me a while to connect it to the software engineering context where the team (teller) is taking tasks (customers) from a backlog (queue).
Bellow is how Little’s2 law looks like when applied to software and lead time, as I want to focus on getting value to customers fast
w = L/λ
Lead Time=WIP/Throughput
Where: Throughput(λ) the number of items the team can finish in a given amount of time. Lead Time(W) the time from when the team starts work on a task until the task is done. Work in Progress (WIP) (L) the number of tickets the team is currently working on in parallel.
To illustrate how WIP affects lead time, let’s consider an example (assuming the team’s throughput remains consistent).
Scenario with high WIP
Throughput(λ): 2 features/week WIP(L): 8 features in development.
=> lead time = 8/2 = 4 weeks
Scenario with low WIP
Throughput(λ): 2 features/week WIP(L): 2 features in development.
=> lead time = 2/2 = 1 weeks
The example shows that keeping WIP low can dramatically improve your ability to deliver value to stakeholders quickly.
Here are some things you can do to use and explore the impact of Little’s law:
The system had been load tested before the big event, everything looked good then! Still on the big event it went down due to contention over database connections. Now you’re frantically trying to restore service with a bunch of managers looking over your shoulder as thousands of dollars in revenue are lost every minute!
Things happen. And they will keep happening. The systems we work in are so complex that we humans can’t comprehend all its parts. The real world where the system exist is even more complex and messy. Which leads to Murphy’s law that states:
Anything that can go wrong, will go wrong
Something I like to add to this law (which I think I picked up when I did my military service): at the worst possible time
It’s valuable to keep Murphy’s law in mind when you build and design software. Always expect the unexpected and you will design better software. Since we can’t anticipate all the things that can and will go wrong, here are some things you can do:
Some of us get antsy when we finish a task or are blocked due to a dependency, and we immediately start looking for something new to pick up in the meantime, i.e., filling the time (Parkinson’s law). So we start something new, increasing our WIP (Little’s law), which in turn increases lead time and can cause the project to be late! (Hofstadter’s law).
When you add people to a team or project, the WIP (Little’s law) for the team tends to increase, but not necessarily the throughput, and you end up fulfilling Brooks law and Hofstadter’s law.
What interactions of the laws above have you observed and experienced?
These hidden forces might not be as rigid as the laws of physics, but their impact on how we deliver software can’t be ignored. The laws, or mental models, offer powerful tools for recognizing and understanding situations and behaviors, allowing us to take action towards a more effective and enjoyable software delivery process.
Pay attention to the secret laws that control your software delivery.