CS 261 Lab E - Bug Squashing

Due Wed Feb 19 at 9:00am

Overview

In this lab, you will practice finding and fixing bugs in a class. The class in question is designed to manipulate Strings. It imitates some of the methods of the String class, and adds a couple others. Its class documentation can be found here.

However, as the name implies, Buggy has a few, little, teeny-tiny errors. It crashes, produces incorrect results, hangs, or otherwise fails. Your job in this lab is to fix it. You basically will be testing each of the Buggy methods independently (thus performing unit testing).

This lab will be completed in pairs. Review the pair programming guidelines!

Objectives

Necessary Files

You will need to download the copy of the zipped Buggy.java. file and import it into Eclipse.

Details

  1. Take a moment to look over the class before you begin, to get a sense for what you're getting into.
  2. Go through the class and fix all of the errors. That's about it!
    • Use a combination of black-box, white-box and boundary testing to discover problems.
    • You can use System.out.println(), assert, JUnit, or the Eclipse Debugger to fix the errors. In fact, I recommend you try them all! If you use prints or asserts, don't remove them when you are done--just comment them out so we can see what you did. In other words, there should be evidence of your debugging process!
    • You will likely want to make a BuggerTester class that has a main() method to help you along.
    • Each of the six methods have at least two bugs (maybe more). Gotta fix 'em all!
    • Your goal is to make the code as bulletproof as possible. It should work flawlessly!
  3. Once your code works flawlessly, fill in the class comment at the top to document your changes before submitting the working class to the submission folder. Double-check that your names are on the file!
  4. Fill out the lab partner evaluation survey after you turn in your work!

Submitting

Submit the fixed Buggy.java following files to the LabE submission folder on hedwig. Make sure you upload your work to the correct folder! The lab is due at the start of class on the day after the lab.

Remember to fill out your lab partner evaluation!

Food for Thought

Grading

This assignment will be graded based on approximately the following criteria: