≡ Menu

TDD of a WinForm app – Part 0 – Introduction

When you do any kind of computer work – or really do anything where you have a specific skill – you get asked to do some “family work”. This is usually some family member that needs something done to their computer, or something else, and wants you to do it for them.

In our family, I jumped at the chance to help out my father-in-law. He runs a small business doing appliance repair and needed a way to track the calls he goes on. The app is pretty straightforward:

  • A customer entry piece for entering the name, address and phone number of customers he visits (and a way to search for a customer)
  • An invoice piece to enter the work he does for a customer
  • A basic reporting piece to show a list of the customers that haven’t paid yet

Oftentimes in the course of showing Test Driven Development, we resort to things like the bowling game to show the basic concepts. I thought it would be fun to document the building of the application using TDD since it uses two things that are commonly cited as being very difficult to TDD – WinForms and Databases.

The series will be done ala Ron Jeffries style – all the warts will be exposed. You’ll get to see my mistakes and my successes. And using Test-Driven Development, we’ll hopefully see a good app built in a relatively short amount of time.

As parts get finished in the series, I’ll link to them from the bottom of here. See you soon!

Comments on this entry are closed.

  • stuart November 9, 2007, 10:39 am

    Nice work on this series. Practical and helpful to a guy like me, who keeps planning to use approaches like TDD and MVP but never quite seems to get around to it.

  • Rommel July 26, 2010, 12:00 pm

    Thanks so much! Being new to TDD and trying to learn so I can finally begin developing my WinForms applications using TDD with C#/VS2010 has been a pain. The books and articles I found are fine and good, but most of them never show any Win Forms examples and jump straight to ADO.NET or ASP.NET which is not helpful. Also nowhere to be found are explanations/examples of how to use TDD with Multithreading, a simple example applying TDD concepts to BackgroundWorker for example would be super helpful, unfortunately nowhere to be found either. So I’m still a little confused on that point. Planning to add backgroundworker without tdd and then all the components inside will be TDD created. I’m not sure this is the best/proper way to go using TDD concepts. Yours have been the best practical example I’ve found. Thanks!