About Me

Training

Nothin But .Net Developer Bootcamp

Navigation

Search

Categories

On this page

Archive

Blogroll

 Agile Developer Venkat's Blog
 Ayende @ Blog
 B#
 Barry Gervin's Software Architecture Perspectives
 Boy Meets World
 Brad Abrams
 Canadian Developers
 Christopher Steen
 Claritude Software News
 Clemens Vasters: Enterprise Development and Alien Abductions
 Coding Horror
 Coding in an Igloo
 Dare Obasanjo aka Carnage4Life
 Darrell Norton's Blog [MVP]
 David Hayden [MVP C#]
 Don Box's Spoutlet
 Eric Gunnerson's C# Compendium
 EZWeb guy: Jeffrey Palermo [C# MVP]
 Fear and Loathing
 Generalities & Details: Adventures in the High-tech Underbelly
 Greg Young [MVP]
 Greg's Cool [Insert Clever Name] of the Day
 IanG on Tap
 Ingo Rammer's Weblog
 ISerializable - Roy Osherove's Blog
 James Kovacs' Weblog
 Jason Haley
 Jean-Luc David
 Jeremy D. Miller -- The Shade Tree Developer
 JetBrains .NET Tools Blog
 Jimmy Nilsson's weblog
 John Bristowe's Weblog
 John Papa [MVP C#]
 Jon Skeet's Coding Blog
 JonGalloway.ToString()
 Jump the Fence or Walk Around
 Lambda the Ultimate - Programming Languages Weblog
 Larkware News
 Lutz Roeder
 Marquee de Sells: Chris's insight outlet
 Martin Fowler's Bliki
 Mike Nichols - SonOfNun Technology
 MSDN Magazine - .NET Matters
 MSDN Magazine - All Articles
 OdeToCode Blogs
 Onion Blog
 Planet TW
 Raymond Lewallen [MVP]
 Rockford Lhotka
 RodMan's Corner
 Roger Johansson's blog
 Sahil Malik - blah.winsmarts.com
 Sam Gentile's Blog
 Scott Bellware [MVP]
 Scott Hanselman's Computer Zen
 ScottGu's Blog
 secretGeek
 Service Station, by Aaron Skonnard
 Signum sine tinnitu--by Guy Kawasaki
 Stephen Toub
 Steve Eichert's Blog
 Steven Rockarts
 The Blog Ride
 The Coding Hillbilly
 The Daily WTF
 TheServerSide.net: News
 Tim Gifford
 Vance Morrison's Weblog
 you've been HAACKED

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

 Thursday, June 01, 2006
Thursday, June 01, 2006 10:29:14 PM (Mountain Standard Time, UTC-07:00) ( Agile )

For readers of this blog you are no doubt aware that I am a practitioner of TDD and I have a passion for at least demonstrating its benefits to other developers. I had a great conversation with Kyle Baley and Wade Grandoni the other day, and I stressed the fact that although I believe heavily in the value of TDD, I also realize that it is just another tool that developers can “choose” to add to their arsenal. Would I personally develop not using TDD, probably not. Do I know that before TDD came along that there were many successful projects delivered on-time and on-budget, absolutely!

That being said, there is a reason why many developers have a hard time believing the benefits of TDD. One of the biggest issues which is often a stumbling block for many developers new/attempting TDD is the fact that it does represent a significant paradigm shift into the software development process. “You want me to write a test for a method that doesn’t exist yet on a class that doesn’t exist yet??” In my opinion, this statement alone represents the reason why I believe that the shift is an even bigger one than the one many of us faced years ago – The shift from procedural coding to OO programming.

I am sure that there are few of us today who could argue against practical reasons for utilizing OO as a vehicle to compose applications. The same holds true for TDD. At first it can be something that looks so different from what you are used to that you do one of two things:

  • Shrug it off completely as a waste of time
  • Look into the questions popping up in your mind

It is the second group that can still continue to have a hard time with the process. Why? Again, remember back to when you were learning to code/think in objects? Chances are you had the help of a few good books, and mentors who had run the Object race, whom you gleaned a lot of good information/best practices from. Because TDD is still a relatively new practice for the .Net community, there is a definite shortage of experts who people can turn to for personal coaching. Now I say shortage, there are a lot of TDD practitioners and gurus out there, but not nearly as many as plain old OO gurus. Why am I mentioning this? Often in the first couple of weeks of attempting TDD on anything but a trivial project, people who are trying to do it on their own get frustrated, and sometimes it is at this point that they dismiss TDD as a waste of time and “impractical for enterprise development”. Unfortunately, this frustration can often be a result of the fact that correctly applying TDD means having a handle on some plain old fashioned clean object thinking. A seasoned TDD developer can help walk you down the path of interface based programming. They can extol the values of dependency injection and layered architecture. All the while tying these principles back to how they relate to the TDD software development process.

Lastly, the biggest reason I think people have a hard time buying into TDD is the only time they get to see it in action is by the “experts’ who can only use it to demonstrate a “small” piece of a larger application. I admit, I definitely fall into this category. Unfortunately what they can’t see is how TDD can literally be applied to build out the functionality of enormous large scale enterprise applications. Why? They can’t join you on your project on a daily basis. They can’t see how just because you are using TDD that the SDLC hasn’t disappeared. They can’t see that in an agile environment a large part of the test code that you write is a direct result of hourly interaction with the business users, who are there helping the developers carve out the functionality. They can’t see the fact that even though you are using TDD that other types of testing are not forgotten.

I am not a purist. I believe TDD is a great vehicle for delivering apps into the hands of users quicker. Do I think that a developer who doesn’t use TDD is a less skilled developer. Absolutely not. One thing you can’t be in this industry is dogmatic. Everyone is entitled to their own opinion. My personal opinion – I would not develop software without using a TDD approach.

Friday, June 02, 2006 1:02:43 AM (Mountain Standard Time, UTC-07:00)
Hi JP,

I must admit switching to TDD is quite a paradigm shift.

I have just started playing with real objects (I was misguided and was forced into using VB for the last 5 years) with C# and can see the enormous benefits of TDD.

For me the learning curve has been quite uphill struggle. To do anything serious in TDD you need to learn about Nunit, mocks (if you choose to use them), stubs (if you choose to use them instead of mocks), DI (if you want to decouple).. The list just seems to go on and on… :S

Anyhow... after being introduced to your blog and reading a TDD book things are starting to become clearer by the day... There are still questions... but as with everything else a bit of research/ingenuity is clearing these issues up too.

Now where did I put those objects :P

Andrew Macdonald
Friday, June 02, 2006 8:11:38 AM (Mountain Standard Time, UTC-07:00)
JP. As a person who is doing limited TAD and next to no TDD in my work environment, I know firsthand what stigmas you talk of. One of the points you made when we were talking here in Edmonton was that starting TDD in a team does require someone who is able to be a TDD Lead. They need to have the experience, the knowledge and the ability to train. If you don't have that person you end up hitting the wall that Andrew commented on and you will get mired in the task of learning the different tools. We as developers tend to have shorter attention spans (ADD perhaps?) and being mired down quickly leads to disinterest and the failure of the initiative.
Friday, June 02, 2006 9:05:39 AM (Mountain Standard Time, UTC-07:00)
First let me just say that I work for a very large IT shop where a majority of the staff is mainframe programmers and the management are former mainframe programmers.

I work for the eCommerce department of the group which and I have been trying to steer our department towards TDD. Some aspects of TDD have been more successful then others. It is difficult to change when we are so tightly tied to a large legacy system in the back-end.

The biggest hurdle I see is that we have a very regimented project management process. We use the Enterprise edition of Microsoft Project Management and we have to account for virtually every hour of the day in this system. So the idea of pair programming in this sort of environment is preposterous to the managers of this environment. No project manager is going to pay for two developers on their project when they only need one.

Other aspects though have been successful. We are writing test scripts early and automating them as much as possible, and I think once we can Team Foundation Server going we will be able to accomplish these tasks even easier.
Steve
Friday, June 02, 2006 9:15:22 AM (Mountain Standard Time, UTC-07:00)
Well put.
Sunday, June 04, 2006 11:13:19 AM (Mountain Standard Time, UTC-07:00)
JP,

Another great posting. I know from experience that implementing TDD on a team is difficult but well worth the effort.

TDD teaches OO principles and enforces a clean architecture. You have to decouple your system, you have to provide interfaces into your system and you have to think about how you are going to pass data between the tiers.
Tuesday, June 27, 2006 2:17:14 AM (Mountain Standard Time, UTC-07:00)
JP,

Writing Unit tests is the same as writing the functional specification for your application programmatically. This is in my opinion the correct place to start when developing an application.

Defining your business object's requirements and responsibilities before you start coding is key to getting an overall big picture of what the system must do and also gain some sort of vision of what direction to take my code in. I find that the Dependency Injection pattern always seems emerge from my designs and I end of with a tree like structure of interface dependencies. I thus see TDD as a tool to assist me in the design process of a system. The fact that I end up with test cases is just a bonus.

The issues I am struggling with at the moment are:
- Diagramatically representing flow of activity in the systems I write. I normally use UML sequence diagrams, but I find them limited in terms of bieng able to represent complex scenarios.
- Since I am relatively new to TDD I sometimes have trouble determining which unit tests would be the most relevant to my code.

Questions:
- Do you use any modelling languages like UML?

I really enjoyed your DNR webcast.

Jean

Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):