This site is from a past semester! The current version will be here when the new semester starts.

Week 12 [Fri, Mar 31st] - Admin

  1. Submit the declaration about code reuse COMPULSORY | Tue, Apr 11th 2359

1 Submit the declaration about code reuse COMPULSORY | Tue, Apr 11th 2359

  • Submit the Canvas survey to declare that you have followed the proper procedure for reusing/adapting code from elsewhere. You need to submit this even if you did not reuse any code.

Admin Policy on reuse

Policy on reuse

Reuse is encouraged. However, note that reuse has its own costs (such as the learning curve, additional complexity, usage restrictions, and unknown bugs). Furthermore, you will not be given credit for work done by others. Rather, you will be given credit for reusing work done by others.

  • You are allowed to reuse work from your classmates, subject to following conditions:
    • The work has been shared publicly by us or the authors.
    • You clearly give credit to the original author(s).
  • You are allowed to reuse work from external sources, subject to following conditions:
    • In case of reusing more than a short code snippet (e.g., reusing an entire library or an entire feature), the work comes from a source of 'good standing' (such as an established open source project). This means you cannot reuse a significant portion of codebase written by a friend or a past student. But you may reuse/adapt small code snippets from any source such as stackoverflow.
    • You clearly give credit to the original author. Acknowledge use of third party resources clearly e.g. in the welcome message, splash screen (if any) or under the 'about' menu. If you are open about reuse, you are less likely to get into trouble if you unintentionally reused something copyrighted.
    • You do not violate the license under which the work has been released. Please  do not use 3rd-party images/audio in your software unless they have been specifically released to be used freely. Just because you found it in the Internet does not mean it is free for reuse.
    • Always get permission from us before you reuse third-party libraries. Please post your 'request to use 3rd party library' in our forum. That way, the whole class get to see what libraries are being used by others.

Keep track of code reuse If you reuse/adapt code from elsewhere, cite the source in code immediately. Otherwise you will not remember the source of code reuse later. Not citing the original source can land you in trouble for plagiarism.

FAQ: Can I use code generated by AI tools (e.g., CoPilot, ChatGPT)?
Answer: We don't explicitly prohibit you from using those tools but we strongly discourage you from using them in a way that hinders your learning. For example,

  • Bad Give the problem description to the tool and get it to generate the code for you, and use it directly in your submission.
  • Good Write the required code yourself, and then, use the tool to generate alternative implementations, compare, and use that experience to improve your own coding skills.
  • Good When troubleshooting/debugging, if you are still stumped after giving it your best show, try if such a tool can help you locate the problem.

Other caveats:

  • Using such tools can result in your code being same as others in the class. If such code was flagged for plagiarism, "It was generated by a tool" will not be a valid excuse.
  • Those tools sometimes can confidently give you the wrong answer. So, have a healthy level of scepticism about the accuracy of the code generated by such tools.
  • Tools are being developed that can identify the 'signature' of AI-generated content even if the content is unique.

Finally, should you still choose to use/adapt a code snippet generated by a tool, acknowledge it in the code (as a case of code reuse).

Automated plagiarism checks ahead! From this semester, we'll be using automated plagiarism checks to detect uncredited reuses of content from other CS2103/T tP's i.e., tP's done by other teams in this batch and all previous batches. These checks will be done after the final submissions. The cases detected will be verified and reported to the university administration for disciplinary action. As you know, NUS enforces a penalty of F grade for the entire module (with no option to S/U or withdraw from the module) for plagiarism offenses.

Giving credit for reused work

Given below are how to give credit for things you reuse from elsewhere. These requirements are specific to this module i.e., not applicable outside the module (outside the module, you should follow the rules specified by your employer and the license of the reused work)

If you used a third party library:

  • iP/tP: Mention in the README file (under the Acknowledgements section)
  • tP: Mention in the Project Portfolio Page if the library has a significant relevance to the features you implemented

If you reused code snippets found on the Internet e.g. from StackOverflow answers or
referred code in another software or
referred project code by current/past student:

  • If you read the code to understand the approach and implemented it yourself, mention it as a comment
    //Solution below adapted from
    {Your implmentation of the reused solution here ...}
  • If you copy-pasted a non-trivial code block (possibly with minor modifications renaming, layout changes, changes to comments, etc.), also mark the code block as reused code (using @@author tags with the -reused suffix)
    //@@author {yourGithubUsername}-reused
    //{Info about the source...}
    {Reused code (possibly with minor modifications) here ...}
    Example of reusing a code snippet (with minor modifications):
    persons = getList()
    //@@author johndoe-reused
    //Reused from
    // with minor modifications
    Collections.sort(persons, new Comparator<CustomData>() {
        public int compare(CustomData lhs, CustomData rhs) {
            return lhs.customInt > rhs.customInt ? -1 : 0;
    return persons;

Giving credit to AB3 code: If your project started with the AB3 code and your new code follows a design similar to AB3, that doesn't mean you need to credit AB3 -- this is because a brownfield project is expected to follow existing code where possible, in the interest of consistency. However, don't take credit for existing AB3 code (i.e., ensure such code doesn't appear under your name in the tP code dashboard) unless you have modified that code substantially.

Reuse within the team (e.g., reusing code written by a team member) need not be mentioned explicitly. However, you should factor in such reuse when you estimate effort contributed by each team member.

Reuse of documentation (e.g., reusing a UG/DG section) is no different from code reuse. Such reuse should be credited as well.