TypeMock is Freedom
Oren has answered my Quiz, by saying that
using(TextWriter writer = IoC.Resolve<IFileWriterFactory>().Create(filename)) writer.Write(text);
is easier to maintain! Well I cannot argue with that. Oren is one of a kind and I am sure that he can swallow these IoC containers and maintain them in his sleep. But would you have chosen this path if you didn’t need to test the code? Probably not.
We know that easy to understanding code makes the code maintainable, not only to developers who haven’t written the code but also the the developer who wrote the code 3 or more months beforehand.
but I think that using it [TypeMock] to enable brute force testing is harming the design process
Using TypeMock gives you Freedom. It gives you total freedom to choose your design:
- Freedom to choose When you want to design. Before/During or After writing implementation
- Freedom to choose How you want to create new objects. Using the new keyword/ a Singleton/ Factory or IoC Container
- Freedom to choose the Balance of your design. Flexibility/Extensibility/Maintainability/Cohesion/Just In Time Design (YAGNI)
You might be scared of this freedom, but it is not something new. We have always had this freedom until we had to nUnit test our code. Then we lost this freedom and had to find different constraining techniques. It might make our code better, but it might not. I personally like my freedom.
2 Comments to “TypeMock is Freedom”
Recent Posts
- Unacceptable: Unit testing will take 20 years to catch on
- The 4 reasons why we DIDN’T choose Oslo
- Typemock Academy Launch
- The First Rule to Software Craftsmanship
- Goal-driven Development
Categories
- .NET Tests
- Agile
- Code Integrity
- Community
- Debugging
- Fun
- Management for Geeks
- Marketing
- Product
- Release
- Reviews
- SharePoint
- TDD
- Time Management
- Uncategorized
- Unit Tests
Archives
- May 2010
- April 2010
- March 2010
- February 2010
- December 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- December 2008
- November 2008
- August 2008
- July 2008
- May 2008
- April 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006

Eli,
you’ve gone from “stop DFT!” to freedom.
A softer and more sensible stance, it seems, as opposed to the (silly) “stop DFT!” demonstration call.
You write “if you didn’t have to test”. What code don’t you have to test – at all, in any form?
I have *never* written any code that I did not have to test – whether it be *manually* using a console app, or a quick coded test that I can reuse.
Mawi,
Both stances are different facets of the same idea.
Once you have the Freedom to Design as you wish without bending over (or better worded, without turning inside out) to make it testable, You will stop DFT.
Did you know that the number 1 reason that many developers stop writing unit tests is that they don’t what to change the design.
Did you know that they feel restricted that they HAVE to design using IoC, even if they didn’t really need it.
Sure, you *must* test your code.
But you don’t have to DFT in order to do it.