COMP 304B Object-Oriented Software Design -- Assignment 1

COMP 304B Object-Oriented Software Design - Assignment 1

Practical information

Goals

This assignment will make you familiar with unit testing, with a UML modelling tool such as MagicDraw, and with object-oriented programming in Python.

Your assignment solution should clearly present:

  1. The tests corresponding to the requirements listed below.
  2. A Class Diagram depicting your design.

  3. An implementation of your design in Python.

  4. The results of the tests on your implementation.

Upload all source and result files to WebCT and provide links to all of them from your index.html file.

Requirements

The ultimate goal is to build a fully functional PlotWindow, integrated into the DSheet spreadsheet application. The following figure shows what a PlotWindow will look like.
Note that in this assignment, you will ONLY design and implement the non-visual part of the PlotWindow ! A PlotWindow instance will be known to applications using it by a name. This name is not known by the PlotWindow itself. A PlotWindow has a title, as well as an x_name and y_name describing the x and y axes respectively. All of these are Strings. Both in x and y directions a min and max value describe the "window" through which the trajectories will be viewed. These are all floating point numbers. A PlotWindow may contain an arbitrary number of Trajectory objects. Each Trajectory has a unique name, and an arbitrary number of Point objects. Each Point object has an x and y coordinate, both of which are floating point numbers. It should be possible to create/query/modify/and delete PlotWindow, Trajectory, and Point objects. This should happen through appropriate methods. Do NOT allow direct access to attributes ! Concerning modification: it must be possible to append Points to a Trajectory.

Design

Use a UML drawing tool of your choice to produce a Class Diagram.

Unit Testing

You must produce a list of tests (mention their type) to check whether the above requirements are satisfied in an implementation. Note that you will have to refine the requirements yourself.

These test should be implemented in a file test.py using the PyUnit testing framework.

References


Hans Vangheluwe January 2005.