"Eventually, they may even break into the building"
Starting 1985, and more intently after the election of Mr Rudy Giuliani as Mayer of New York, the hypothesis behind Broken window theory was implemented in an effort to reduce crime rate in the city. Most known elements of this initiative were "quality of life" and "zero tolerance".
"The broken windows theory is a criminological theory of the norm-setting and signaling effect of urban disorder and vandalism on additional crime and anti-social behavior. The theory states that maintaining and monitoring urban environments to prevent small crimes such as vandalism, public drinking and toll-jumping helps to create an atmosphere of order and lawfulness, thereby preventing more serious crimes from happening." Source: Wikipedia. Emphasis added.
Here's the same quote, slightly altered:
"The broken build theory is a behavioral theory of the norm-setting and signaling effect of poor software-development disorder and accumulating technical debt on additional quality and anti-social behavior. The theory states that maintaining and monitoring software environments to prevent small quality faults such as poor design, untested software and no refactorings helps to create an atmosphere of order and rule abiding, thereby preventing more serious faults from happening."
Paraphrasing on the concept, here are a few more gems:
"Consider a building with a few broken windows. If the windows are not repaired, the tendency is for vandals to break a few more windows. Eventually, they may even break into the building, and if it's unoccupied, perhaps become squatters or light fires inside.
Or consider a pavement. Some litter accumulates. Soon, more litter accumulates. Eventually, people even start leaving bags of refuse from take-out restaurants there or even break into cars."
And in our world:
Consider a project with a few bugs. If the bugs are not repaired, the tendency is for culprits to break a few more bugs. Eventually, they may even break into the project, and if it's unused, perhaps use it improperly or create damage inside.
Or consider an integration. Some technical-debt accumulates. Soon, more debt accumulates. Eventually, people even start attributing debt from other projects there or even hide malicious code there.
"The first vandals to arrive were a family"
"Zimbardo arranged for an automobile with no license plates and the hood up to be parked idle in a Bronx neighbourhood and a second automobile in the same condition to be set up in Palo Alto, California. The car in the Bronx was attacked within minutes of its abandonment. Zimbardo noted that the first "vandals" to arrive were a family – a father, mother and a young son – who removed the radiator and battery. Within twenty four hours of its abandonment, everything of value had been stripped from the vehicle. After that, the car's windows were smashed in, parts torn, upholstery ripped, and children were using the car as a playground. At the same time, the vehicle sitting idle in Palo Alto, California sat untouched for more than a week. Then Zimbardo himself went up to the vehicle and deliberately smashed it with a sledgehammer. Soon after, people joined in for the destruction. Zimbardo observed that majority of the adult "vandals" in both cases were primarily well dressed, clean-cut and respectable whites. It is believed that in a neighborhood such as the Bronx where the history of abandoned property and theft are more prevalent, vandalism occurs much more quickly as the community generally seems apathetic. Similar events can occur in any civilized community when communal barriers – the sense of mutual regard and obligations of civility – are lowered by actions that suggests apathy"
"This is a clear sign that the society has accepted the disorder"
So fixing a broken build, and not leaving it to decay is a good strategy for software quality. Right? Apparently yes, but not enough.
In his 1972 book, Defensible Space, Oscar Newman suggests that this is only part of the remedy. Presence of the police (or the CI team) is not enough either. It is equally important to foster a community that cares about the orderly environment. You see, Newman proposes that "regardless of how many times the windows are repaired, the community still must invest some of their time to keep it safe". If residents, or developers, for this matter, do not invest some of their own time making clear what is acceptable by vandals - or bug mongers, they will become apathetic.
"Newman says this is a clear sign that the society has accepted this disorder—allowing the unrepaired windows to display vulnerability and lack of defense. Malcolm Gladwell also relates this theory to the reality of NYC in his book The Tipping Point."
"[...L]eaves the residents feeling hopeless and disconnected"
So how come broken windows, or bugs, or poorly designed Java classes, are left broken, unfixed, or unmaintainable?
Wilson and Kelling, as well as other researchers, believe that the presence, or lack of, informal controls are the key to fostering such culture. Without those individuals don't feel it's their job.
"Wilson and Kelling found that studies done by psychologists suggest people often refuse to go to the aid of someone seeking help, not due to a lack of concern or selfishness 'but the absence of some plausible grounds for feeling that one must personally accept responsibility'"
In other words, people are afraid to either fix the problem, or to express their discontent with such harmful behavriors.
Moreover, "[Ranasinghe] adds that public disorder is “...unequivocally constructed as problematic because it is a source of fear.” Fear is elevated as perception of disorder rises; creating a social pattern that tears the social fabric of a community, and leaves the residents feeling hopeless and disconnected"
"Neighborhoods with a strong sense of cohesion fix broken windows"
According to the Broken window theory, people's presence signal their social norms to the environment. But when people are not around, the environment signals to individuals what social norms are.
If the window is broken when no one is around, this is an invitation to break another window.
If the class is broken when no one is around, this is an invitation to ignore another broken class.
"It is not so much the actual broken window that is important, but the message the broken window sends to people. It symbolizes the community's defenselessness and vulnerability and represents the lack of cohesiveness of the people within. Neighborhoods with a strong sense of cohesion fix broken windows and assert social responsibility on themselves—effectively giving themselves control over their space. The theory emphasizes the built environment, but must also consider human behavior"
"ignoring them likely greatly increases the chances of a troubling downward spiral"
Not only broken windows and streets and tarnished cars are affected by this theory. One prominent example is that of schools. The theory is that school students, when presented with disorder or rule-breaking behaviors, immitate the behavior.
KIPP adopted this theory, so they put emphasis, among others, on social behavior, and intolerance to antisocial ones. Founded in 1994, KIPP (Knowledge is Power Program) provides opportunity for under resources children to excel in their studies. KIPP schools show a high percentage of graduates, much higher than in their natural neighborhood, many of which continue to higher education. Stephen B Plank et al conducted a study between 2004-2006 and found that:
"...the findings of the current study suggest that educators and researchers should be vigilant about factors that influence student perceptions of climate and safety. Fixing broken windows and attending to the physical appearance of a school cannot alone guarantee productive teaching and learning, but ignoring them likely greatly increases the chances of a troubling downward spiral"
If it ain't broken, do fix it
Make no mistake. The behavior of software teammates is no different than that of any community. If teammates work on their own, in their room or cubic, with little interaction, and if low quality behaviors are socially accepted - you can expect that quality will be impaired. Moreover, those that do care for high quality might develop fear of insisting on their values, in particular if their builds (or windows) are broken.
They will talk among them in private, but they will not discuss it openly. The Broken window theory suggests that the reason is fear, combined with lack of social cohesiveness.
The olde programmer saying "if it ain't broken don't fix it" is a telling example of such frightful behavior. Of the intimidating, non-cohesiveness that cultivates a broken window philosophy.
If you want the build fixed - fix it, and the sooner the better.
You also have to understand that this is not enough. The build will be broken again - that's why we have CI systems.
And it will not get into a habit of fixing it without fostering a suitable culture.
You do this by acknowledging the build fixers, by creating structures in which people work together, by excelling in development (programming and testing) skills.
Because policing and sending someone to fix the broken window is simply not enough.
Source for building image: Wikipedia