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:

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.

Bookmark at:
Add 'TypeMock is Freedom' to Del.icio.us Add 'TypeMock is Freedom' to digg Add 'TypeMock is Freedom' to reddit Add 'TypeMock is Freedom' to Feed Me Links! Add 'TypeMock is Freedom' to Technorati Add 'TypeMock is Freedom' to Yahoo My Web Add 'TypeMock is Freedom' to Newsvine Add 'TypeMock is Freedom' to FURL Add 'TypeMock is Freedom' to blinklist Add 'TypeMock is Freedom' to My-Tuts 

5 March 2007 | .NET Tests | Comments | Print This Post

2 Responses to “TypeMock is Freedom”

  1. 1 mawi 8 March 2007 @ 1:01 am

    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.

  2. 2 Eli Lopian 8 March 2007 @ 9:40 am

    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.

Leave a Reply

  1.  
  2.  
  3.  
Search Eli Lopian’s Blog (TypeMock)

Navigation

Recent Posts

Categories

Archives

Managment