Software Hygiene for Introductory Computer Science
June 19th, 1998, minor changes 1/2/00
Introduction
Because electronic information can be moved around and replicated so easily,
there is always the danger that someone may get hold of your homework solution
and use it to cheat. Software Hygiene is a set of rules and procedures
you can follow that will minimize the risk that you get implicated in a
case of cheating. This document will hopefully eliminate most of
the ambiguity about what constitutes cheating in this course.
Even if you know with all your heart that you would never deliberately
cheat, it is still possible for someone to get hold of your source code
if you're not careful. You are responsible for the security of your
own documents. What this means is that if your submission is found
to correlate too strongly with some other submission, YOU BOTH MAY BE
CONSIDERED RESPONSIBLE, even if the other party copied off of you.
So be careful, and follow the rules outlined here. They should ensure
that you avoid these sorts of entanglements.
1. Use of Lab Facilities
The lab is a potentially unhygenic place to work. You are sharing
a resource (the computer and network) with many other students, some of
whom may attempt to take advantage of you. Here are some tips to
follow:
-
Do not leave your terminal unattended! An unattended terminal is
an invitation to raid your data. If you need to be away from the
computer, lock the screen. This prevents others from accessing the
machine while you're away, but doesn't log you out.
-
Do not leave your printouts unattended. If you send your work to
the printer, make sure you pick it up immediately. It's very easy
for someone to simply take your printout and copy your program.
-
Do not leave your belongings unattended. If you're carrying other
printouts, rough work, floppy disks, or anything else that may contain
your private work, make sure you don't let others get to it.
-
USE "CLEANUP AND RESTART" INSTEAD OF LOGGING OUT! This one
is extremely important. Simply logging out may leave all kinds of
temporary files on the local hard drive, which the next user could grab.
The "restart the computer" (the little lightning bolt icon in the start
menu) makes sure that you don't leave any files behind when you leave
the IPL. Don't ever, ever just log out.
-
Use "cleanup and restart" when you log in. This one is less crucial,
but still a very good idea. When you get a machine in the IPL, log
in and use "cleanup and restart". When the machine restarts, log
in again. The extra use of "cleanup and restart" prevents anybody
from leaving hidden programs on the machine that can be used to examine
your files.
2. Use of Mailing Lists and Newsgroups
The course mailing lists and newsgroups are an excellent way for you to help each other
out. You are encouraged to share ideas and tips with each other,
and discuss (in general terms) possible solutions to the homework problems.
Here's what to remember when using the mailing lists:
-
DO NOT POST YOUR PROGRAM! This is the first and most important
rule pertaining to the mailing lists. Do not make any portion of
your program code available on a mailing list. You will be severely
reprimanded if you do so.
Of course, there will be times when you have some sort of C++ question
and you would like to put source code in a message. Instead of cutting
and pasting directly from your homework, consider one of the following:
-
Create a fresh example that isolates the problem. If the bug is in
some function, throw out everything in the function that works until all
you're left with is the code that causes the bug. Rename the variables
to a,b,c, etc. (variable names can give away a lot about a function).
One advantage of doing this is that often, in the process of whittling
down a function to isolate the error, you discover what the error was!
-
Post pseudocode instead of C++ code. Pseudocode is typically higher-level
than C++ and doesn't contain enough information to easily reconstruct the
original code. It's just an outline of what a function does.
If you problem is in the conceptual structure of an algorithm, consider
using this approach.
3. Working With Others
Despite all this paranoia, you are still encouraged to work together on
the assignments to a limited extent. You just have to be careful
about what "working together" means.
-
DO NOT SHARE YOUR PROGRAM WITH OTHERS! The easiest way to
avoid duplication is to never look at anyone else's code. So don't
work together in front of a computer. If you want to think about
the homework in a group, go somewhere where there aren't any computers.
A whiteboard is always a good thing to have handy...
-
When you're working in a group, don't write code together. Think
about the problem abstractly. Use diagrams, pictures, text, and even
pseudocode, but don't generate C++ code as a group.
-
Ideally, when you work with others, don't take written notes to refer to
later. If you can walk away from the meeting and understand how to
proceed on the homework without any sort of written record, then
chances are you understand the material.
-
From time to time, someone may ask you to look at their code in the lab,
for instance if they have a bug they can't find. THIS IS OKAY.
You can help other people fix problems in their code, as long as they've
already written it (an unwritten function is not a bug you can help someone
with). But don't send or receive code via email, even for the purposes
of debugging. Keep your code to yourself.
Occasionally, assignments will allow small groups (2 or 3) of students to work
together. In these cases, the rules
presented above simply expand to encompass the group. IF the
assignment calls for group submission, you may collaborate on all aspects
of the design and implementation of the homework, but you may NOT
share your work with other groups.