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.
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.