On Friday we got to the point where the FX buiness logic code was suitably decoupled from the display logic that we could write our first test for the business logic. In the words of Homer Simpson, “Woo hoo!”.
Test one was a simple one; can we construct the FX ’live point’ object. After adding a few interfaces and mocking up a service provider or two we could.
The object uses two-stage construction; not ideal, but the code doesn’t use exceptions yet.
Bleugh! You are lost in a maze of crapy code, all alike (and much of it copy and pasted!). The last few days have been deep in the heart of darkness. Gently teasing the business logic and the display logic of the FX code apart so that we might one day be able to write tests for the business logic.
We’re nearly there but it’s been a long job. Much longer than any of the other refactorings that we’ve done.
Writing stuff down makes you think about things. Take the “balls in the air” piece. I had a problem, I didn’t realise what the problem was until I wrote about it and now, a week later I see the problem coming up again and know what it is and how to avoid it. Magic!
Some things that take 4 hrs can be done in 8 30 minute segments. Some must be done in one 4 hr session.
As I mentioned a while back, the refactoring project’s FX functionality was developed by guess work. We’re fixing that now by spending some time gaining an understanding of the problem domain as we refactor.
I’ve always been pretty proud of the fact that I deliberately set out to know nothing about your business. I think it makes me a better developer. I know that I know nothing about how your business works; I don’t assume that I know better than you do just because I’ve read about your business area a couple of times.
Hit a deadline early this afternoon and hadn’t chased up some requirements so I ran out of things to implement. Faced with a couple of hours spare I whipped out Gimpel Lint and started to polish…
I’ve been a fan of Gimpel’s PC Lint product for several years. It’s like turning compiler up to warning level 11. I try and keep all of my code passing through it without any warnings.
So, I read my own blog and follow the links I put in the entries, does that make me a bad person? After writing the post on Bob Martin’s book I went off to read his blog, good stuff, read it!
I especially like the “We will not ship shit” entry. That rings so very true with me. I’m sorry, if you want crap go find someone else to write it for you; life’s too short and I’m not interested.
I’ve spent the morning doing test driven development, properly; writing tests first and everything. It works, it’s faster and it’s addictive.
The current work item for the online game is to take the existing game play and adjust it to include a few of the more complex special cases. This alters the game play a little, it alters who goes first, etc. It took a while for me to elicit enough detail to fully understand the requirements, but now I have it.
Agile Software Development - Principles, Patterns, and Practices by Robert C. Martin
This book is physically heavier than most of the books I’ve been reading lately but I’m still carrying it to work even though I only get around 5 mins reading done on the tube during the journey. It’s a beautiful book; the typeface and illustractions are stunning, the paper feels rich, the cover is cool and colourful.
The content is pretty good too.
A while back Carson asked me how I managed to keep track of all the projects that I was working on; I said that I had practiced being productive over short time periods, tried to stay focused on one thing at a time and not to switch projects too quickly. There’s more to it than that though as I found out recently…
Recently I’ve been busy. Too busy. I managed to maintain the pace for a couple of weeks and then ended up wasting a couple of days thrashing as I needed a bigger time slice than I had available and I kept trying to use the time I had to do a task that required more time and that had to be done in one go… Note to self; try and spot that next time and use the small time slots for more appropriate work.
The free source code integration project has its first code drop and then its second code drop… Almost complete. The integration has gone pretty well. The server code now has a neat little facade that allows it to impersonate the MFC server code that the client wants to replace.