Skip to main content

Whatever Happened to Pong ... err ... SharpMock?

Just short of four years ago, I came up with an idea for replacing static/sealed methods in legacy code (the Michael Feathers kind) with fakes for testing purposes. Here's a quick rundown of what happened after I had that idea:

  1. Messed my brain up trying, for several hours over the course of many days, to figure out how to bend PostSharp to my will
  2. Left it alone for months
  3. Came back to it and spent several hours re-learning what I needed to know
  4. Left it alone for months
  5. Came back to it again and spent several hours re-learning what I needed to know
  6. Left it alone for months
  7. Came back to it and decided to try using LinFu as the AOP framework driving things
  8. Had what seemed like a pretty decent prototype working based on a dozen or so unit tests that fell apart under a little more weight
  9. Gave up on LinFu and left it alone for a few months
  10. Started over using Microsoft CCI Code Model to create my own specialized AOP framework to drive the mocking framework
  11. Made minor advances
  12. Left it alone for months
  13. Made minor advances
  14. Left it alone for months
  15. Paddle the paddle to the side to the side, To the side to the side to the paddle the paddle
  16. ...
  17. Finally started getting a bit more serious, found a decent development workflow, and started banging out some features

So that's where things stand now - there's repo over on GitHub with some really horrendous code in it that passes a handful of tests while being pretty much unusable in real-world scenarios.

For the most part I'm having fun with it and just trying to get it into a somewhat stable state. (I'd like to say it's always fun, but it's actually not, probably because I'm doing something wrong. I'll try to explore that in a later post.) Once I get the 'basic' features implemented, along with one or two other critical usability pieces, I'll starting publicizing it in an attempt to get people to use it. A main test for me is getting it to work on a few libraries in the codebase at my current job - and even for the implemented features, it does not.

But I Need to Fake Static Methods!

You have plenty of options:

  • Functionally, far and away the best option is TypeMock
  • TypeMock has a competitor
  • I'm pretty sure support for this free alternative will be baked into VS 2012
  • Pretty soon all the cool kids will be doing this; at that point in time, I'll hang my head in dismay for having spent too much time ponging around

Comments