ULPT: How to Cheat on Programming Assignments and Get Away With It

ULPT: How to Cheat on Programming Assignments and Get Away With It Featured Image

There’s a popular subreddit called Unethical Life Pro TipsOpens in a new tab. (ULPT) where folks share immoral ways to solve problems (see also: Malicious ComplianceOpens in a new tab.). Well today, I wanted to share one of my own ULPTs for folks who want to cheat on their programming assignments. Let’s dive in!

Table of Contents

What Is Cheating?

The line for cheating is blurry as it’s context and culture dependent. For example, in a class I teach, it’s not considered cheating to work together on programming projects. However, it is cheating to copy code from a peer or some other source. Depending on the course and the professor, it might be cheating to even talk about code. But then again, how would you know?

With that said, I think folks generally think about cheating as a spectrum of activities. On one end, we have original work. In my opinion, original work does not exist as all work is derivative in some respect. Though, I think we generally define original work as anything that was created from an individual’s own effort, mind, and perspective.

On the other end of the spectrum is outright copying. In other words, an individual would have to take the work of someone else and present it as their own. Very rarely do folks go this far to cheat, but it does happen (I have a story about that; I should write about it sometime).

As a field, developers would probably find themselves further toward cheating on this spectrum than folks of other disciplines. After all, we routinely borrow from online sources such as StackOverflow or this very website. Not to mention that there are hundreds of tools that format, fix, and optimize code for us automatically. Hell, even IDEs suggest code, and with tools like GitHub Copilot available for use, cheating is practically the name of the game. Though, I’m certain that the law is going to step in sooner or later to protect capital and thereby eliminate the beauty of open-source coding.

Regardless, in a classroom, we have to be a bit more strict about our definitions of cheating because we want students to actually understand the code they borrow. As a result, we usually want students to write code on their own without access to other students or online resources.

Therefore, the line is typically: don’t copy code. In other words, it’s okay if a couple students get together to draw some diagrams, but they can never exchange lines of code. After all, we want students to collaborate, but we don’t want them to cheat.

Why Do Folks Cheat?

After you learn what cheating is, you might ask: why do folks cheat? Funnily enough, there’s a ton of literature on why students cheatOpens in a new tab., but I think most of it is common sense. After all, we’ve all been students once. Why have you cheated or at least considered it before?

For example, if all educators care about are grades, grades will take precedent over the actual learning. As a result, it doesn’t surprise me that students will do whatever it takes to get a good grade.

Unfortunately, under a system obsessed with grading, we can’t shift away from it as individual educators. Otherwise, our classes will be less important to your students. Collectively, we’ll have to move toward other systems.

Until then, we’re stuck putting on the pressure by including tough assignments with tight deadlines. The average student then has to make a decision: sacrifice other obligations or cheat. In my opinion, both options are bad, but we don’t seem to care if students sacrifice their own time. We only care if they cheat.

How Do Folks Get Caught?

Now other educators will be mad at me for giving away the “secret” of how to cheat. But here’s the reality: by telling you what resources you can use to cheat, I’m telling you that educators know about these resources already. You’re not being clever by using them, and you will likely get caught.

With that said, let’s revisit this idea of a spectrum and start by talking about copying. As mentioned already, copying comes in many forms. Students may copy each other’s work and/or the work of someone on StackOverflow or GitHub. Regardless of how the copying occurs, it is perhaps the easiest form of cheating to detect. Ignoring the plethora of automated plagiarism detection tools, copying is usually caught because it triggers a form of deja vu in the grader.

There are a handful of reasons for this feeling of deja vu. For example, folks who copy from online sources usually end up with code that differs significantly from the style of code taught in class. As a result, it’s not only peculiar because it shows up more than once in class, but because it also takes slightly longer to read and grade.

Moving slightly up the spectrum, we find folks who copy and refactor the code. Obviously, this approach is a bit more sophisticated because it involves taking existing code and making changes like swapping out variable names. Unfortunately for the student, this approach is just as easily detected as direct copying for the same reasons. As someone who reads a lot of code, I’m going to notice code structure and problem solving strategies over variables names. Not to mention, the refactor strategy is usually lazy enough to leave in important details like unique comments or another student’s name.

If the main issue with copied code is that it’s structurally too similar to a peer, then the solution is obvious: copy, refactor, and restructure the code. Very rarely have I seen students who have gone this far to cheat, though perhaps that’s because they’ve never been caught. More than likely though, the folks cheating are not skilled enough to take this next step. And if they manage to work this hard to get away with it, then they probably could have just done the assignment.

Now, I should warn folks that a software known as the Measure of Software Similarity (MOSS) exists and would likely catch folks even in that last case. Though, it seems a lot of folks have put a lot of work in thwarting MOSSOpens in a new tab.. I’m not sure why anyone would go through such an effort when they could just complete the assignment, but whatever.

How Do I Get Away With Cheating?

If you absolutely have to cheat, here’s my advice.

Start by collecting copies of the solution for the particular problem you’re trying to solve from a variety of sources (e.g., GitHub, peers, etc.). The more solutions you can reference, the better.

Next, take some time to reason about each of the solutions. Get a feel for how the individual got their solution to work (or not work). Remember, not everything you see is going to be worth full credit. Just because there was a solution online, does not mean it works. Ultimately, the purpose of reading through each solution is to build up your mental model about how to solve the problem.

If possible, test the solutions for a variety of cases. If you surface any bugs, try to figure out why the code doesn’t work as expected. What did the author do that doesn’t quite work? The purpose of this step is to flex your analysis skills. Knowing good test cases shows a deep understanding of the problem you’re trying to solve.

Finally, now that you fully understand the problem and have a feel for a few ways of solving it, write your own solution from scratch.

“But wait, I thought you were going to tell me how to cheat!” I did. I taught you how to implement a solution to a problem without actually having to come up with the solution yourself. You’ve replaced a good portion of the thinking process with a reverse engineering process. I don’t think there is any shame in that, if you’re in a pinch.

That does mean, however, that I’m not going to tell you how to copy someone else’s work and get away with it. Even going the route I mentioned above would be considered cheating in my eyes, but it’s definitely more admirable than copying existing code. After all, you learn nothing by copying, but you learn many valuable skills through reverse engineering.

You Lied to Me!

The first question you should ask yourself is why you would ever trust an educator to tell you how to get away with cheating on an assignment. The real purpose of this article was to reiterate the problem with cheating, why you most certainly will get caught, and how to go about treading the line if you’re in a pinch.

In general, however, my advice for folks who feel the need to cheat would actually be the following:

  1. Ask your instructor for an extension.
  2. Consider dropping other obligations to free up some time.
  3. Discuss the assignment with a peer (if permitted).
  4. Take advantage of office hours and labs.
  5. Get a tutor (if permitted).
  6. Start assignments earlier.

With all that said, I am also aware that not all of the options above are practical. Many, many instructors are jerks, so extensions and office hours might not be helpful. Likewise, dropping other obligations can be expensive if it results in graduation delays. Meanwhile, starting assignments sooner may not be practical or even helpful given the various constraints of the college environment.

That’s why, at the end of the day, I don’t see any shame in treading the line of cheating. There are so many structural challenges in universities today that can get in the way of you getting that diploma. Therefore, you need to do what’s best for you to earn your degree. Don’t let anyone tell you otherwise.

Ultimately, we could debate ethics all day and night. For example, I believe that an institution that charges you five figures a year should be doing everything in its power to ensure you succeed. That means following research backed teaching practices, teaching modern development practices, and hiring enough faculty and staff to actually support students in need. Instead, our hyper-individualistic society puts the burden of success on individual students, so I don’t really blame students when they feel helpless. In the end, cheating is wrong, but institutions could be doing a lot more to incentivize learning than to punish cheating.

At any rate, that’s all I have for you right now. If you like this article and would like to read more like it, check some of these out:

Likewise, you can show even more support by heading to my list of ways to grow the site. Otherwise, take care! Happy coding!

Coding Tangents (43 Articles)—Series Navigation

As a lifelong learner and aspiring teacher, I find that not all subjects carry the same weight. As a result, some topics can fall through the cracks due to time constraints or other commitments. Personally, I find these lost artifacts to be quite fun to discuss. That’s why I’ve decided to launch a whole series to do just that. Welcome to Coding Tangents, a collection of articles that tackle the edge case topics of software development.

In this series, I’ll be tackling topics that I feel many of my own students have been curious about but never really got the chance to explore. In many cases, these are subjects that I think deserve more exposure in the classroom. For instance, did you ever receive a formal explanation of access modifiers? How about package management? Version control?

In some cases, students are forced to learn these subjects on their own. Naturally, this forms a breeding ground for misconceptions which are made popular in online forums like Stack Overflow and Reddit. With this series, I’m hoping to get back to the basics where these subjects can be tackled in their entirety.

Jeremy Grifski

Jeremy grew up in a small town where he enjoyed playing soccer and video games, practicing taekwondo, and trading Pokémon cards. Once out of the nest, he pursued a Bachelors in Computer Engineering with a minor in Game Design. After college, he spent about two years writing software for a major engineering company. Then, he earned a master's in Computer Science and Engineering. Today, he pursues a PhD in Engineering Education in order to ultimately land a teaching gig. In his spare time, Jeremy enjoys spending time with his wife, playing Overwatch and Phantasy Star Online 2, practicing trombone, watching Penguins hockey, and traveling the world.

Recent Posts