{
"$type": "site.standard.document",
"content": "---\ntitle: \"How to cite code? Leading by example\"\ndescription: \"A YAML-based Statement of Originality that teaches students how to cite code,\n declare collaborators and list licences in every assignment.\"\ntags:\n - teaching\n---\n\nIn our\n[Computing Education Reading Group](https://cs.anu.edu.au/hub/reading-group/)\nyesterday we looked at Sheard et. al.'s paper on\n[_Strategies for Maintaining Academic Integrity in First-Year_](https://doi.org/10.1145/3059009.3059064)\nfrom ITiCSE '17. It was a great discussion, with lots of new questions raised as\ndirections for future work.\n\nOne of the topics raised in the paper and discussed in the group is the notion\nof \"citing\" code. When writing human-adjacent languages (like English), we all\nhave a pretty good notion of what constitutes \"acceptable referencing\"\npractices, and we can get down to the important business of arguing about APA vs\nChicago citation styles.\n\nWhen it comes to citing code (which is often---but not always---acceptable in CS\nassignments) there are fewer conventions, and we don't always explicitly teach\nour students how to do it.\n\nMy way of dealing with this is the _Statement of Originality_.\n\n:::info\n\nThe following examples are live on the\n[COMP1720 site](https://cs.anu.edu.au/courses/comp1720/resources/faq/#statement-of-originality);\na course which is now delivered by the excellent\n[Charles Martin](https://cs.anu.edu.au/code-creativity-culture/people/charles-martin/).\nHowever, all of the statement of originality stuff I mention here is still\nunchanged from when I wrote it a few years ago.\n\n:::\n\nOne thing I started doing a few years ago (in 2017 maybe?) in my courses is to\nget students to fill out a \"Statement of Originality\" alongside every assessment\nitem. This isn't a new idea, in fact it was explicitly mentioned in the _Sheard_\npaper:\n\n> Alternatively, when submitting an assignment students make a declaration that\n> the work is their own \"They sign their life away physically or electronically\n> when they submit things.\" (I-1)\n\nThe \"sign their life away\" thing sounds a bit ominous, but when used well it's a\nscaffolded way of getting students to list their sources & collaborators, and to\ndeclare that anything else is their own work.\n\nFor my courses, the\n[course website](https://cs.anu.edu.au/courses/comp1720/resources/faq/#statement-of-originality)\nhas an example of what a \"filled out\" statement might look like:\n\n```yaml\ndeclaration: >-\n I declare that everything I have submitted in this assignment is entirely my\n own work, with the following exceptions:\n\n# add as many \"name+comment\" entries as necessary\n# (or remove it altogether if you haven't collaborated with anyone)\ncollaboration:\n - name: Alice McGuffin\n comment: >-\n Alice gave me some ideas for creating the animated ripple effect in the\n background , but I never saw her assignment code\n - name: Jerry Wang\n comment: >-\n Jerry painted the background artwork for my sketch\n\n# add as many \"url+licence+comment\" entries as necessary\n# (or remove it altogether if you haven't used any external code)\ncode:\n - comment: the code in my \"drawRandomImage\" function is based on some code from\n StackOverflow\n url: \"https://stackoverflow.com/questions/51233447/p5js-image-array\"\n licence: CC BY-SA 2.5 # this is the standard StackOverflow licence\n - comment: my changeSize() function is taken from an example on the p5 reference page\n for mouseWheel\n url: \"https://p5js.org/reference/#/p5.Element/mouseWheel\"\n licence: \"https://creativecommons.org/licenses/by-nc-sa/4.0/\"\n\n# add as many \"url+licence+comment\" entries as necessary\n# (or remove it altogether if you haven't used any external assets)\nassets:\n - comment: photo of potatoes by Scott Bauer\n url: \"https://en.wikipedia.org/wiki/Potato#/media/File:Patates.webp\"\n licence: Public Domain\n - comment: boat photo by Aaron Wu on Unsplash\n url: \"https://unsplash.com/photos/_8rjlHwN4uk\"\n licence: \"https://unsplash.com/license\"\n - comment: some content in Artist Statement taken from Turner Wikipedia page\n url: \"https://en.wikipedia.org/wiki/J._M._W._Turner\"\n licence: CC-SA\n\n# sign *your* name and uid here\nname: Fleur DeLis\nuid: u1234567\n```\n\nThere are a few things to note here:\n\n- this is from an art & code course, so there's separate parts for citing code,\n vs other assets (images, audio)\n\n- the _code_ section contains an example from StackOverflow, since I didn't know\n until I put this thing together what the licence for code found on SO actually\n is (it's CC BY-SA 2.5)\n\n- there's no explicit _name_ field, because while the author name is super\n important for referencing quotes in an essay, in computing it's sometimes hard\n to tell (for both \"random code in blog post\" situations and large open-source\n projects) who the author is\n\n- for _code_, there is a _licence_ field, because that's what actually matters\n when using other peoples' code in the real world\n\nSharp-eyed readers will have noticed that this whole statement of originality is\na [YAML](https://phoenixnap.com/blog/what-is-yaml-with-examples) file, instead\nof just a `.txt` or `.md` or `.docx`. In my courses I use the ANU's\n(self-hosted) GitLab server for all submitted work, and I make heavy use of\nGitLab CI (continuous integration) scripts to provide instant feedback on\nvarious aspects of the students submissions[^autograding]. Using a\nmachine-readable file format like YAML for this means that I can provide more\ntargeted instant feedback about whether they've filled it out correctly.\n\n[^autograding]:\n This isn't auto-grading, it's just automated feedback on boring bookkeeping\n stuff; have they included all the relevant files, does the code compile\n and/or run without error, etc. Anecdotally it does help eliminate most of\n the \"whoops, you forgot to commit the file\" problems, as well as minimising\n any manual \"data cleaning\" that my tutors & I have to do post-submission.\n\nJust because it's got a YAML file extension doesn't mean that the students don't\naccidentally submit badly-formed files which don't parse (even though there's\nlots of tips on the\n[FAQ page](https://cs.anu.edu.au/courses/comp1720/resources/faq/#yaml)). For my\npurposes, that's fine---I don't dock any marks for that, and I don't really care\n(because at present I don't do much automated processing of the\n`statement-of-originality.yml` files anyway). The main thing is that the\nstudents are given a chance in _every submitted piece of work_ to clearly\ndeclare their sources, along with examples of how it should be done. And I\n_think_ that it helps with at least some of the \"whoops, I didn't know I had to\nreference that\" academic misconduct cases. And the fewer misconduct cases, the\nmore time I have for caring about students and their learning.\n",
"createdAt": "2026-05-13T23:14:52.069Z",
"description": "A YAML-based Statement of Originality that teaches students how to cite code, declare collaborators and list licences in every assignment.",
"path": "/blog/2021/03/16/how-to-cite-code-leading-by-example",
"publishedAt": "2021-03-16T00:00:00.000Z",
"site": "at://did:plc:tevykrhi4kibtsipzci76d76/site.standard.publication/self",
"tags": [
"teaching"
],
"textContent": "A YAML-based Statement of Originality that teaches students how to cite code, declare collaborators and list licences in every assignment.",
"title": "How to cite code? Leading by example"
}