3 days with JMock

As I mentioned last week, I’m currently doing some Java work with an investment banking client. This week I added JMock to their toolset. JMock is a dynamic mock object generation tool that works with JUnit to allow you to create mock objects without writing code. Since most of my TDD work has been in C++, most of the mock objects that I’ve used in the past have been hand coded.

A change of technologies

I started back with an investment banking client this week. I’m working with the team that brought us “the refactoring project” and another small team, and integrating the trade entry system with some “xll” excel addins and some back end server software. Pretty standard fare for investment banking work… I’ve worked with this client quite a few times over the years and it’s interesting to go back and find that they’re still using the systems that I helped them to put in place back in 2001.

Udi Dahan on Physical Design

Udi Dahan writes about managing dependencies in code at the ‘package’ level in “So many Dlls, so little time”. “Sloppiness with dependencies. If two classes are independent of each other, and do not provide different implementations of the same interface, think twice about putting them in the same project/dll. Minimizing dependencies is the bread and butter of loose coupling. Break dependence on implementations by introducing interfaces in a separate project/dll.”

Testing Windows Services

Mark Pearce writes about Debugging a .Net Windows Service from within the IDE. We do something similar with our C++ Windows services but, as you’ve probably come to expect from me, it’s slightly more complicated than Mark’s approach. Similarly to Mark I allow the main thread of the application to call the service entry point rather than passing the work off to the Service Control Manager (SCM) when we want to run the service in ‘debug mode’.

Hosting problems resolved

It looks like all of the hosting problems are now resolved. There was a brief period when the database and CGI were fixed and an MT configuration path hadn’t been updated so pages were not being rebuilt after comments were added but that’s now been fixed and the pages have been rebuilt to include the missing comments. If anyone notices anything strange please leave a comment on this posting.

Hosting problems

As you may have noticed I’m having some hosting problems at present. The server that hosts www.lenholgate.com was hacked and it’s taking my hosting provider longer to fix than they expected… Right now comments and trackbacks don’t work because of incorrect CGI settings on the webserver but even if that were fixed now there’s no database backing up the pages so things would just be broken in a different way.

Kevin Barnes on TDD

Kevin Barnes over at Code Craft has just written an interesting piece on TDD. In it he claims that “Excessive unit testing infrastructure hampers your practical ability to refactor things efficiently. People scream at me when I say this. Unit tests are supposed to enable refactoring by spotting unexpected bugs resulting from the refactoring effort. I agree. Unit tests help with this, but only up to a point. When they cross the line into extreme-testing they can be pretty much guaranteed to break every single time you refactor the code”

More on Windows Networking resource limit server failures

My VoIP client has been stress testing the UDP version of The Server Framework and they had what they thought was a deadlock. It wasn’t a deadlock it was more of a lazy server… What seemed to have happened is that they had been thrashing a server with lots of concurrent datagrams and pushed the machine until it stopped receiving packets due to the resource limitations of the machine being hit (probably either non-paged pool exhaustion or the i/o page lock limit).

I don't like Vanilla Scoble

Robert Scoble, the “Microsoft Geek blogger”, has recently had a complaint that he only writes about Microsoft and he figured that he was in a rut and decided to get out of his rut by deliberately not writing about his usual topics of Microsoft, Google and Yahoo (GYM) for 100 posts… So, for the last 3 days he’s been writing about other stuff… There are problems with this idea though…

Why are the 'event' classes in .Net STILL broken?

Whilst I’m ranting about the little things… You still can’t create named versions of the .Net ManualResetEvent and AutoResetEvent, even in .Net 2.0. Wasn’t everything going to be fixed in Whidbey? Of course, I realise that you can “simply” access the underlying Win32 API to do it, but a) why should we have to? and b) it’s not recommended that you do… I guess the fact that the P/Invoke route isn’t recommended is the reason for the dearth of nicely packaged up solutions to this problem; surely anyone who needs this functionality would write an object that wraps it up nicely rather than doing it “long hand” like this?