<p>At Denison, our intro class has labs designed around real world problems, and involves lab reports. This makes it a lot harder to cheat. We're not saying "implement quicksort", we're saying "write a simulation to check Tom Schelling's Nobel prize winning work, then write a 2-3 page paper explaining what you found." </p>

<p>Of course, students will still try to get help from each other or from the TAs. In my syllabus, I write some very explicit rules about what kinds of help is and is not allowed. Then, I give them a take-home quiz on the syllabus and it includes 2 case studies ("Jill was working on her lab when ...did a violation of the honor code occur?"). After making this change, and discussing the case studies in class after students hand in the quiz, cheating went down. By the way, I really like this syllabus quiz idea. It lets me spend the first day of class doing some active learning and setting the tone for the semester, rather than going over the syllabus. And it gives students a free quiz grade to force them to actually read the syllabus.</p>

CC BY-SA 3.0
2017-06-03T13:47:57.010Z
I'm 100% going to use the syllabus quiz idea beginning this September. I'll still go over the material (HS, after all), but I've been toying with something like this in the back of my mind, and your comment just made it explicit for me. I want them to *remember* the class policies, not just *hear* them. Plus, my policies just get more and more idiosyncratic as time goes on.
Ben I.
CC BY-SA 3.0
2017-06-03T06:56:11.640Z
2017-06-03T06:56:11.640Z
David White
<p>My main tool to prevent plagiarism on short beginner labs is to have a discussion with my students and to under-count them in grading.</p>

<p>I explain to my students that cheating is a huge problem on CS labs specifically.  I use a news item of a huge number of university freshmen expelled for cheating in a CS class.  (Search as I might, I cannot find the example right now - I will add it in later).</p>

<p>I then explain that the largest component of their grade will come from the quizzes and tests, not from their labs.  The labs, as I explain it, are designed to help them do well on their quizzes and tests.  Therefore, kids who cheat on labs are just going to shoot themselves in the foot.</p>

<p>When I have polled students about cheating, the year prior to this practice, I found that a very tiny portion of my students would admit, on a survey, to having cheated, but 100% reported that others cheated regularly.</p>

<p>By contrast, when I did the same poll the following year, almost none would admit to cheating themselves (this is no change), but only about 1/3 said that others cheated regularly.  Needless to say, I kept this change.</p>

CC BY-SA 3.0
2017-05-23T15:27:45.963Z
2017-05-24T01:22:40.440Z
2017-05-24T01:22:40.440Z
Ben I.
<p>All the work we've done on in-flow peer review (see, for instance, our <a href="http://cs.brown.edu/~sk/Publications/Papers/Published/ccfhkptw-in-flow-peer-review/" rel="nofollow noreferrer">working group report</a>) is aimed in part at this question. Overall, I believe we should rethink our curricula, pedagogy, and assessments so that we stop viewing plagiarism as a huge problem, but instead creatively think about alternate educational practices.</p>

CC BY-SA 3.0
2017-06-03T01:52:19.890Z
I started on your paper - very interesting.  +1 for getting me thinking in a very different direction (though I still have to figure out if I can apply it to my environment)
Ben I.
CC BY-SA 3.0
2017-06-03T00:25:59.953Z
2017-06-03T00:25:59.953Z
Shriram Krishnamurthi
<p>One option is to have a short closed-book in-class quiz after each lab assignment to test each student's understanding (which is a good thing to do even in the absence of cheating). </p>

<p>For your sample problem, you might ask them to fill in the blanks to complete code to solve a comparable problem or to answer multiple choice questions about a short program you provide. I've used Moodle for these quizzes, which makes grading trivial.</p>

CC BY-SA 3.0
2017-06-02T21:30:12.530Z
2017-06-02T23:36:18.257Z
2017-06-02T23:36:18.257Z
Ellen Spertus
<p>I just got a chance to read the article you linked to. As a teacher of CS50 AP, I can attest to the numerous solutions that are available online for all things CS50. It's almost unfair for a student trying to remain ethical when Google suggests appending "solution" to a query like "cs50 mario." Even a search without "solution" will often return a link to code on GitHub before the actual CS50 pset specs.</p>

<p>A few things I will do next year...</p>

<ul>
<li><p>Continue to allow students to exercise the "regret clause" as I did
this year</p></li>
<li><p>Utilize revision history - the Cloud9 IDE has a full history of each
keystroke with a timestamp as a sort of built-in version control</p></li>
<li><p>Add just enough variation to assignments to distinguish one section's
specs from the other and from CS50 itself</p></li>
<li><p>Grade the code but weigh more heavily reflection assignments on that
code/assignment</p></li>
</ul>

<p>As I prepare students for the AP Exam, I have to give them practice with written responses on their code for the Explore Task. I plan on assigning reflection components and looking more closely at comments that document student thinking and trying to grade process over product.</p>

<p>Paramount to all of this though is creating a classroom where students genuinely want to work through programming challenges. They have to know they will receive support when they struggle and hit a road block. I do my best to be available via office hours, especially before a big assignment is due, and sometimes knowing that they have a place to look for help other than Google makes a big difference.</p>

CC BY-SA 3.0
2017-05-30T23:49:18.470Z
2017-05-30T23:49:18.470Z
Peter
<p>In addition to all of the great answers here, one further tool to consider is MOSS (Measure of Software Similarity), which has been released for free to educators by Stanford: <a href="https://theory.stanford.edu/~aiken/moss/" rel="nofollow noreferrer">https://theory.stanford.edu/~aiken/moss/</a></p>

<p>It can currently analyze code in C, C++, Java, C#, Python, Visual Basic, Javascript, FORTRAN, ML, Haskell, Lisp, Scheme, Pascal, Modula2, Ada, Perl, TCL, Matlab, VHDL, Verilog, Spice, MIPS assembly, a8086 assembly, a8086 assembly, MIPS assembly, and HCL2.</p>

CC BY-SA 4.0
2020-09-07T00:53:28.180Z
+1 for MOSS, but you have to use discretion because it often overreaches. See my answer below.
Louis B.
CC BY-SA 3.0
2017-05-30T21:34:18.510Z
2017-05-30T21:34:18.510Z
Ben I.
<p>I teach at the community college level, in Ontario's Colleges of Applied Arts and Technology system. My students generally study electronics and don't have any burning desire to become programmers. I teach hardware interfacing and realtime responses to hardware or external events with Python, CircuitPython and Arduino, on Windows or Raspberry Pi.
For academic integrity, I have several approaches.</p>
<ul>
<li>Minimize the temptation. Generous deadlines, appropriate difficulty, open ended assignments and lots of opportunities to ask questions.</li>
<li>Avoid reusing assignments. Last year's assignment was an auto ranging voltmeter, this year was a direct digital synthesis waveform generator, and so on. This gets rid of code reuse from one cohort to the next.</li>
<li>In my course policy, I refer to the MIT policy on coding, it's quite reasonable in that it's enough to give credit in comments. <a href="https://integrity.mit.edu/handbook/writing-code" rel="nofollow noreferrer">https://integrity.mit.edu/handbook/writing-code</a></li>
<li>For my second year class, I use a source code management system  (previously Fossil, now Mercurial and TortoiseHg) and award marks for intelligent use of the system, including meaningful commits and commit messages. It looks really bad when a program appears in a single commit on the due date.</li>
<li>And yes, I routinely use MOSS, but warily. It works as a front end. I look at the top of the list and examine the code. Most of the similarities are idioms of the language like &quot;for line in input_file:&quot; and can be dismissed. What I look for (as pointed out in the NY Times story) is a pattern of similar mistakes or unusual coding, renamed identifiers, or shuffled order of function definitions.</li>
<li>Finally I will overlook some cases where a pair or trio of students have very similar solutions who are known to work together in all their courses. I observe their interactions in the labs (not just programming class, electronics etc,) and  it's pretty obvious that learning is happening. Typically it's one or two of the more eager students pulling a friend along who's also motivated but needs the help to keep up. I can't stop it, might as well embrace it.</li>
</ul>
<p>This year it's going to be a lot harder because most of my teaching is remote and I can't get a feel for who's doing what, and who are in the lead peloton drafting the rest.</p>
<p>Hope this helps.</p>

CC BY-SA 4.0
2020-09-07T01:57:52.307Z
+1 for using the MIT integrity policy; it's the best I've seen. Also for recognizing that some helping among friends is productive and contributes to learning.  Also, welcome to [cseducators.se]!
Ben I.
CC BY-SA 4.0
2020-09-07T18:40:44.260Z
If a student uses and gives credit for other code, I tell them they also assume responsibility for the correctness of the code. They can not come back and say "But the bug is in the code I got from the web, not in my code!".
Fritz Sieker
CC BY-SA 4.0
2020-09-07T01:31:21.930Z
2020-09-07T01:31:21.930Z
Louis B.
<p>For me, labs are worth very little. The district sets them to be only 10% of the student's average. So I don't worry about them working together. In fact, I encourage it. What I tell students is that as long as they understand the lab when they're finished, it's a successful lab. </p>

<p>Yes, I'm sure there are students that straight copy from their friends. At 10% though, it's not worth worrying about. They'll have tests and quizzes based on the labs and will absolutely bomb those. </p>

<p>For larger projects I only count the actual project as part of the grade. Turning in a working project is 70% of the grade, although I'm thinking of dropping that to 60% next year. The rest of the grade comes from an in class, on paper, free response that's based on what they wrote for the project. If they complete the project and understand what they turned in, the FRQs should be relatively easy. If they copied from a friend, they're going to be hurting. </p>

<p>I also run big projects through MOSS. Usually just the threat of that is enough to limit straight copying. </p>

CC BY-SA 3.0
2017-05-23T16:38:21.497Z
2017-05-23T16:38:21.497Z
Ryan Nutt
<p>I can only speak from a high school perspective as that is what I teach (14-18 years olds), and I truly feel your concern on this question.  Biggest issues I have in my CS class are distracting websites (YouTube, games, etc) and copying code.  I have certainly not fully conquered the problem but here are a few things that I do that seem to help:</p>

<ul>
<li><p><strong>Don't assign work that is not to be completed in the lab.</strong>  I know this is probably a debated issue but I, personally, do not assign any work outside of class time so no homework or projects or anything done outside of the lab.  While there are many reasons for this within the specific context of my high school that are irrelevant to this question, a big benefit is that <strong><em>I am always present when students are working on labs</em></strong>.  It is much more difficult to copy off of another student when I am monitoring the lab and even harder when I am watching screens from a program like Apple Remote Desktop.  I have found that as long as I actively monitor my classes when they are working on a lab it cuts way down on the copying</p></li>
<li><p><strong>Don't have students turn work in, do screen checks instead.</strong>  This takes some getting used to but the major benefits:</p>

<ul>
<li>Get's you up walking around the room which helps with monitoring and making sure students aren't looking at each other's screens</li>
<li>Easier to compare two adjacent student's code when they are both up on screens right next to each other at the same time and you are right there so they can't just try to hide or minimize</li>
<li>More efficient for grading in that you don't have to individually open up files. Just walk up to student, have them run the code, and check that the output is correct</li>
<li>NOTE: This does not really work for more complicated, larger, multi-file, projects but you did state in your question that this question was aimed towards the starting, smaller projects which this is perfect for</li>
</ul></li>
<li><p><strong>Assign different assignments.</strong>  Bear with me, because I know that as soon as someone says "Just create different assignments..." it almost always means more work for the teacher.  But it does not have to be, especially for CS.  For instance, one of my first Java assignments is to code a basic "Area Calculator" that asks for dimensions of a shape and then calculates the area.  What I do is just assign each student a different shape from a pool of about six shapes.  Then I make sure that no consecutive students have the same shape.  When we do the Java MadLibs assignment, I have a few different MadLibs templates that I use, again making sure no consecutive students have the same template.  This really creates no extra work for me other than when I first came up with the assignment, and even then it was totally manageable.  I realize that they could still "copy" off each other to some extent but I have found that this cuts way down on the copying because students realize it would be more work to copy someone else's code and then adapt it, rather than just doing it themselves.  You'd be surprised how small, little teaks to the assignment can dissuade students from copying.</p></li>
<li><p><strong>Ask students questions about their code.</strong>  This works particularly well when doing screen checks but just ask basic questions like "What does this line do?" or "Why did you put that there?".  While this doesn't necessarily cut down on cheating it makes it very easy to identify the students who are copying because they will have the code done but have no idea what any of the lines do.</p></li>
<li><p><strong>Position computers so its impossible to "screen snipe"</strong>.  I know that this is very dependent on the setup of the lab but if at all possible, arrange the workstations so that students do not have direct view of each others screens.  One that I have found works well is to have four computers at a table, each facing different directions, but again I realize this may be impossible (as it is in the lab that I currently teach in), but if it is possible I have found it helps.  </p></li>
</ul>

<p>These are the main things I do and I am sure I am forgetting something but I hope these help and can improve the issues you are having. </p>

CC BY-SA 3.0
2017-05-23T15:30:04.390Z
I already grade labs through code interviews, so much of this is easy for me to implement.  I also *love* your notion for how to set up different assignments.  I'm going to set up a new question to ask about that, specifically, because I think it deserves its own discussion.
Ben I.
CC BY-SA 3.0
2017-05-23T15:33:05.940Z
@Chiorbean yeah, the screen checks and the differing assignments were the two changes for me that had the biggest impact.  Especially for introductory assignments, tweaking the lab is trivial for us the teachers but for the students it seems like entirely different assignments and really demotivates the urge to copy.
celeriko
CC BY-SA 3.0
2017-05-23T15:25:50.120Z
2017-05-23T15:31:23.197Z
2017-05-23T15:31:23.197Z
celeriko
<p>It is spectacularly easy to cheat on CS labs at the high school level and above (roughly ages 14 and up), particularly on short, early assignments.  In fact, there is article in <a href="https://www.nytimes.com/2017/05/29/us/computer-science-cheating.html" rel="noreferrer">today's NY Times</a> about this problem.</p>

<p>For instance, for a very early assignment, a question might be:</p>

<blockquote>
  <p>Create a small program that will ask the user for a word and a number n, and responds by printing out the word n times.</p>
</blockquote>

<p>This is a rather extreme example, but it could easily be the first part of a lab assignment for a student who has just encountered for loops for the first time.</p>

<p>Detecting cheating here is nonsensical because a huge portion of the resulting code will be nearly identical even if the students didn't cheat. For that reason, I am seeking ways to discourage students from trying to cheat in the first place.</p>

<p>What are some best practices for staving off the flow of plagiarism?</p>

CC BY-SA 3.0
2017-05-23T14:53:35.080Z
any specific context? college? high school? etc?
celeriko
CC BY-SA 3.0
2017-05-23T14:54:54.023Z
I am wary of making the site too US-centric.  Is there a better way to designate this?
Ben I.
CC BY-SA 3.0
2017-05-23T14:55:14.497Z
Are you taking this test on a computer?
Manav Dubey
CC BY-SA 3.0
2017-05-23T14:56:29.907Z
Not tests, this is regarding lab assignments
Ben I.
CC BY-SA 3.0
2017-05-23T14:56:54.707Z
maybe just state the age range? i.e. 15-18 or whatever your age range is
celeriko
CC BY-SA 3.0
2017-05-23T14:57:24.140Z
@Choirbean Can you care to expand on what you mean about labs. Like cheating off of other students?
Manav Dubey
CC BY-SA 3.0
2017-05-23T15:01:53.160Z
A more specific example will make for an easier to answer question. Particularly in the closed beta, it's very easy to jump in with over-generalised questions rather than relating the question to a specific example.
Sean Houlihane
CC BY-SA 3.0
2017-05-23T15:13:13.460Z
I think it would be hard to detect cheating for simple programs because of the reason you mentioned. But how about you ask them to write comment next to each statement as to why they wrote it? Everyone should explain it their own terms?
Quazi Irfan
<best-practice><labs><ethics><cheating>
Cheating on labs
# Cheating on labs

(Asked by: username_0 on 2017-05-23)

It is spectacularly easy to cheat on CS labs at the high school level and above (roughly ages 14 and up), particularly on short, early assignments. In fact, there is article in [today's NY Times](https://www.nytimes.com/2017/05/29/us/computer-science-cheating.html) about this problem.

For instance, for a very early assignment, a question might be:

> Create a small program that will ask the user for a word and a number n, and responds by printing out the word n times.

This is a rather extreme example, but it could easily be the first part of a lab assignment for a student who has just encountered for loops for the first time.

Detecting cheating here is nonsensical because a huge portion of the resulting code will be nearly identical even if the students didn't cheat. For that reason, I am seeking ways to discourage students from trying to cheat in the first place.

What are some best practices for staving off the flow of plagiarism?

**Tags:** best-practice, labs, ethics, cheating

> **Comments:**
> **username_1**: any specific context? college? high school? etc?  
> **username_0**: I am wary of making the site too US-centric.  Is there a better way to designate this?  
> **username_2**: Are you taking this test on a computer?  
> **username_0**: Not tests, this is regarding lab assignments  
> **username_1**: maybe just state the age range? i.e. 15-18 or whatever your age range is  
> **username_2**: @Choirbean Can you care to expand on what you mean about labs. Like cheating off of other students?  
> **username_3**: A more specific example will make for an easier to answer question. Particularly in the closed beta, it's very easy to jump in with over-generalised questions rather than relating the question to a specific example.  
> **username_4**: I think it would be hard to detect cheating for simple programs because of the reason you mentioned. But how about you ask them to write comment next to each statement as to why they wrote it? Everyone should explain it their own terms?  

---

## 9 answers

### Answer by username_11 on 2017-05-23. Score: 13

For me, labs are worth very little. The district sets them to be only 10% of the student's average. So I don't worry about them working together. In fact, I encourage it. What I tell students is that as long as they understand the lab when they're finished, it's a successful lab.

Yes, I'm sure there are students that straight copy from their friends. At 10% though, it's not worth worrying about. They'll have tests and quizzes based on the labs and will absolutely bomb those.

For larger projects I only count the actual project as part of the grade. Turning in a working project is 70% of the grade, although I'm thinking of dropping that to 60% next year. The rest of the grade comes from an in class, on paper, free response that's based on what they wrote for the project. If they complete the project and understand what they turned in, the FRQs should be relatively easy. If they copied from a friend, they're going to be hurting.

I also run big projects through MOSS. Usually just the threat of that is enough to limit straight copying.


---

### Answer by username_1 on 2017-05-23. Score: 13

I can only speak from a high school perspective as that is what I teach (14-18 years olds), and I truly feel your concern on this question. Biggest issues I have in my CS class are distracting websites (YouTube, games, etc) and copying code. I have certainly not fully conquered the problem but here are a few things that I do that seem to help:

* **Don't assign work that is not to be completed in the lab.** I know this is probably a debated issue but I, personally, do not assign any work outside of class time so no homework or projects or anything done outside of the lab. While there are many reasons for this within the specific context of my high school that are irrelevant to this question, a big benefit is that ***I am always present when students are working on labs***. It is much more difficult to copy off of another student when I am monitoring the lab and even harder when I am watching screens from a program like Apple Remote Desktop. I have found that as long as I actively monitor my classes when they are working on a lab it cuts way down on the copying
* **Don't have students turn work in, do screen checks instead.** This takes some getting used to but the major benefits:

  + Get's you up walking around the room which helps with monitoring and making sure students aren't looking at each other's screens
  + Easier to compare two adjacent student's code when they are both up on screens right next to each other at the same time and you are right there so they can't just try to hide or minimize
  + More efficient for grading in that you don't have to individually open up files. Just walk up to student, have them run the code, and check that the output is correct
  + NOTE: This does not really work for more complicated, larger, multi-file, projects but you did state in your question that this question was aimed towards the starting, smaller projects which this is perfect for
* **Assign different assignments.** Bear with me, because I know that as soon as someone says "Just create different assignments..." it almost always means more work for the teacher. But it does not have to be, especially for CS. For instance, one of my first Java assignments is to code a basic "Area Calculator" that asks for dimensions of a shape and then calculates the area. What I do is just assign each student a different shape from a pool of about six shapes. Then I make sure that no consecutive students have the same shape. When we do the Java MadLibs assignment, I have a few different MadLibs templates that I use, again making sure no consecutive students have the same template. This really creates no extra work for me other than when I first came up with the assignment, and even then it was totally manageable. I realize that they could still "copy" off each other to some extent but I have found that this cuts way down on the copying because students realize it would be more work to copy someone else's code and then adapt it, rather than just doing it themselves. You'd be surprised how small, little teaks to the assignment can dissuade students from copying.
* **Ask students questions about their code.** This works particularly well when doing screen checks but just ask basic questions like "What does this line do?" or "Why did you put that there?". While this doesn't necessarily cut down on cheating it makes it very easy to identify the students who are copying because they will have the code done but have no idea what any of the lines do.
* **Position computers so its impossible to "screen snipe"**. I know that this is very dependent on the setup of the lab but if at all possible, arrange the workstations so that students do not have direct view of each others screens. One that I have found works well is to have four computers at a table, each facing different directions, but again I realize this may be impossible (as it is in the lab that I currently teach in), but if it is possible I have found it helps.

These are the main things I do and I am sure I am forgetting something but I hope these help and can improve the issues you are having.

> **Comments:**
> **username_0**: I already grade labs through code interviews, so much of this is easy for me to implement.  I also *love* your notion for how to set up different assignments.  I'm going to set up a new question to ask about that, specifically, because I think it deserves its own discussion.  
> **username_1**: @Chiorbean yeah, the screen checks and the differing assignments were the two changes for me that had the biggest impact.  Especially for introductory assignments, tweaking the lab is trivial for us the teachers but for the students it seems like entirely different assignments and really demotivates the urge to copy.  

---

### Answer by username_5 on 2017-06-03. Score: 8

At Denison, our intro class has labs designed around real world problems, and involves lab reports. This makes it a lot harder to cheat. We're not saying "implement quicksort", we're saying "write a simulation to check Tom Schelling's Nobel prize winning work, then write a 2-3 page paper explaining what you found."

Of course, students will still try to get help from each other or from the TAs. In my syllabus, I write some very explicit rules about what kinds of help is and is not allowed. Then, I give them a take-home quiz on the syllabus and it includes 2 case studies ("Jill was working on her lab when ...did a violation of the honor code occur?"). After making this change, and discussing the case studies in class after students hand in the quiz, cheating went down. By the way, I really like this syllabus quiz idea. It lets me spend the first day of class doing some active learning and setting the tone for the semester, rather than going over the syllabus. And it gives students a free quiz grade to force them to actually read the syllabus.

> **Comments:**
> **username_0**: I'm 100% going to use the syllabus quiz idea beginning this September. I'll still go over the material (HS, after all), but I've been toying with something like this in the back of my mind, and your comment just made it explicit for me. I want them to *remember* the class policies, not just *hear* them. Plus, my policies just get more and more idiosyncratic as time goes on.  

---

### Answer by username_0 on 2017-05-23. Score: 7

My main tool to prevent plagiarism on short beginner labs is to have a discussion with my students and to under-count them in grading.

I explain to my students that cheating is a huge problem on CS labs specifically. I use a news item of a huge number of university freshmen expelled for cheating in a CS class. (Search as I might, I cannot find the example right now - I will add it in later).

I then explain that the largest component of their grade will come from the quizzes and tests, not from their labs. The labs, as I explain it, are designed to help them do well on their quizzes and tests. Therefore, kids who cheat on labs are just going to shoot themselves in the foot.

When I have polled students about cheating, the year prior to this practice, I found that a very tiny portion of my students would admit, on a survey, to having cheated, but 100% reported that others cheated regularly.

By contrast, when I did the same poll the following year, almost none would admit to cheating themselves (this is no change), but only about 1/3 said that others cheated regularly. Needless to say, I kept this change.


---

### Answer by username_7 on 2017-06-02. Score: 4

One option is to have a short closed-book in-class quiz after each lab assignment to test each student's understanding (which is a good thing to do even in the absence of cheating).

For your sample problem, you might ask them to fill in the blanks to complete code to solve a comparable problem or to answer multiple choice questions about a short program you provide. I've used Moodle for these quizzes, which makes grading trivial.


---

### Answer by username_6 on 2017-06-03. Score: 3

All the work we've done on in-flow peer review (see, for instance, our [working group report](http://cs.brown.edu/~sk/Publications/Papers/Published/ccfhkptw-in-flow-peer-review/)) is aimed in part at this question. Overall, I believe we should rethink our curricula, pedagogy, and assessments so that we stop viewing plagiarism as a huge problem, but instead creatively think about alternate educational practices.

> **Comments:**
> **username_0**: I started on your paper - very interesting.  +1 for getting me thinking in a very different direction (though I still have to figure out if I can apply it to my environment)  

---

### Answer by username_8 on 2017-05-30. Score: 2

I just got a chance to read the article you linked to. As a teacher of CS50 AP, I can attest to the numerous solutions that are available online for all things CS50. It's almost unfair for a student trying to remain ethical when Google suggests appending "solution" to a query like "cs50 mario." Even a search without "solution" will often return a link to code on GitHub before the actual CS50 pset specs.

A few things I will do next year...

* Continue to allow students to exercise the "regret clause" as I did
  this year
* Utilize revision history - the Cloud9 IDE has a full history of each
  keystroke with a timestamp as a sort of built-in version control
* Add just enough variation to assignments to distinguish one section's
  specs from the other and from CS50 itself
* Grade the code but weigh more heavily reflection assignments on that
  code/assignment

As I prepare students for the AP Exam, I have to give them practice with written responses on their code for the Explore Task. I plan on assigning reflection components and looking more closely at comments that document student thinking and trying to grade process over product.

Paramount to all of this though is creating a classroom where students genuinely want to work through programming challenges. They have to know they will receive support when they struggle and hit a road block. I do my best to be available via office hours, especially before a big assignment is due, and sometimes knowing that they have a place to look for help other than Google makes a big difference.


---

### Answer by username_0 on 2017-05-30. Score: 2

In addition to all of the great answers here, one further tool to consider is MOSS (Measure of Software Similarity), which has been released for free to educators by Stanford: <https://theory.stanford.edu/~aiken/moss/>

It can currently analyze code in C, C++, Java, C#, Python, Visual Basic, Javascript, FORTRAN, ML, Haskell, Lisp, Scheme, Pascal, Modula2, Ada, Perl, TCL, Matlab, VHDL, Verilog, Spice, MIPS assembly, a8086 assembly, a8086 assembly, MIPS assembly, and HCL2.

> **Comments:**
> **username_9**: +1 for MOSS, but you have to use discretion because it often overreaches. See my answer below.  

---

### Answer by username_9 on 2020-09-07. Score: 1

I teach at the community college level, in Ontario's Colleges of Applied Arts and Technology system. My students generally study electronics and don't have any burning desire to become programmers. I teach hardware interfacing and realtime responses to hardware or external events with Python, CircuitPython and Arduino, on Windows or Raspberry Pi.
For academic integrity, I have several approaches.

* Minimize the temptation. Generous deadlines, appropriate difficulty, open ended assignments and lots of opportunities to ask questions.
* Avoid reusing assignments. Last year's assignment was an auto ranging voltmeter, this year was a direct digital synthesis waveform generator, and so on. This gets rid of code reuse from one cohort to the next.
* In my course policy, I refer to the MIT policy on coding, it's quite reasonable in that it's enough to give credit in comments. <https://integrity.mit.edu/handbook/writing-code>
* For my second year class, I use a source code management system (previously Fossil, now Mercurial and TortoiseHg) and award marks for intelligent use of the system, including meaningful commits and commit messages. It looks really bad when a program appears in a single commit on the due date.
* And yes, I routinely use MOSS, but warily. It works as a front end. I look at the top of the list and examine the code. Most of the similarities are idioms of the language like "for line in input\_file:" and can be dismissed. What I look for (as pointed out in the NY Times story) is a pattern of similar mistakes or unusual coding, renamed identifiers, or shuffled order of function definitions.
* Finally I will overlook some cases where a pair or trio of students have very similar solutions who are known to work together in all their courses. I observe their interactions in the labs (not just programming class, electronics etc,) and it's pretty obvious that learning is happening. Typically it's one or two of the more eager students pulling a friend along who's also motivated but needs the help to keep up. I can't stop it, might as well embrace it.

This year it's going to be a lot harder because most of my teaching is remote and I can't get a feel for who's doing what, and who are in the lead peloton drafting the rest.

Hope this helps.

> **Comments:**
> **username_0**: +1 for using the MIT integrity policy; it's the best I've seen. Also for recognizing that some helping among friends is productive and contributes to learning.  Also, welcome to [cseducators.se]!  
> **username_10**: If a student uses and gives credit for other code, I tell them they also assume responsibility for the correctness of the code. They can not come back and say "But the bug is in the code I got from the web, not in my code!".  

---

