View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Sum2003 Midterm Review: Testing and Refactoring


1. What is SUnit and why would you want to use it?
2. What is refactoring and why would you want to do it?
2. Name one kind of refactoring and the problem it is supposed to solve.

1) It is a template to create automated test cases. Makes regression testing of your program more thorough, easier, and quicker. With SUnit tests it is easy to see if your code is working and if new things have broken old functionality.

2) Refactoring is improving the design of existing code. Basically you rewrite pieces of the code that originally were hard to understand, too complex, was duplicated somewhere else, etc. You want to refactor because it makes the code easier to maintain and is a key part to extreme programming.

3) Move Method is one kind of refactoring where the problem it is supposed to solve is when a method exists in one class that uses data from another class. The solution is to move the method to the class where the data is.

pretty good but SUnit isn't a template it is a framework Barbara Ericson


"Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure." – MartinFowler

Techniques from Ward Cunningham's wiki pages on refactoring:
 • Method Object
 • Extract Method
 • Move Method
 • Inherit Don't Branch
 • Inline Method

Michael Mitchell




1. SUnit is a Testing framework for creating and running unit tests (regression tests) automatically in Smalltalk

2. Refactoring is a technique to restructure code in a disciplined way.

1. SUnit is a testing framework developed by Kent Beck that enables one to check results against expected results, report broken tests, and regression test to see if old code works. Once a bug is found, one can create a unit test to make sure it is fixed and stays fixed.

2. Refactoring is changing the code without changing its functionality, which can be extracting classes, moving methods, etc. It improves the design and it's cheaper and easier to maintain code.

3. One kind of refactoring is to get rid of duplicate code. Change the code without changing its functionality so that the same code won't be at multiple places.
~Sabina Karkin
Nice job Sabina Barbara Ericson
Who's this Sabina that's getting all the attention :)

Links to this Page