Counterintuitive facts of software development
…So you are to manage some software creation. Then you must understand you cannot simply employ the same techniques used to manage other domains. Software creation is strange – many counterintuitive truths about it. You will fail unless you learn about these weird realities.
This series contains these posts:
- How to hire a development team
- Counterintuitive facts of software development
- No estimates
- On the use of harmful tools
The book
One of the most interesting and lasting books about software development was written in 1975. That's "The Mythical Man-Month" by Fred Brooks.
On Waterfall
I will base this post on famous quotes by him, mainly from that book. Always in italics:
"The Waterfall Model is wrong and harmful; we must outgrow it."
Yep, that's what you learned in the first post in this series. Brooks already knew it.
Brooks' Law
"Adding manpower to a late software project makes it later."
The above sentence is known as Brooks' Law. It's probably the most famous quote from his book. It sums up one of the most interesting and counterintuitive things about software.
Suppose you are managing a team and the project is late. To fix the situation, you hire one or two more people. You do this because more people will certainly get more work done.
One month later, maybe two months later even, not only the situation hasn't improved, it's gotten even worse. You wonder why.
First reason for Brooks' Law
The most important reason is that communication overhead increases when someone enters the team. All sorts of information must be asked by the newcomers and answered by old team members:
- about the domain (e.g. accounting in an accounting system)
- about how things work in the system
- about why things have to be this way
- about why the team works a certain way
- about difficulties using the tools
- about the correctness of one's own work
- etc.
The communication need is so intense that weeks can pass before a new team member becomes properly productive, and while providing explanations, the experienced team members also have their productivity impacted.
You want to know how to make this even worse? Try to preserve the experienced team members from communication up to a degree, or even entirely. Now the newcomers have no clue what they are doing and have no way to learn valuable things that were already in the culture of the company. This is because a great amount of knowledge in the team is tacit, not explicit. Only communication makes it explicit.
And that is no way to treat a new team member, of course. It conveys that experienced team members are too busy or too valuable to teach anything to the noobs. This leads to conflicts and hurt feelings and hurts team formation.
There is no way to avoid the need for communication, because, in a way, software development is knowledge production. Every new person increases the communication overhead dramatically, leading to miscommunication, coordination delays, and diminishing returns.
As a rule of thumb, the larger the development team, the more time needs to be spent in communication, even after everyone is onboard and productive. As Brooks says:
"The number of communication paths increases with the square of the number of people involved."
This is a good argument to keep software teams small. And this is why in Agile no team is larger than 12.
Second reason for Brooks' Law
"Nine pregnant women cannot produce a baby in one month."
This is one of the funniest. Brooks explains:
"When a task cannot be partitioned because of sequential constraints, the application of more effort has no effect on the schedule. The bearing of a child takes nine months, no matter how many women are assigned."
This is about activities and decisions that depend on the completion of others. A manager needs to understand how such dependencies happen in software development.
"Men and months are interchangeable commodities only when a task can be partitioned among many workers with no communication among them."
This means, only when bits of work do not depend on each other, can they be done at the same time.
On business analysis
"The hardest single part of building a software system is deciding precisely what to build. The most important function that software builders do for their clients is the iterative extraction and refinement of the product requirements. For the truth is, the clients do not know what they want. They usually do not know what questions must be answered, and they have almost never thought of the problem in the detail that must be specified."
The entire development team does business analysis: they try to understand the steps through which work needs to be done. That quote is amazing near the end. It is often said that clients only know what they want after they see what they don't want. Meaning the team presents a design first, and then the client can see flaws in the design and correct it. But the client is unable to describe what is desired before they see the design.
The last sentence... "in the detail that must be specified"... is explained in another terrific quote:
"Design work doesn't just satisfy requirements, it elicits them."
Meaning, the requirements exist, but are not known by anyone, until a design suddenly makes them obvious.
Also, the design must go through iterations. Each iteration allows the team and the client to discover new weaknesses and needs:
"Even the best planning is not so omniscient as to get it right the first time."
Every now and then, no argument will convince an egoic client with enough bad taste:
"Einstein repeatedly argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer."
Software designers are strong in a certain kind of abstract thought, which allows them to see shapes of solutions that apply to many different problems.
"I am more convinced than ever. Conceptual integrity is central to product quality."
I found the same thought expressed in another quote:
"Conceptual integrity is the most important consideration in system design."
Software follows and materializes rules. You cannot establish rules unless you are thinking very clearly. In software as in law, good rules are based on sane concepts; bad rules use bad criteria. Confused concepts will always hurt decisions made by or with the software.
It's not requirements
The word "requirements" is still used, but now it's wrong. None of those are required. They are just ideas, and their priority is always shifting as the business learns about the market, about itself, about current needs etc. Many of those ideas necessarily will be discarded, which wouldn't happen if they were requirements.
An Agile team treats potential features as ideas, not requirements. This clarification is repeatedly made by Jeff Patton, inventor of the Agile technique of Story Mapping.
Bugs are priority zero
Some people have a notion that they are going to manage bugs. They think they can list the known bugs and decide which ones to fix. They want to save developer time spent on bugs!!! That's outlandish.
A bug usually is bad behavior whose origin is unknown. If you are seeing 2 buggy behaviors, they might have the same origin in the code (in other words, they might be the same bug).
If you let bugs live, they can get compounded. A bug interacts with another bug, creating a third bug. At this point, no sane person can understand what is going on with the system.
If you try to manage bugs, basically you don't understand what the hell is going on anymore. It is hard enough to reason about working software; who can reason about bugs?
The notion of managing bugs is as absurd as the idea of managing mysteries.
The only sane thing to do about bugs is to squash them as soon as they are seen. Now maybe you can reason about your system.
If I wished to reason about insanity, I would have studied Psychology, not Computer Science.
More than 40 hours a week hurts the project
Programming is an activity that requires a very high level of concentration. The brain works very hard and gets tired.
When a programmer is overworked, his productivity goes down, he feels tired, his concentration is feeble and his decisions are worse. The quality of the software goes down and sometimes the programmer can produce more bugs than features, effectively hurting the project.
A developer must work 40 hours per week, tops. No more.
Do not pressure developers to work faster
The business wants software produced as fast as possible, so it puts pressure on developers.
Developers have only one way to deliver faster: drop the quality of the writing.
So the software is now more buggy and less maintainable.
Now the business pays the price of the bugs, which is enormous (annoyed customers, no satisfaction, no word of mouth etc.). Fixing bugs also gets exponentially costlier as time passes:
- Fixing a bug in the developer's machine costs ~2 minutes.
- Fixing a bug in the staging environment costs around an hour. One has to fix the bug, then deploy the fix, then let the customer know it got fixed.
- Fixing a bug in production takes a day in some cases, because data is already wrong for the users. If it's not a web app you also have to push a new version out and its adoption will vary according to the effectiveness of the software update system.
You can sort of understand this if you think of an author writing a novel. You as an editor tell the author to hurry up. So the author forgets to do certain edits. Now the character that got killed in chapter 6 suddenly reappers in chapter 18 without any explanation.
In software this is much worse than in a novel. To compare, you'd have to turn the novel into a virtual reality. Now you have a Shrödinger's cat who is alive and dead at the same time. What could be worse than that in software?
But that is not the only bad consequence. Badly written software is harder to change. This means future tasks take much longer to accomplish. So you thought you were saving some time, and maybe you did if lucky, but you've hurt the entire future of the project.
Robert C. Martin expresses this concept best:
"The only way to go fast is to go well."
Pressure your developers and suffer the consequences.
In Agile, the quality of the code is not negotiable. It takes as long as it takes. Bad managers need to get a clue.
Technical debt
No novel is written right the first time. Every romance needs a few rewrites to become really good. Software is similar. Some parts of the software need to be reformulated, because it is impossible to get it right the first time.
Even if you don't have bugs, you have badly written parts. You are paying for these parts each time a developer needs to read them or change them. So they are worth fixing even if the fix does not change the external behavior of the code.
In a novel this would be the same as telling the same sequence of events, but telling it in a better way. Maybe the order of the chapters change. Maybe it's the vocabulary and the wording. The story itself doesn't change, but the novel becomes much better. Prevent the author from doing his rewrite, and you are hurting sales. Also worth remembering: sales aren't the only thing that matters.
Ward Cunningham is an Agile developer who is one of the creators of XP (Extreme Programming). He also invented the wiki – the notion of a collectively edited website in which creating and linking pages is very easy to do.
In this video, Cunningham talks about how he coined the famous metaphor of "technical debt" to explain to non-technical people the necessity of refactoring code.
Basically, rushing the software out the door (badly written, hard to understand, hard to change) is initially good for business, but it is like taking a loan. The debt must be repaid in the future, by spending time to refactor the software, so it becomes again easy to change.
Woody Zuill expresses the same thing in more broader terms. He says "teams and managers should spend the time to make the work easy to do".
Refactoring, and fixing technical debt, is about making future work easy to do.
Truck number
Some teams have programmers "own" parts of the codebase. Joe is the one who understands this area. Sue is the one who can fix problems in this other area. The devs are experts in parts of the code.
That's the worst way to distribute expertise. It results in low Truck Numbers.
What is the smallest number of people in your project that, if hit by a truck, would put the project in trouble? That's your Truck Number.
If only Derek can manage the positronic code, then your Truck Number is one, and that is too low.
The solution is obvious. Nobody can "own" a part of the code. The entire codebase is collective. Everyone works on everything.
This forces the team to share knowledge, resulting in a better team.
Pair programming
We have just seen how important it is for the development team to be constantly sharing knowledge.
That is one reason to program in pairs.
If an experienced dev works for a few hours with a novice, teaching is automatically taking place.
There are more reasons, too.
- The one on the keyboard (called driver) is helped by the other one, who does research as needed and removes other blocks.
- Better automated tests are written, since one remembers what the other one may forget.
- The code is examined by two people as it is being written. One sees the bugs of the other. The quality of the result is much higher, with much fewer bugs. No code review step is necessary.
- The alienation and isolation typical of a software development job are eliminated. People are interacting again. Having fun at work.
This is just one more strange thing for managers to realize. Managers who don't know about pair programming think it's waste. Two people doing the job of one. Nothing further from the truth.
Pair programming is one of the prescriptions of Extreme Programming, an Agile methodology.
Don't tell me how long it will take
After working with a software development team for a while, a manager begins to feel how easy or difficult tasks are going to be, even if she never does any task herself.
Sooner or later she catches herself saying in a meeting, "I assume that's only going to take five minutes to do". That's natural, but please, blush when you say that.
First of all, nobody knows how long it's going to take. Not even the developer. Because he hasn't done it yet. If it's more than changing static copy on screen, it could vary.
Second, it's arrogant, defying and disrespectful. Writing software is not frying pancakes. More about this in the next post, about NoEstimates.
Conclusion
If you've read this far, congratulations: You have just remembered universal truths about software development that have been known since 1975 at least. But these are frequently forgotten, which is a shame to those involved.