34.5. Changing the Application in Small StepsOnce the first test was failing because of the incorrect actual date being that day's date, Emily and Neo started to change the application to access the Clock from class RentEz. Emily offered the driving seat to Neo. Together, they traced from the test fixture into the code to see specifically where the application was accessing the system clock as it affected that test. Neo then changed that code to access the date through RentEz. After one change, the test passed, surprising them both. They then chose the next Fit test involving dates and ran it to see it fail. After some time tracing through the code, they found another point that needed to be changed to use the new Clock. "There seems to be some redundancy here," remarked Neo. "Let's mark it in the code and come back to it later," suggested Emily. "By using the tests to drive the change, we can be sure that all the changes have been tested." Questions & Answers
|