Second Iteration Proposal - griml017/Machine-shop-simulator GitHub Wiki

Prioritized list of refactorings

Below are our prioritized list of refactorings. Our initial plan is to tackle these in this order, but we may need to revise that plan as we move into the refactorings.

Refactoring 0: Naming

Issue Being Addressed:

Rename the stupid and useless names found throughout the code base

Planned refactoring

Our plan is to rename things.

Technical difficulty

The refactoring will be easy, but we have to make sure that all names are changed to the same new name throughout.

Impact on the code

This helps readability.


Refactoring 1: Array Problem

Issue Being Addressed:

This will address the arrays that start at 1 instead of 0 in the machineShopSimulator class.

Planned refactoring

Our plan is to locate the problem and change things as necessary. We will start by changing all instances to start at 0 then go from there.

Technical difficulty

The refactoring will be difficult. Other groups have had problems with this one. We hope that they will give advice if we get stuck.

Impact on the code

It follows java coding practices.


Refactoring 2: Extract and Rename Methods

Issue Being Addressed:

This will address complicated for loops and methods that belong in other classes. (We may just look at for loops depending on complexity)

Planned refactoring

Our plan is to simplify methods and create new ones if necessary.

Technical difficulty

The refactoring will be medium, as long as we test. A lot.

Impact on the code

This has impact on the readability of the code.


Outcomes

For the renaming variables, it was simple and straight forward. We changed some of the longer, more complicated names to easier to understand ones For extracting, we used the refactoring tool. Then we created get and set methods to compensate for the removal of them in the Machine Shop Simulator. The changing of arrays caused us great difficulty. We were not able to successfully get the arrays to work properly. First, we went through the code to determine where there were instances of an array. We tried to change the initial creation of the arrays, but we still got out of bounds exceptions. We tinkered with other things and sometimes the tests would not run. Then other times the tests would ask us to "Enter number of machines and jobs."