What exactly does it mean to steal code? That's a question at the heart of video game company ZeniMax's $2 billion lawsuit against Facebook—a suit serious enough that Mark Zuckerberg himself took the stand this week in his company's defense.

The case revolves around Facebook's $2 billion acquisition of virtual reality company Oculus in 2014. ZeniMax claims that Oculus CTO John Carmack, best known as the creator of the video game Doom, developed core parts of the Oculus Rift while employed at ZeniMax. Now ZeniMax tech is powering Facebook-owned Oculus' products without permission, the plaintiffs say. Carmack, meanwhile, asserts that Oculus founder Palmer Luckey is the true creator of the Rift and that none of his ZeniMax work found its way into the final product. To decide who's right, jurors will have to parse a question that's at least as philosophical as it is technical.

"It's an issue that goes back to some of the earliest code-copyrightability cases, when software still arrived as code in printed binders," says Fred Jennings, a technology and intellectual property lawyer at Tor Ekeland, PC.

As a program grows in size and complexity, the number of ways to express an idea in code also grows.

Oculus claims that its products contain not one line of ZeniMax code. But software doesn't need to copy code line for line in order to violate intellectual property law. In patent cases, for example, the code doesn't even need to be similar. But ZeniMax isn't claiming that Oculus infringed its patents—it's claiming that the company infringed its copyrights. Still, Jennings says it's possible to violate software copyrights without using the exact code found in the original program.

The issue is a thorny one. In some cases, it's not unreasonable to assume that two programmers will write remarkably similar code to solve the same problem. After all, even though many programming languages provide multiple ways to accomplish a particular task, there is still a limited number of different possible ways to express an idea with code. There is an even smaller number of ways to accomplish those tasks efficiently. But as a program grows in size and complexity, the number of ways to express an idea in code also grows, creating opportunities for a programmer to essentially "paraphrase" ideas taken from another programmer's work without actually doing anything substantially original.

Parsing Innovation

Despite the complexity of the issue, courts have a well established procedure for determining the similarities between two bodies of code. The Abstraction-Filtration-Comparison test goes back 25 years to the decisive Computer Associates Int. Inc. v. Altai Inc. case of 1992.

The first stage of the test differentiates between the idea of a piece of software and the expression of that software. For example, the idea behind a particular piece of software might be tracking the position of your head based on data from an accelerometer embedded in a pair of VR goggles. The expression would be the code itself that address that idea.

The second step is to filter out the parts of the code that aren't subject to copyright. That includes chunks of code that are too universal to be copyrighted and code in the public domain.

Then the court compares what's left. But remember, even here the remaining code doesn't have to be copied line for line. For example, a court decided that Google had illegally copied portions of Oracle's Java programming language in the creation of the Android operating system, even though Google wrote all of its own code from scratch.

Many other factors are at play here. For example, if ZeniMax can prove that Carmack worked on Oculus software while still employed at ZeniMax, that could mean that ZeniMax owns that work, even if it is substantially different from code previously owned by ZeniMax. And much more about the case remains hidden from public prying. "As is common in cases involving trade secrets claims, many docket entries in the ZeniMax case are sealed, so outside parties aren't able to see them," Jennings says. "It's very hard to say, without guessing, what details those filings might contain, and how they might bear on the copyright issues."

Jurors won't have to guess. But they will have to think very hard about what innovation and originality mean at a time when copying a billion-dollar idea is as simple as cut-and-paste.