馃崉聽馃悩聽馃聽馃悷聽馃悕聽馃聽馃惛 馃馃尦聽馃尭聽馃崜聽馃聽馃崕聽馃馃尶
Cohesion (SRP): High = Good
Coupling: Low = Good
Improving code structure without changing functionality
Fully working code base with tests!
Tests keep passing!
public class LittleClass {
public int doThingOne() {
int numTimes = 6;
int multiplier = 5;
numTimes += 1;
for (int i = 0; i < numTimes; i++) {
System.out.println(multiplier * i);
}
return numTimes;
}
public void doThingTwo() {
int occurrences = 3;
int timeser = 10;
System.out.println("Doing thing two");
for (int i = 0; i < occurrences; i++) {
System.out.println(timeser * i);
}
System.out.println("Doing thing two");
}
}
Run the code 路 adapt the test suite 路 add new test suites 路 improve the code
Clone 路聽re-organize using the diagram 路 start with Zoo, Animal and Stall 路 finally work on Receptionist
stall: Stall