Assignment 1: Testing Against Specifications
1 Purpose
2 Getting started
3 Your task:   Writing Examples to Catch Chaffs
4 Overview:   Representing simple file systems
5 Pretty printing
6 Creating examples to guide implementations
7 Grading standards
7.1 The style guide
8 Submission
8.1 Deliverables
8.2 Instructions
8.9

Assignment 1: Testing Against Specifications

Due dates:

Starter files: code.zip

1 Purpose

The primary goal of this assignment is to have you practice testing and understand the level of testing this class requires on a small set of interfaces. The secondary goal is to have you understand how good documentation can help you test and understand the behavior of code when there is no implementation.

2 Getting started

Before you start this assignment, please ensure that you have all the necessary tools to complete an assignment. They include:

Please review the directions on the course page if you need help setting up any of this, or talk to the course staff.

3 Your task: Writing Examples to Catch Chaffs

In this assignment, you will be writing examples to catch all of the chaffs the instructor has created. These chaffs were implemented to fail according to the documentation of the code. You must use the Javadocs in the code alongside the explanations in the specification below to write your examples and find those chaffs.

4 Overview: Representing simple file systems

In this assignment, we’ll think about file systems and some possible data representations for them. For now, we will make the system read-only (i.e. cannot add or change files once the file system is created) and we will be using the Mac style file separator (i.e., we use the / as a file separator), and expect only three behaviors:

The starter code contains three classes that are all parts of the file system:

The Javadoc in those classes should explain what they are intended to represent.

5 Pretty printing

The prettyPrint method produces a human-friendly visual of the file system in a string for debugging purposes. An example of a pretty printed filesystem appears below.

+-root/
| +-data/
| | +-experiment/
| | | +-exp-name.log
| | | +-filesystem/
| | | | +-data.log
| +-lib/
| | +-cool-thing.txt

6 Creating examples to guide implementations

With the system sufficiently explained, your task is to write a collection of test methods in the ExamplarFileSystem class (in the cs3500.hw1.filesystem package in your test folder) that demonstrate how these classes are supposed to work. These tests will function as examples of file systems.

However, you do not have a working implementation nor should you implement any of them. So your tests will depend on the given constructors and interfaces to create your examples.

Fixed a discrepancy due to an off-by-one error. Hints for the chaffs:

7 Grading standards

For this assignment, you will be graded on

7.1 The style guide

Coding style is important. For this class we follow Google’s Java style guide. It’s comprehensive but not very long, so I suggest reading the whole thing and then referring to it as needed.

While it can’t yet take on full responsibility for formatting code—much less for programming style more broadly—your IDE may be able to help you follow the code formatting portion of the style guide:

8 Submission

Ready to submit? Look at the Design Principles Master List first! (Not all items there may apply to this assignment)

8.1 Deliverables

8.2 Instructions

You will submit the assignment on the Handins server. Follow these instructions:

  1. Log in to the server using the link above, using your Khoury account (not your Northeastern account). Follow directions on the course page if you do not have a Khoury account or have forgotten your password.

  2. You must be registered as a student to CS 3500 for Fall 2023 on the handin server. Follow directions on the course page if you have not applied for registration.

  3. Submit the zip file you made above to the relevant assignment (“Hw 1”) on the submission server. Note that for the autograded portions, it may take some time to see feedback. This time increases as we get closer to the deadline, because many more students tend to submit. Please be patient!

  4. You have two submissions for this assignment: the implementation submission, and the self-eval. Make sure to submit to each of them by their respective deadlines.