Ian wrote:
You don't get real-life numbers / scenarios.
Gosh, it is frustrating. If one appeals to high level ideas that one finds in books and in best practice example projects then one gets accused of not being realistic where as if one tries to be practical one is accused of lacking engineering sophistication.
err... don't put words in my mouth, Ian, I don't accuse you of anything, after all: I answered your question and gave you advice about what you might run into. I did that because I might know a thing or two about Linq and data-access and databases and thought that you might want to know these tips up front before spending a lot of time on things you later regret. I just wanted to give you advice of what you might run into, and you WILL run into these side effects. So better know them beforehand even if you don't like it. You don't have to take my advice, toss it into the trash if you will, it's not my project nor code you're working on. I just wanted you to know that with Linq, there's no such thing as a surrogate system in memory: linq behaves differently on the DB, and your mocked tests might run, chances are your db using code won't. If you're fine with that, by all means, go for it, I just wanted to make sure you do know the sideeffects up front.
Let me end with a quote from Dijkstra:
"The required techniques of effective reasoning are pretty formal, but as long as programming is done by people that don't master them, the software crisis will remain with us and will be considered an incurable disease. And you know what incurable diseases do: they invite the quacks and charlatans in, who in this case take the form of Software Engineering gurus."
before you think I mean you with the quacks and charlatans, I dont, I mean with them the TDD / agile gurus, who are seen by many these days as the bringers of the new way of how software should be designed, but actually are IMHO just bringing bullshit with a thin layer of chrome.
I can imagine it's hard to weed through the mixed messages and who to trust and follow. I can't make that decision for you. All I can say to you is that proven research and science isn't wrong. Mocking can help, but in general please do realize what you're actually doing: in practice it's not going to be as useful as it might sound on paper, especially with databases. Without mocking it's not really TDD, I know, but so be it. Is it more necessary to be pure TDD or is it more necessary to force yourself to think about what you're doing before actually doing it?