lab05 : Accumulator Pattern, more TDD practice

num ready? description assigned due
lab05 true Accumulator Pattern, more TDD practice Tue 10/31 08:00AM Tue 11/07 05:00PM

You may pair or work alone on this lab.

If you choose to pair, please start by registering your pair on submit.cs in the normal way. Go to, log on, navigate to the link for lab05, then follow the links to invite your pair partner to form a group. Make sure your pair partner logs in and accepts your invitation.


For this lab, you will create two files:

There is starter code for each of these (.py files) at the following link:

I suggest you proceed as follows:

  1. Create a directory called ~/cs8/lab05 (using the mkdir command) and cd into that directory.
  2. Use idle3 (you might try idle3 & if you want to keep your prompt handy) to bring up idle3.
  3. Use “New File” to create empty files called and in that ~/cs8/lab05 directory.
  4. ONE AT A TIME, copy the function definitions from the starter code, and the tests that go along with those, and get the tests to pass.
    • By one a a time, what I mean is, at your first step, copy ONLY the first function definition from the starter code and copy only the test cases from that go with that function definition.
    • Then, before you move on to the next function definition and its tests, get all of the tests from the one you just copied to pass.
    • Then, and only then, copy the next function definition and its tests into your files.
    • Repeat this until you have ALL of the function definitions and their tests, and all of them pass.

Note that what you are given differs from function to function: either a complete function definitions

When you’ve done that, you are ready to try submitting to submit.cs for a final grade. HOWEVER, you are encouraged to try submitting to submit.cs earlier, for several reasons:

The coding exercises work with the accumulator pattern that we’ve been going over in lecture and the homeworks.


The page for submitting lab05 is here:

Navigate to that page, and upload your file.

Submission from CSIL command line

If you are working on the ECI/CSIL/lab linux systems, you can also submit at the command line with this command:

~submit/submit -p 829 ~/cs8/lab05/

Notes on using the command line version of submit: