Just spotted a flashy new .NET 3.5 supported mocking framework,
Moq. I just love how little infrastructure code you need to use it.. just check
this.
Also, on the "this" link the author notes "
As every mocking framework, except TypeMock which can perform differently, every mocked class can't be sealed and methods that need to be mocked need to be public. If the class is not inheriting from an interface, the method that are being mocked need to be virtual." - which is a sentence i missed to find declared before somehow.. Yet important to know the rules in ballpark we're in.
Which brings us now to the question, which game is that? On
this link we can find some real discussion referenced.
Seems like "TDD and the sort may hurt you", or "the lack of TDD-wise thinking may hurt you..."
Not sure how to think about it, probably the context and scope of a project dictates
if you want/can afford to follow the religion (and be TDD-compilant -embrace the statement above and desing accordingly-, do not crack stuff open with TypeMock, but adhere to something like Moq or Rhino is meant for).
But it may be that you just have a plain old sort of project, trying to deliver this and that, and TypeMock comes in handy for the production team (not aiming at TDD, shall we always?) to raise the QA bar a bit.
Alas i was too much involved in producing "good enough" software rather than "good" software.. the customer had some dollars to spend, and they merely wanted the acceptance tests to pass.. no time / investment into niche stuff that obviously improves the code, but what does a business forecaster care if the code sucks, it should
just work per the requirements..I wish software development was a trade / skill generally accepted in its own right, it's practicioneers be asked to contribute to their best knowledge.. not under silly constraints of ROI and TCO. Quality is not something you can put in, they say. Well, i think it may be true, since the whole job got to be done right, but still.. there
are ways to put in some ingredients which add some quality.
Whether it's TDD or just some "police code" created with TypeMock.. beats me, probably a question of state of mind..