CompSci 308
Spring 2018
Software Design and Implementation

Agile Programming and Testing

Agile Programming is a style of managing projects that has become well established over the last twenty years. It encourages working closely with other programmers and those you expect to use your programs in incremental, iterative, cycles. Test driven design, TDD, is one aspect for supporting agile programming that means writing automated tests for the code before writing the code itself, i.e., designing the how the code's interface by figuring out how to test it.

Resources

Try It Out!

For the following exercises use Pair Programming, switching the person typing on the primary computer every 10 minutes. You may use a second computer to look up documentation or search the Internet for solutions related to the exercises, but not to do your own work or to socialize.

To start, fork the original project lab_tdd into your own repository so you can edit, commit, and push your pair's changes.

  1. TDD SpreadSheet, Part 1 only
    In this exercise, the tests are given for you and you must write code to pass them, so focus on the process of using the tests to drive the code you write. The code you write will be completely new within the package tdd.
  2. Debugging Derby
    In this exercise, you will already have code and you must write tests to verify it works as expected. Using the code in the package debug, update the JUnit code to write additional tests to verify that bugs exist within the ContainerArray class (because the current ones all pass). Your process is to verify a test fails (i.e., you see red) then fix the bug in the class such that all the tests pass (both the old and new tests so you see all green). Note, there are at least 5 errors in the code.
  3. Unit Testing in your project
    Pick two classes (one by each person that is already written or about to be written) to write tests for and practice writing Unit Tests. If you do not have any classes for which you feel would be easy to write Unit Tests, then spend some time refactoring the code so that it can be tested more easily. Add this code or discussion to your repository in the package voogasalad.

Submission

At the end of this exercise, use Gitlab's Merge Request to submit your group's work to the original lab repository. Make sure both people's NetIDs are in the title of your Merge Request.