Archive for October, 2008

Refactoring, rewriting existing code to make it as small, efficient, and ultimately as testable as possible, is something of a double-edged sword.  In the Test-Driven world, it’s an absolute necessity.  In the non-TDD world, however, it becomes a potentially very dangerous activity that can make things worse off than where you started. If Only I […]

I was recently performing an ad hoc code review of a custom DLL when I saw what, in my opinion, was an over abundance of exceptions.  I went back to the developer and proceeded to discuss how we could refactor-away various exceptions, shorten certain Try/Catch blocks, possibly even mitigate them altogether, etc. The developer, whom […]

Recently I was building an HttpModule project, and quickly ran into a serious problem: I couldn’t test my code.  The reason?  I was using objects that were unmockable. The scenario involved passing an HttpContext object into my module so that I could manipulate certain properties.  What’s wrong with that?  Well, for starters HttpContext is sealed, […]