How to Write Better Code

More
Researchers take an empirical approach to the human processes of collaboration and creation, searching for ways to improve

collaboration-body.jpg

Software engineers make mistakes, and those mistakes can prove costly. In a feature story in American Scientist, Greg Wilson and Jorge Aranda take a look at the science of improving coding. One interesting finding:


In 1967, only partly as a wry joke, Melvin Conway coined his eponymous law: "Any organization that designs a system ... will produce a design whose structure is a copy of the organization's communications structure. In other words, if the people writing a program are divided into four teams, the program they create will have four major parts."

Nachi Nagappan, Christian Bird and others at Microsoft Research evaluated the validity of Conway's law by examining data collected during the construction of Windows Vista. Vista consists of thousands of interrelated libraries and programs called binaries. When an error occurs, the breakdown can usually be traced to a fault in a single binary or to a breakdown in the interaction between binaries. Nagappan, Bird, and their team used data mining to explore which aspects of software construction correlated with faults. They found that when work occurred in alignment with Conway's law -- that is, when the structure of the team and the structure of the code mirrored each other -- code contained fewer bugs, whereas work that crossed team boundaries increased failure-proneness.

Nagappan and his collaborators then used their data to predict failure-proneness by locating code produced by multiple groups or at the interface of multiple groups. Contrary to digital folklore, they found that geographic separation between team members didn't have a strong impact on the quality of their work. What did matter was organizational separation: The farther apart team members were in the company organization chart, the greater the number of faults in the software they produced.

The article gives a solid overview of efforts to study, empirically, why and where engineers make mistakes. They ask "Can the quality of code be measured? Can data mining predict the location of software bugs?" With data about coding, bugs, how many people work on a project, and so on, now available in archives such as the University of Nebraska's Software Artifact Infrastructure Repository, NASA's Software Engineer Laboratory, and an online database called CeBASE, researchers can look for patterns of failure and success.

In certain instances, of which the work of computer coding is one example, even the messy, human processes of collaboration and creation can become data. Once that data exists, it can be crunched, and patterns can be found. What we find may merely confirm our intuition -- probably many would suspect that errors crop up when people work across team boundaries -- but to be able to back up intuitions with data can give them greater power. 

Jump to comments

Rebecca J. Rosen is a senior associate editor at The Atlantic. She was previously an associate editor at The Wilson Quarterly, where she spearheaded the magazine's In Essence section.

Get Today's Top Stories in Your Inbox (preview)

Video

More Video
Here's What Happens When You Light a Fire in Space


Elsewhere on the web

Join the Discussion

After you comment, click Post. If you’re not already logged in you will be asked to log in or register. blog comments powered by Disqus

Video

Miami: The Next Big Start-Up City?

How the city became a center for innovation

Video

Video

A Brief History of Romantic Comedies

From The Atlantic's Chris Orr

Video

Life in 'the New Arctic'

A moving portrait of a fading landscape

Video

Video

The Rise of New York City

A fascinating look at Manhattan in the 1940s

Video

What Is Methane Hydrate?

"Flaming ice" is a vast natural energy source

Video

NASA's Time-Lapse of the Sun

Now with epic dubstep music

Video

Shaken Not Tuned: Cocktail Experiments

Can a tuning fork improve a cocktail?

Video

Video

Is He Cheating? A 1950s Guide

'That little blonde secretary from the office?’

Video

New Yorkers: Vintage Vacuum-Tube Amps

Risking electric shock to restore old amplifiers

Video

The DIY Piano-Bicycle

Everybody needs a hobby

Video

What Does It Take to Make Real Craft Gin?

Tour the Green Hat Gin distillery

Video

What Straights Can Learn From Same-Sex Couples

New insight from decades of research

Video

The End of the Mall Rat

A tribute to that pillar of teen culture

Video

The Wonderful World of Capitalism

An adorable 1950s cartoon

Video

New Yorkers: Miss New York USA

An unconventional beauty queen.

Writers

Up
Down

More in Technology

In Focus

Protests Spread Across Brazil

Just In