[NSWI004] Using external code in your assignments

Petr Tůma petr.tuma at d3s.mff.cuni.cz
Tue Oct 6 11:08:51 CEST 2020


Hi,

looking at the commits in some of the assignment repositories, we believe now might be a good time to stress the general guidelines for using external code, that is, code that you did not write yourself.

A simple rule to begin with: submitting external code without attribution as a solution to your assignment is cheating.

But of course, things are rarely simple. In our experience, when we see external code in an assignment, it is rarely because students intended to cheat. Much more often, it is a result of students looking for information on the problem they are solving on the internet (which is fine and very much encouraged), and then not realizing that simply copying an incidentally discovered solution is not OK. After all, programming these days is often about reuse, right ?

So what should you do ?

First, be open about what you are doing. If you decide to copy external code verbatim, state what part of your solution is copied and why. If you decide to transform external code into your solution, state what part of your solution was thus inspired and why.

Second, think about what you are doing. Each assignment asks you to demonstrate certain skill, but may involve additional work that is needed simply to get things running. If the external code helps you with the latter and the demonstration remains your own, fine. If you are demonstrating skills of an external author, not fine.

Third, when in doubt, ask us.

To avoid misunderstanding, here is a brief Q&A in the context of your first assignment:

Q: I found https://stackoverflow.com/questions/1735236/how-to-write-my-own-printf-in-c. Is it fine if I copy the answer ?
A: No. The purpose of the assignment is to exercise your C coding skills. You demonstrate that by coding, not by copying.

Q: I found https://stackoverflow.com/questions/1735236/how-to-write-my-own-printf-in-c. Is it fine if I start with the answer and edit it into my own solution ?
A: Maybe. If you are new to C, one way to learn may be to get the existing code and play with it, changing and debugging things to get an understanding of how it works. If you end up with code that is significantly different from the original, and you state your original inspiration, then the assignment fulfilled its purpose and we will understand how you worked when grading. But you should really take the code apart until you understand every bit of it, and then combine the pieces back into your solution.

Q: I decided to extend the assignment and included the ability to print disassembly with %pD using https://github.com/Mithreindeir/Dynzasm. Is it fine ?
A: Sure, hope you had fun :-) did you remember to include attribution as required by the library license ?

Hope this helps, Petr


More information about the NSWI004 mailing list