SWE 437 Homework 3
Spring 2017
More JUnit/Introduction to Coverage

The goal of this exercise is to improve your expertise with JUnit.

This is a "story" assignment; we will grade your writeup. But your JUnit has to run, or you won't receive any credit. For this reason, you need to provide evidence that your JUnit runs (eg screenshots).

Let's use some "real" Java code: Your assignment is to test the equals() method in the Java AbstractList class. This week, I want you to base your tests on the source code, and not the JavaDoc. To do this you will have to:

You can write basic JUnit, data-driven JUnit, or JUnit theories (or some combination). You must justify why the choice you made is appropriate. This week, your tests should "cover" the code in the equals() method. You can use a tool to assess this (eg EMMA or lots of others). Or, you can argue (by hand) that your tests "cover" the code. Note: we'll go into the notion of coverage in great detail later in the semester. Right now, I just want to get you thinking about it.

Grading will be based on:

  1. JUnit tests.
  2. Evidence that your JUnit runs.
  3. Justification of why your JUnit tests are appropriate.
  4. Justification and/or evidence of coverage.