Derik Whittaker

Syndication

News


Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Thoughts, Comments from a first time tester

A buddy of mine decided to finally give testing a try (not true TDD, but still writing tests) and he made me laugh by some of the statements/observations he made.

  • Where do I start?
  • This feels weird!
  • Am I doing this right?
  • How much is enough?

When he mentioned these to me I had to laugh.  Why, not because I was making fun of him, but because I remember having these exact same feelings when I started testing.

For anyone else having these feelings, here is my personal advice.

Where do I start?
Start where you are comfortable.  Pick a place where you know the code and add a few tests.  Make your initial tests small, but productive.  Don't start out by trying to follow full blown TDD (let the flames begin) as it will just lead to more confusion.

This feels weird!
This means you are out of your comfort zone, this is completely normal.  Don't let this get in your way though.  Push through it as the feeling will pass quickly.

Am I doing this right?
As long as your test proves your code works, then yes, you are doing it right.

How much is enough?
This is a tough one to answer because only YOU know when enough is enough. You will learn over time what types of tests are valid and which ones are not.  At a bare minimum you need tests that prove your 'happy path' works as well as edge cases.

Remember, writing tests for the first time is a lot like riding a bike.  You are going to start slow, you are going to be shaky, hell my guess is you are going to crash into something.  But like riding a bike, don't give up and you will be amazed by how quickly you get the hang of it.

Till next time,


Posted 03-17-2008 5:59 AM by Derik Whittaker
Filed under: ,

[Advertisement]

Comments

AndyB wrote re: Thoughts, Comments from a first time tester
on 03-17-2008 1:46 PM

Derik

Are you discussing automated testing here or unit testing in general? Has he never unit-tested at all before?

Derik Whittaker wrote re: Thoughts, Comments from a first time tester
on 03-17-2008 2:35 PM

@AndyB

He has never unit tested before, so this is all new to him.

rakshita tiwari wrote re: Thoughts, Comments from a first time tester
on 03-20-2008 7:41 AM

this is good for me

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)