Previously, on Practical Testing: we finished our reworking on the code we were left with a simpler timer queue that passed all of our tests, but was single threaded and needed manual intervention from client code to manage timeouts. Today we’ll add back the multi-threaded functionality so that the queue manages timeouts automatically.
Our original implementation of the callback timer queue used a thread to manage the timeouts. The threading was integral to the timer queue code and this made testing the queue logic difficult because, to test the queue, we had to control the thread.
I’ve had an interesting week. I’m back with the Refactoring Project and, although things were looking up last time I was here, they’ve managed to adopt some bad habits in my absence. The latest build that’s live with users isn’t tagged in CVS; we have 66 other builds that are tagged and the ability to rebuild an arbitrary release has helped on numerous occasions, but this time they decided not to bother.
Excellent news; Herb Sutter and Andrei Alexandrescu’s C++ Coding Standards book is done!
This is the book I’ve been wanting for ages. Whilst there are other C++ coding standard books out there but, well, they just don’t have the gravitas of a book written by these two and included in Bjarne Stroustrup’s C++ In Depth Series.
The table of contents is here. I hope the book’s heavy enough to hit people with ;)
As I mentioned last week, we’ve just got back from a week in Saas-Fee with Warren Smith. We’ve did this course last year as well, but due to the way the course is structured this didn’t really matter much; for us this year’s course built on last year’s. The aim of the course is to develop the skills required to ski the whole mountain, regardless of conditions and terrain…
There were around 20 of us on the course and instruction was done in one large group.
We’ve just got back from a week of early season ski training in Saas-Fee. We went with the Warren Smith Ski Academy, again, and had a great time. The weather (wind mainly) meant that we didn’t ski as much as we’d hoped, but it was still a very good trip. I’ll write a report later, for now, just holiday snaps…
Allalinhorn Walking Walking2 Still Windy
I’ve discovered something quite amazing this week; something quite simple that shouldn’t really have been much of a surprise, but it was.
If you have a substantial set of unit tests then you can use them as the backdrop for documentation that tours the code base in a controlled and manageable way. Kinda like a sing-along, the reader can be directed through several key tests in a debugger whilst the document describes what’s going on and reasoning behind some of design decisions.
Jeff Atwood writes about the the delusion of reuse where he warns of the extra effort that’s really required when writing for reuse:
“I believe writing a truly reusable class is an order of magnitude harder than writing a single use class.”
He also warns of putting in extra effort up front with the intent of creating reusable code from scratch and suggests that you can’t know if you have a strong case for making some code reusable until you’ve written or used the same piece of code three times in different projects.
Could someone please write a Java based estimating package?
I really want to be able to able to turn to a manager and say, with a straight face, that all of my estimates were done in JEst…
Sorry, it’s been a long day.
Mats writes about how he finally got unit testing by realising that the value comes not when all your tests pass and you feel happy but when one of your tests fails and you feel sad…
This is actually something I’m not sure I’d quite realised for myself. I’m pretty good now; I know why I should write tests, I know that I feel more comfortable making changes when I have tests to support me, but I never really accepted that having all the tests passing doesn’t really buy you much.
Looks like it’s going to rain today…
ItsGoingToRain1 ItsGoingToRain2 ItsGoingToRain3 ItsGoingToRain4