Home > Test Driven Development > Test template you should always use

Test template you should always use

Post moved to http://www.paulszulc.com/2009/test-template-you-should-always-use/

    1. GT
      May 30, 2009 at 9:20 am

      Excellent template Paul …. i really like how well the template is organized and how easy it is to work…

      thanks for taking time to blog about this…. will use this going forward


      • paulszulc
        May 30, 2009 at 9:36 am

        Thanks! I’m glad you enjoyed it 🙂

    2. June 1, 2009 at 12:04 pm

      I DO like the granularity this template encourages. Yet I don’t like the template, or at least not the should-prefix.

      True, it makes look source code like a complete sentence. But I don’t program in english or any other natural language, but in Java or any other programming languag. And in that context ‘should’ becomes just noise.

      I have seen a variation of this template where the Test class name was the name of the class under test prefixed with a ‘A’. So you get stuff like: AClassUnderTest.shouldDoSomething.

      This is like the super evil twin to the evil “should” because it destroys the link between the class under test and the test class

      • paulszulc
        June 2, 2009 at 6:05 am

        Hi Jens,

        first thing first, sometimes instead of ’should…’ nameing convention I use ‘it..’ nameing convetion. For example ItLoggesUserToTheSystem.

        But I understand that the problem is that you don’t like those sentences at all. Well I’m not going to convince you, for me however it is much more readable if I can read my (or someone else’s) code like I was reading a book.

        What ’should..’ naming convention does is reminding you what you really want to test. If you can’t say it in one sentence, then you are testing to much.

        I’m glad you liked the rest of the template.

    1. December 7, 2009 at 3:25 pm
    2. January 4, 2010 at 1:42 pm
    3. March 3, 2010 at 9:12 am
    4. July 27, 2010 at 9:41 pm

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out /  Change )

    Google photo

    You are commenting using your Google account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s

    %d bloggers like this: