Collective Code Ownership

Alternative to CodeStewardship.

ExtremeProgramming considers code to belong to the project, not to an individual engineer. As engineers develop required functionality, they may browse into and modify any class. They are responsible for keeping all the UnitTests running (and writing new ones for new functionality). They take on the same integrity-preserving duties as the class owner in a CodeOwnership situation.

Working in this mode lets a responsible team move quickly to add new functionality while keeping responsibility in the right objects. CodeOwnership creates dependencies and bottlenecks when implementing UserStories. We avoid code ownership, because it conflicts with commitment from the PlanningGame. ("Code is nothing, stories are everything!")

The ability to make this work requires at least:


Okay, this is where I see the scaling difficulties coming in. Collective ownership of anything doesn't scale. If Bill and Ted own a radio, and Bill wants to listen to one station while Ted wants to listen to another, they need some system for resolving their difference.

In software, it's easy to clone a radio. Bill can listen to what he wants and Ted can listen to what he wants. But if Bill and Ted are trying to use their radio programs as input to a design decision (say, what kind of guitars to buy for use in Wyld Stallyns ... in software, say, what kind of GUI to build, or what database product to use) then you have trouble brewing. Multiply the situation by 100 developers and a year-long project full of crucial decisions, and you have a TragedyOfTheCommons.

So there are a number of ways of resolving this:

So this last bit is where I think a StoneSociety could be useful. Make interface alternatives, tool purchasing, human-resourcing, standards and design decisions subject to Auction. Let development groups form and unform naturally as Sub-Societies. Use Services to fund internal infrastructure projects. Replace politics with a free market.

-- PeterMerel

You think an unusual form of democratic voting will eliminate politics? -- JeffGrigg

Consider CodeStewardship. It works well, and with low overhead. -- DaveSmith

Contrary to what Peter maintains, decomposing into subsystems and practicing CollectiveCodeOwnership inside the subteams can work quite well. We work with a large System and four different labs on the same project (~30 developers). Subsystem integration is done once a week. If we have to make a change to some part of the system in order to implement a feature, we request the change from the other team. Most of the time, the change can be done without breaking the interface between the subsystems. In that case, we postpone our work to the next build. If the change has to be done NOW or the change is breaking, we get the code changes before the next build and integrate it into our local copy of the other team's code. If we make a mistake and the build breaks at integration time, we have to fix it then. This almost never happens. The team leaders negotiate which changes are done for a particular build if some conflict arises. A published work plan keeps everyone informed when to expect some change they require. The whole thing sounds complicated, but in practice it most often amounts to writing an email ("can I have this API in the next build?" "Yeah, sure"). -- ThomasMaeder


From ThoughtfulReactionsToXp:


I was thinking about CollectiveCodeOwnership a little while, and I wonder: If I don't like doing GUI, but I'm really good at the other tiers, should I be rotated into GUI pairs anyway? My gut instinct is to say, "No", with a caveat. There may be grotty parts of the system that everyone fears working on. In this case, I'd imagine the group should encourage pairs to bite the bullet and do it anyway, and then the next time a grotty issue came up, the volunteers would be free from the responsibility of having to work on it. -- JohnDuncan

Within XP problem is solved that ProgrammerChoosesTasks.


KentTheBeck writes in SmalltalkBestPracticePatterns (p.14) that "The next bottleneck in software engineering is human communication. When we say that 70 percent of the development budget is spent on maintenance, we mean that the poor maintainers have to wade through piles of documentation and code to discover the intent [emphasis added] of the original programmer. The advent of widespread reuse exacerbates the problem. No longer is one maintainer the audience for one developer. Hundreds, thousands, or hundreds of thousands of elaborators are trying to understand the intent of an abstractor [emphasis added]."

FredBrooks writes in TheMythicalManMonth (p.42) that he "will contend that conceptual integrity is the most important consideration in system design."

So I have a question for the CollectiveCodeOwnership advocates. How, in a CollectiveCodeOwnership scenario, is ConceptualIntegrity preserved? How is it ensured that elaborators working on classes created by an initial abstractor understand the intent of that abstractor? Is it ensured by reliance on shared understanding of, and commitment to, a SystemMetaphor and some coding standards? Is ConceptualIntegrity subordinate to the refactoring motivations of the day?

The reason I ask is because preservation of ConceptualIntegrity is usually presented as one of the arguments for CodeOwnership. If I remember right, the EnvyDeveloper manuals even presented this argument as rationale for some of the philosophical decisions evident in the tool's design. IMHO CodeStewardship, with some kind of apprenticing of future elaborators to original abstractors (if possible), may be the solution that balances the forces. Thoughts? -- RandyStafford

I would argue that ConceptualIntegrity is independent of CodeOwnership. Regardless of how you divide up the code for development, everyone on the team, now and in the future, needs to have a common understanding of the purpose of the project and approaches being used. Tying together individual modules, each with their own "ConceptualIntegrity" won't do it. Everyone needs to be in agreement across the project. -- WayneMack


In our extreme lab, we do use collective code ownership. Sitting in the same room eliminates the communication delay between potentially competing factions for a piece of code, and speeds delivery of modifications. We rotate pairs purposely, and while the methodology says that the developers choose the tasks, occasionally we throw in the requirement that "For today, you must choose a task involving the part of the system you know the least about." We find that this avoids weak spots among the team quite nicely, and we get no "information sinks" because one person concentrates on a particular aspect of the application. -- AndrewChronister?

-- Collective code ownership sometimes is just a code word phrase for management saying that you can be tossed out at any time. ie: Someone else knows what your doing, and if you don't toe the line, we can easily replace you.

Code ownership also ignores the fact that programmers have different skills. Getting the internet wizard to do the graphics is silly. And vice versa. Surround me with other good programmer's, and code sharing is as natural as breathing. Surround me with idiots, politicians, or the owner's brain-dead nephew, and I'm going to protect the tricky bits, not out of ego, but because I don't want their paws mucking around and destroying things. 'Last Project Failed' doesn't look good on my resume.

Another thing, management then figures that if the old pro is gone for a few days, the junior programmer can just jump into his code and keep going. This just doesn't work.

3 or 4 guys, CollectiveCodeOwnership works. If they all depend on the venture for their bread and butter, even better. But get more than 1 manager and 7+ programmers, and it's all just another methodology.

How can you all work together in the same room? Again, 3 or 4 guys that get along, have known each other for some time, or instantly 'hit it off', it works. Get 12 guys thrown together, someone's going to start the politics. The noise is unbearably when you're trying to get into the zone.

CollectiveCodeOwnership sounds almost Marxist. GOOD programmers are craftsmen. They deserve some respect for their individual skills and effort. Linus keeps the kernel to himself.

And let's think about this for a minute. With everyone working on everything, there is NoUltimateResponsibility. Passing the buck runs rampant.

I've seen a lot of methodologies come and go. If it were possible to codify up the knowledge of a good programmer, someone would have written it up into a piece of software called 'Programmer 2000' and we'd all be out of work.

-- An old programmer

From what I read in ExtremeProgrammingApplied, CollectiveCodeOwnership doesn't mean NoCodeOwnership?. Therefore, if someone breaks the code, it's his responsibility to fix it. And he can't commit change until it passes UnitTest.


ExtremeProgramming relies on the TEAM concept. A team is not a group. DeMarco perfectly describes what a team is. So I believe that collective code ownership works very well in a team and does not work in a simple group. Naturally, a team cannot be created in a group exceeding 7-9 members; it cannot be created if the group contains a critical number of morons or idiots. It cannot be created if members are physically separated. Peopleware contains a full list of reasons that prevent a team "gelling". No team - no collective code ownership, and I believe no ExtremeProject.

Regarding responsibility - team owns responsibility. This is not "I thought HE was going to fix that." It is "This is my fault because I did not make sure we fixed everything we had to". -- RomanEremin?


See also TheCathedralAndTheBazaar, JustStopCaring


EditText of this page (last edited April 23, 2012) or FindPage with title or text search