Course Home | Assignments | Computing Resources | Lab Hours/Tutoring | Python | Schedule | Submit

Saint Louis University

Computer Science 1300
Introduction to Object-Oriented Programming

Michael Goldwasser

Fall 2017

Computer Science Department

Homework Assignment 08

Good Software Practices

Contents:


Overview

Topic: Good Software Practices
Related Reading: Chapter 7
Due: 11:00am, Wednesday, 8 November 2017 ELECTRONICALLY

Please make sure you adhere to the policies on academic integrity.


Problems to be Submitted (18 points)

Note: Although the "homework" sets are typically submitted on paper in class, we have chosen to have this assignment submitted electronically (for reasons that will soon be obvious). We have created a folder hw08 on the online submit system for this purpose (not to be confused with unrelated prog08).
  1. (9 points)

    Exercise 7.5 of the text

    Please do this problem electronically. You should be able to see the effect of your documentation by doing help(Point) in the interpreter after loading the definitions.

    The original undocumented code can be found here (or as hopper:/public/goldwasser/1300/book/ch06/RobustPoint.py)

  2. (9 points)

    Create a file TestFraction.py that uses Python's unittest framework to test the correctness of the book's Fraction class implementation. The original untested code, together with embedded gcd function, can be found here (or piecewise within hopper:/public/goldwasser/1300/book/ch06/).

    We will get you started by providing a test for the reduction of fractions within the constructor, and for the additional of fractions (download our TestFraction.py). We would like you to develop a rich set of tests for the following additional behaviors:

    Although unintentional, this is a particularly relevant exercise given that the version of Fraction published in the book is flawed! The provision of __eq__ and __lt__ does not suffice for supporting all of the expected comparison operators: <, <=, > >=, ==, !=. Your tests should expose those flaws.


Extra Credit

  1. (2 points)

    Exercise 7.9 of the text


Michael Goldwasser
CSCI 1300, Fall 2017
Last modified: Tuesday, 28 March 2017
Course Home | Assignments | Computing Resources | Lab Hours/Tutoring | Python | Schedule | Submit