Monthly Archives: May 2007

Test Regions

I love unit testing, as most agilists do, it’s one of the biggest tools in the box. However i don’t like it when i have to wade through other peoples unit tests and step through them just to find out what the intention of the test is, so here’s a tip, use regions and the given/when/check routine of explaining the test. For example:

 
[Test]        public void T00x_TestSomething()        {            #region given that i do something to set up the test            //do some set up here            #endregion            #region when i take some action            //carry out the test actions            #endregion            #region check that the code performs correctly             //assert that you should have done something correctly here            #endregion        }
this can then be read much easier
Tagged

Acceptance By Email

-got my work visa today, so I can officially be in the country for 3 years, makes me feel fuzzy inside

 

So I’ve been informed that as the Acceptance Testing guru (i.e. the one who talks the loudest about it amongst the developers at work) I’ve been lined up to give a company presentation in a weeks time, nice to get lots of notice about such things. But really it’s got me on the thought train, wondering about what tools are so sorely missing from this space.

Fitnesse was a wonderful revelation when I started using it, going from a standing start to moving is great, but I’ve started to think that I’m just on a milk float. It takes me part of the way but not very quickly and not really in a manor that’s fit for purpose.

I personally love Fitnesse’s wiki interface, but then there aren’t many developers who don’t love things they can tinker with, and I think that’s where I was going wrong for so long. Fitnesse is only usable by the wrong group, the group that Alan Cooper calls the apologists.

The whole essence of good acceptance testing in intertwined into the following requirements:

    • Must be in natural language
    • Must be clear and concise and unambiguous
    • Must be repeatable
    • Must be automatable

the last two apply to any testing but are important to keep in mind when deciding what you want from an Acceptance test. If my test is not repeatable or automated I’m most likely never going to run it regularly, mainly because I’m lazy and so are most people when it comes to regression testing.

So given these points Fit and Fitnesse fits into the last 2, and the tests themselves fit point 2 but the first is only true after I’ve written the test page and saved. While I’m writing it up I’ve got all kinds of markup to obfuscate what I’m actually trying to lay down.

So everyone leaps to the natural conclusion that a WYSIWYG interface is what is needed. I would argue that there’s even more wrong because I’m going to add another point.

  • Tests need to be editable by non computer literate business owners

The holy grail is a time when business owners can not only read and verify the tests but actually take part in their construction. And the biggest barrier to this is mental. Why should they have to learn a whole new tool and fit it in with their business routine to get the benefit.

So I want a different tool, a more integrated tool, I call it Test By Email

no seriously, imagine, I want to test something so I have a tool that formats an email for me, I ping it to the email server and it runs the test and sends me back a response. It also should get stored for running against future builds and forms the regression pack.

Ok so my brain maybe playing tricks and I’ll wake up tomorrow and think that this is a horrible idea. But I’ll keep it running round in the mean time.

 

Technorati tags: , , ,
Tagged

Booky

So this year so far I’ve been setting myself a goal of reading a lot more general purpose computing books rather than the programming specific ones I’ve been reading in my work/education up to now. It’s been a slow start, generally I try and read a normal fiction/science fiction book in between, and unfortunately I’ve chosen Peter F Hamilton’s Nights Dawn trilogy which is full of monster books about 1200 pages long a piece, so that’s eaten up a chunk. However I’ve managed to get through The Pragmatic Programmer, Programming Ruby (or the pick axe as it’s known) and I’m just about to move on to The Inmates are Running the Asylum. I know (just by reading the forewords) there are a lot of books out there I should have read, but I just never saw them as something. It’s mainly been the writing of Jeff Atwood, that’s made me realize I’ve missed a huge amount off my education [Code complete will be next on my list].

Having said that I owe a lot to SQS and my work there that reading The Pragmatic Programmer was not an eye opener in that I wasn’t aware and agreeing with the ideas, but was a shock somewhat with the realization that there was a need to tell people about it, wasn’t everyone doing it? It’s led me to a little bit of a revelation that I’m not that normal ;-)

To all my coder friends, stop it. become a developer, become and Architect of software, open your eyes to those around you, and I can’t suggest a better place to start than Jeff and Coding Horror

Tagged

Sleep(10000)

So I’ve been spending the evening trying to get to grips with Spring.net and the Windsor Container from the Castle Project trying to work out which is the most usable for ASP.net Fitnesse, and also how to implement them into Rhino.Mock unit tests. But as the Castle Project page has been down all evening I’m going to have to postpone this till later on……

Tomorrow (Wednesday) is the Wellington .net user group so we’ll be having a meet up to get shown NBlogr and the use of Base4 so I’ll have something to talk about tomorrow.

Keep getting Tweets from people at MIX07 and keep wishing I lived in the US so I could go to all these conferences, but then again… I’d have to live with the US in it’s current state so I guess I’ll retract that statement.

Tagged
Follow

Get every new post delivered to your Inbox.