Thread: Plagiarism allegation

  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    3

    Plagiarism allegation

    Hi everyone,

    I've recently been accused of plagiarism on one of my university modules and I wondered if I could get some educated input on things.

    The code highlighted in red is the same in both our submissions.

    I was wondering if anyone could think of reasons that 2, in around 100+ students could not both have come up with the same solution.


    • All variable names were all taken from example/base code
    • The intended function of the program was a virtual house tour sim that ran in the command prompt
    • Both had access to the same learning resources/reading list


    Any input would be massively appreciated!

    Thanks in advance,
    Ben
    Attached Images Attached Images Plagiarism allegation-img002-jpg 

  2. #2
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Well.. this does look like copying to me, with little changes sprinkled as an afterthought.
    Coding something non trivial is often like writing poetry, this kind of similarity does not arise by accident often, if not ever.

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    I find it hard to believe that you both used the same (inefficient) method for comparing strings. I would think that at least one of you would have figured out that using:
    Code:
    if (tolower(*Direction) == 'q')
    is greatly more efficient than doing two strcmp() calls.

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Using the same algorithm is very common, but implementing the algorithm this closely in code, shows either a common source was used (perhaps something from the lecture or reading list), or copying. The resemblance is quite uncanny.

    Is this code quite similar to something in your lecture notes or reading list?

    It would be instructive to see what the other students assignment have in duplicate (or near duplicate), code.

    One problem is how easily someones work can be taken, completely without their knowledge.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    One of them looks a lot like this.
    help finishing this program
    Actually, neither of the examples in your picture are this code. It has a function called DescribeExits() (like your left-hand image), but does NOT have a variable called SecondInput. So IMO, the code posted on this forum is a THIRD variant.

    I wonder if this person is also in the same class?


    There's no shortage of threads with a very similar theme.
    Slight Confusion
    Editable field in basic C game. I'm stuck.
    Confussion with Username
    Problem! C Programming Begginer Soooo Confused :(

    > All variable names were all taken from example/base code
    Does that mean things like
    char Direction[2];
    char DummyInput[2];
    char ExitName[10];

    were all in common code given to all of you as an example to work on?

    Without seeing
    a) ALL the code for both submissions,
    b) the boilerplate example you were all given as a starting point,
    it's hard to make any kind of judgement. I mean, if you're stuck with a variable called Direction and you only have letters NESW to deal with, it's hard to be uniquely creative.

    A bunch of strcmp() calls in <20% of the code base seems hardly concrete proof.

    The interesting code (ie, the difficult bit) is going to be in DescribeExits / ShowExits. How do these compare between the two submissions?
    If how you deal with how rooms are represented and navigated is different, then I think you have a point to argue with.


    Putting both of you separate closed rooms with just an assignment and reference manual would sort it out. Faculty have pretty much shot themselves in the foot if they handed out too much boilerplate code to begin with to make definitive plagiarism assertions over 100+ students.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Was it plagiarism? I get from your wording that this might be the case, but you're trying to get a good excuse from the experts who frequent this board - though I could very well be wrong about this. It's just that I've learned how to carefully read into what people are actually saying based on the words used, and this post raised a few flags for me.

  7. #7
    Registered User
    Join Date
    Jul 2012
    Posts
    3
    Quote Originally Posted by memcpy View Post
    I find it hard to believe that you both used the same (inefficient) method for comparing strings. I would think that at least one of you would have figured out that using:
    Code:
    if (tolower(*Direction) == 'q')
    is greatly more efficient than doing two strcmp() calls.
    Now you mention it I can't believe this didn't occur to me before. This was my first experience with using the C Language so I was relying heavily on reference (which is most likely what has got me in to this trouble).

    Hopefully we all made this error based on something found in the lecture notes and not elsewhere!


    Salem:
    They are in the same class, I think the same assignment has been running for some years now.

    When we were given the assignment we were given an .exe of an example program which took in [n, e, s, w, q] inputs and navigated around a house as well as base code for setting up the rooms/defining variables/partial main function.
    We were basically told "if you reproduce this like for like you'll get a B, add anything extra to get an A".

    This is the only code of the other students that I have been given to show plagiarism so I'm assuming that there are no other similarities.

  8. #8
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    There is such a thing as weighting by value of the perceived copy, and the red bits have no value. They are purely functional and obvious.

    If that is all there is, even if it was intentional plagiarism, tell them to suck the excrement from a donkeys southern most end.

    If the example was given to check for a series of conditions that aren't integer in nature everyone would follow the same pattern because that's the most savory option.

    Code:
    if(condition_1)
    {
    }
    else if (condition_2)
    {
    }
    That's a perfectly natural bit of C++.

    If the variable names and interface are imposed the only thing left to consider is spacing.

    If on the other hand you lied about what was imposed, you better start looking for the original the several of you (As Salem notes, there is more than two variations on this code on the web.) copied and start figuring out exactly what is different so you can decide if anything you did create has a value due to the arrangement and implementation of code.

    Soma

  9. #9
    Registered User
    Join Date
    Jul 2012
    Posts
    3
    Matticus: Although I have started to question myself after the allegation (whether or not I saw the code on a forum like this) , at no point during the assignment did I see the other persons code and I'm pretty sure my code never left my laptop before it was submitted. I definitely didn't directly copy-paste any code snippets either. I've been trying to write in a way that doesn't create too much bias on one way or another because it's not you guys that I need to convince.

    phantomotap: I might leave out the bit about the donkey in my response but you've given me some stuff to think about, thanks.

  10. #10
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Put it this way: those two segments of code use the same (inefficient in this case) coding of the same algorithm, follow the same convention for variable naming, use EXACTLY the same variable names, and follow the same guidelines for code indentation. The only observable difference is in comments, which are easily added, edited, or removed without impacting the code.

    In some rare professional settings, code is automatically fed through a separate program that enforces particular coding styles, and even conventions for variable naming. Well known quality algorithms are sometimes reused, or even reimplemented (unless a code review identifies the duplication). Even in those settings, it is exceedingly rare for two different programmers to select exactly the same variable names and same coding techniques in large parts of their code, simply because those things reflect the mind of the programmer on a given day. And the mindset of programmers change day to day, due to stress levels, fatigue, family frustrations, and other things.

    While it is not absolutely 100% certain that two independently written code fragments can be almost identical, it is a fair bet that the two code fragments are copied from a common source. The fact that the differences are minor (comments, a variable name or two, a couple of strings) doesn't change those odds much - the odds are still vastly in favour (much closer to 100% than to 50%) of someone deliberately attempting to obfuscate the fact they have copied the code.

    The fact there are multiple similar looking variants on the web increases the odds of a common source even further.

    So, in the end, given the information in this thread, I would conclude the call of plagiarism is valid. There is a very small (near zero) probability of my conclusion being wrong. That doesn't pass the legal test (in various jurisdictions) of what a "reasonable person" would conclude, given the same body of evidence.
    Last edited by grumpy; 07-18-2012 at 05:59 AM.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  11. #11
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    Well since you're a smart guy you're just gonna send them all previous revisions of the code from your SVN/Git Repo, and then they can follow the code as it's being written and see that you came up with it yourself.

    You did use version control right?
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Plagiarism, Code, and IP
    By osuee in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 04-03-2007, 02:46 AM