It’s not just the Honor Code that prevents students in computer science classes from cheating — the department employs the Measure of Software Similarity Program (MOSS), written by Prof. Alex Aiken, to systematically to test student code against every section of code ever run through the system.

Talk about pressure.

The Computer Science Department annually reports the highest number of Honor Code violations on campus, with 71 from the fall of 2003 to last spring, including 23 during the 2005-2006 academic year. Aiken, however, said that these figures may reflect the vigilance of professors in his department, rather than a higher incidence of cheating among those students.

“A fair number of CS instructors use tools like MOSS, while my impression is that in most other departments systematic checking for Honor Code violations is less common,” Aiken said.

Judicial Advisor Laurette Beeson argued that unlike papers or problem sets, programming presents a unique lure — and opportunity — for cheaters.

“Students who are used to being perfect spend 40 to 60 hours writing a program, and they get frustrated when one part doesn’t work,” she said. “It’s pretty tempting.”

Nationwide, it is not unusual for computer science departments to record the highest number of cheating incidences, Beeson added, arguing that Stanford may even have fewer occurrences than its peers.

“I think statistics have proven that schools with honor codes have fewer violations, and I think Stanford ranks very well in that compared to other schools,” she said.

And while not all cases referred to Judicial Affairs end with charges being pressed against a student or students, the numbers seem to reflect MOSS’s ability to root out cheats — of the 71 reports in the last three years, 52 resulted in charges being brought.

An Honor Code violation in Computer Science usually falls into one of two categories: the code in two current students’ programs may be identical or nearly identical or the code in a current student’s program resembles that of a program run through the system in any year since its inception.

Aiken created MOSS in 1994, and he made a version available on the Internet in 1997 for other teachers around the world to use. His motivation, he said, was simple.

“I had a problem with some students plagiarizing programming assignments,” Aiken said. “It was too time-consuming to find them by hand, and the existing programs for plagiarism detection didn’t seem to do a very good job of it.”

All the MOSS Program does is check for similarity, Aiken added. It does not actually make a judgment about whether or not cheating occurred. There could be many legitimate reasons for code in two students’ programs to be identical, he continued. A professor may have posted some sample code for students to use as a base point, or two students could have independently decided to use the same section of public domain code.

“Making that judgment requires an experienced person to look at the two programs and decide why they are similar,” he said. “Having said that, the potential is always there for an instructor to misuse the tool by saying that whenever the tool reports something the person is guilty of cheating.”