This assignment is not to be done as a group. Feel free to consult one another on your approaches, but do your own work.

Part 1: Unit Testing

The library to be tested

You will write a linked list library in Java meeting the following interface:

public interface ILinkedList<T> {
    /**
     * Get the next list element
     * @return the next element
     */
    ILinkedList<T> next();

    /**
     * Gets the last element in the list
     * @return the node at the end of the list
     */
    ILinkedList<T> last();

    /**
     * Get the element n elements down the list
     * @param n the number of elements to skip
     * @return the element n away
     */
    ILinkedList<T> after(int n);

    /**
     * Removes the next element (sets null)
     * @return the previously next element
     */
    ILinkedList<T> detach();

    /**
     * Gets the current value
     * @return the current value
     */
    T get();

    /**
     * Sets the value of this node
     * @param value the new value
     */
    void set(T value);

    /**
     * Sets the next element in the list
     * @param next the next element
	 *
	 * Example: (1->2->3).setNext(4) => 1->4
     */
    void setNext(ILinkedList<T> next);

    /**
     * Sets the next element after this current element
     * @param next the next element
	 *
	 * Example: (1->2->3).appnd(4) => 1->2->3->4
     */
    void append(ILinkedList<T> next);

    /**
     * Adds the current list as the next of newFirst
     * @param newFirst the new head of the list
	 *
	 * Example: (1->2->3).insert(4) => 4->1->2->3
     */
    void insert(ILinkedList<T> newFirst);
}

There should be no need for very fancy code here. We just need something to test. Do not write a main method to test this code. Leave that blank.

The Unit Testing

Using some flavor of JUnit (which should be supported by your IDE of choice!), generate tests for each of the methods you have implemented. Show that the methods work in both the positive and negative cases. What are the conditions where some of these methods should fail? Be sure to test that they act appropriately. These should be separate test methods. Follow the "Unit Test Best Practices" guidelines from the notes.

Here is a fine tutorial for getting started with NetBeans and JUnit: https://netbeans.org/kb/docs/java/junit-intro.html

Part 2: Git

Intro

Complete the Git tutorial at: try.github.io

Using Git with your project

Use the command-line git client for every part of this procedure. The GUI applications may be enticing, but they will not teach you how Git works, and therefore will not teach you how to handle problems when they arise!

  1. Initialize a Git repository in your unit testing project directory using the git init command.

  2. Add a proper .gitignore file for your repository.

    Hint: use http://gitignore.io to generate this file!
  3. Add a README.md file to the root directory explaining what you have done so far. Write in complete sentences and use the formatting tools available in Markdown to separate sections, lists, and anything else needed.

    You can read about GitHub flavored Markdown here: https://guides.github.com/features/mastering-markdown/
  4. Make a commit with this data:

    1. First, add the files to staging with the git add command.

    2. Second, write a commit message using git commit. You should write a short <80 character summary, and a full description of what you have done with the staged files.

  5. Add the other files in the directory (your unit testing project) in a similar manner. Write a complete log of your work.

GitHub

  1. If you do not have an account on GitHub, create one. Use a professional name for your user as GitHub is a useful resource for showing employers that you have software development skills.

  2. Create a GitHub project for your assignment. Name in whatever you please.

  3. Add GitHub as a new remote for your Git repository. There will be instructions on how to do this on your empty project’s page.

  4. Push your repository up to GitHub. (same directions)

Turn in

  1. Email me at cwsexton@ius.edu with the title "[LastName]: Project 1" with a link to your project repository.

  2. Include a screenshot of your browser showing that you have completed https://try.github.io

Keep in mind that I am asking for public repositories. I ask that you do your ethical best and be professional about performing your own work. Do not force me to code sleuth whether or not you have done your own work. If I notice something that smells a lot like another student’s work, I will be quite cranky and will run file diffs. All parties that match too closely will recieve a zero for the assignment.