# How to write a Coursework Spec
I have recently seen an example of java programming coursework given to current students at a certain university. Now its not that its a bad piece of coursework, it is quite good, the basic idea of the coursework is to write your own Java classes representing Linked Lists, Arrays and Queue data types…. and then to write a test harness for it.
However, the coursework specification is quite badly written, and it doesn’t give any indication about what it means or where marks are.
A good example of the coursework specification would be (this is written by me for a hypothetical second year undergraduate studying Object Oriented Programming using Java):
Task 1:
Design classes for Linked Lists (“LinkedList”) and Arrays (“Array”), and extend them into First In First Out (FIFO) classes named “LinkedListQueue” and “ArrayQueue”. This exhibits that the student understands inheritance and polymorphism.
Task 2:
Investigate the JUnit library which provides unit testing for Java. Design a JUnit TestCase for each of your designed classes defined in Task 1. This exhibits that the student understands the importance of Test Driven Development.
Task 3:
Implement (in Java) the classes in Task 1. This exhibits that the student can take a Object Oriented design and turn it into valid code.
Task 4:
Implement (in Java) the JUnit classes in Task 2. This exhibits that the student can take a unit testing design and turn it into valid code.
Task 5:
Use the classes developed in Task 4, and run them against the classes in Task 3. Clear up any errors that may occur.
For extra marks:
Use interfaces for the classes in Task 1 to make things a bit more generic, and rewrite the tests so that it works through this interface. This exhibits that the student understands abstraction.
===
What does make things worse is that there is a load of really messy Java on the web… the student should be used to commenting and code styling.
In a perfect world this coursework specification would not be specific to Java, but could either be a broad set of Object Oriented languages (e.g. Java, Ruby, C# or C++), or an open set as long as it is an Object Oriented Language.
===
If you are a lecturer in Computer Science, I would really appreciate any feedback that you may have.
Theres also an interesting article in volume 51, issue 3 of Communications of the ACM magazine about how to teach Object Oriented Programming to undergraduate students, titled “Just say ‘A Class Defines a Data Type’“.