Wednesday, 13 June 2018

ethics - Does two lines of copied code constitute plagiarism?


I copied (and failed to cite) two lines of code from the OpenJDK source for an undergraduate Data Structures project. Yet, the code comparison shows an alarming amount (40%) of similarity. Here is the side-by-side comparison with my file.


Based on these grounds, my professor wants to give me a -100% on the assignment, which would bring down my overall grade by 15% total, probably causing me to not make the C-wall (depending on how well I do on the final exam). For this reason (and my conscious), I decided to appeal.


However, I believe that most of the similarity in the report comes from my copying of lines 142-152:



static int hash(int h) {
h ^= (h >>> 20) ^ (h >>> 12);
return h ^ (h >>> 7) ^ (h >>> 4);
}

I did not cite these two lines, but I did intend to delete them later.


In fact, this whole function can be removed without affecting the program at all, which results in this file comparison.


Then, only lines 114-126 are a problem:


MyEntry[] newArr = new MyEntry[newSize];
// Copy

for (int i = 0; i < data.length; i++) {
MyEntry e = data[i];
if (e != null) {
data[i] = null;
do {
MyEntry next = e.next;
int j = e.hash % newSize;
e.next = newArr[j];
newArr[j] = e;
e = next;

} while (e != null);

However, this snippet is my own. I wrote these lines without referencing HashMap.java, and this is a common algorithm for chaining that I can explain thoroughly, and have known about for years.


Yes, I know the fact I copied the other two lines compromises my integrity and made the 20% into 40% to begin with, so how can I prove this?


I'm not sure how to defend this whole case before a Student Conduct Board who knows very little about programming. My board hearing is in a month. Does these two snippets of code constitute plagiarism of my entire project? Is -15% to my overall grade fair?


Sidenotes:



  • Our projects are pretty extensive since we aren't allowed to use java.util.* (like 1k+ lines for each project in 8 days), and I did not copy any other code. I'd say the actual data structure implementation is only meant to take about 1/5 our time spent per project.

  • Over 30% of the class has been reported for academic integrity violations on projects over the semester, and the newly graduated professor doesn't seem to think himself or his assignments are the problem. I should have caught onto the warning before this last project of the semester...




Answer



It appears strongly likely that you did plagiarise, and if this is the case you'd be better to proceed by recognising your mistake than continuing to argue.


Looking at your code, there is a great deal that appears to have been taken from the HashMap.java file. I strongly suspect that you began with this code and then modified it to produce your code, or closely followed it as a template when writing your own. The highlighted code sections have picked up some of this, but other sections closely resemble the other file too, although with slightly altered comments and ordering.


If this is the case, then the code you have shown us is not your own original work but actually a plagiarised version of HashMap.java. Leaving in the two lines which are unconnected is a smoking gun of the link that is likely to be conclusive to the panel. Your point that they are unnecessary will actually count against you because you will be unable to explain why they are there at all. And whether this was your intent or not, it is likely that the panel (and your professor) will see your changed comments and ordering as an attempt to cover up your tracks and conceal your plagiarism from automated tools.


The panel is more likely to show leniency towards a student who appears to at least be contrite, and recognises that they've made a mistake, than a student who denies wrong-doing in the face of apparently very strong evidence.


No comments:

Post a Comment

evolution - Are there any multicellular forms of life which exist without consuming other forms of life in some manner?

The title is the question. If additional specificity is needed I will add clarification here. Are there any multicellular forms of life whic...