Day 52
·Today, I had one goal and one goal only in mind: to finish up the tests for my HTTP Server. However, things did not go as I’d hoped.
I spent the first half of the day restructuring my entire project to have a more higher-level to low-level hierarchy. This involved making interfaces, object factories, mock objects, and mock object factories. Needless to say, it was a lot of new code and time spent just getting things to be more polymorphic so that I could properly test for side effects. It makes the comment Micah made all the more understandable. If I had more closely followed TDD, I would have been forced to design this structure from the start. But what happened, happened. It’s better that I learn from this more than anything!
For the second half of the day, I ran into an issue with getting the server to properly read input and output streams. Eventually, I got it working consistently. What’s cool is that now I can make a server with either mock objects or real objects for parsing and returning information. The more high-level I want the testing to be, the more mock objects I use, and the more low-level, the more real objects I use! Though I’m behind, I’m really learning a lot from this experience.