Refactoring Lab
CSC 4700 Software Engineering
This is a hands-on lab activity that will broaden your understanding of refactoring and the use of Eclipse. This is for skills development and personal enrichment... there is nothing to hand in.
Start Eclipse and create a new Java project called "Utility"
In the Utility project, create a new Package called "calc"
In the calc package, create a new file called Utility.java
Copy and paste the code from Utility.java into the new file you created
Run the code, and figure out what it does
Refactor the code using Eclipse's automated tools (or manually when needed) to improve it as much as possible, by doing things like:
Rename the project, package, class, methods and variables as needed to be more meaningful
Remove unused variables
Reformate the source (Source->Format), experiment with Formatter in the Project->Properties->Java Code Style
Try to extract code (sometimes repeated code) into a method
Try to change a method signature
Explore online resources for using Eclipse to refactor Java code
Show your instructor what you have accomplished
Share with others the techniques you have discovered
01/24/2018