Jump to content

Recommended Posts

Posted

What are your thoughts on TDD?

 

I find that writing tests first helps me determine the behavior of legacy systems when writing software to integrate with them. Unexpected and undocumented behaviors in legacy software are exposed through testing. Truth. It seems that these same anomalies would have taken much longer to surface without TDD.

 

Writing tests first also seems to*yeild more time to consider design patterns to use in new code.

 

What is certainly true is that once a threshhold is passed, somewhere along the path of adopting TDD, it is much too compelling to stop using it. It's fun and it builds confidence that new code is a best possible design.

 

Those who have not tried TDD seem, to a person, to bring three arguments against it: 1) it takes too much time, 2) it does not add any inherent value to the deliverable, 3) it breaks the object-oriented design principles into more procedural designs.

 

Only argument 3 has any possible merit, but it is also false. TDD*leads*many to*a change of philosophy to simplify object models.

Single-purpose classes are more readily testable and simplicity proves best design regardless of the rationale. Monolithic objects now appear the way flat-table designs did after the widespread switch to relational database designs.

 

The difficulty for TDD is how to test UI components' interaction with codebase. This one issue proves difficult for TDD advocates to "sell" to holdouts. The use of Model-View-Presenter does mean more code; seperating the UI from its state and events (in order to mock the UI programmatically in tests)*is more work. TDD coders are OK with more work, but those who don't want to start using TDD can argue to management that this is waste and attempt to obscure the benefit of TDD on argument 1 again.

 

Good news is that management is becoming more primed to advocate adoption of TDD; "we're an Agile shop" is the bellweather.

 

In summary,*have one sentence to use for kicking sand at others: 99% of programmers who reject TDD have never used it, and the other 1% are trying to save face.

 

 

 

 

More...

 

View All Our Microsoft Related Feeds

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...