TDD as a Catalyst for Clean Code

An entry about tdd Publication date 12. June 2009 12:46

A few weeks back, I held a lightning talk about Test Driven Development at an internal event for Capgemini. The talk was heavilly influenced by Robert Martin's concept of clean code - I highly recommend that you watch his keynote from Railsconference 2009. Another influence for the lightnign talk was Kent Becks storyteller talk at Railsconf 2008, which is also highly recommended.

Even though my lightning talk was only about 10 mintues long, I had a whooping 24 slides to get through:

The slides won't  tell the story by themselves, so here are the notes I had on my slidecards The cards don't follow the slides, but I had circled keywords on each card to remember when to move forward (some slides were split with several animations etc).

Card 1
Motivation. Two observations about programming.
Ward - the inventor. Wiki, design patterns, XP, Kent Beck.

Card 2
The depth metaphor.
Start coding without all knowledge: Borrowed knowledge.
Need to clean up/improve old code as a result of improved/new knowledge to pay back debt.
If you don't, you loose momentum as old code drags you down.

Card 3
Kathy Sierra. Writer. Head First.
Not only function, but form.
Simpler to maintain, more fun to use, "cool factor".
Less stess, more motivating.

Card 4
Uncle Bob. Objectmentor. Agile manifesto.
Clean Code: 0 WTF's per minute.
Boyscout rule: Check in code cleaner than you checked it out.

Card 5
Fear. "Omg! This code sucks.. I should fix it." -> "Omg! No way I'm touching this - I'll just break it!"
How to remove the fear of refactoring?

Card 6
Change. Great design helps. How to verify changes? Compile? Run? 

Card 7
Empirical evidence.
Kent Beck. Innovator. Ward. XP. Testing
Glenford Myers, Boris Beizer, Bill Hetzel...

Card 8
Unit Testing. 90s. Smalltalk. SUnit.
Unit Testing born. Something missing... Test First?!
Crazy idea, no expectations - but worked!
TDD was born..

Card 9
Three Laws.

Card 10
Result? Productivity! Less debugging. Fear gone! Refactor at will.
TDD => Clean Code.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments

Powered by BlogEngine.NET 1.4.5.0

Welcome!

My name is Fredrik Kalseth, and this is my blog - thanks for visiting! I am fortunate enough to work with what I love for a living, and this blog is essentially the biproduct of that.

I work as a senior consultant for Capgemini, and am also an active participant in the Norwegian .NET community, as an avid attendee but also as a speaker (most recently at NNUG and MSDN Live).

As a developer, I have a wide circle of interest. My primary passion is for agile, test-driven development, with focus on best practices and clean code. That said, I also love to work on the frontend, especially with web development.

On Twitter? My handle is fkalseth. On LinkedIn? I`m there too.

NDC 2010

The conference to attend this summer happens June 16th-18th in Oslo, Norway. Are you going? Be sure to catch my talk on AOP while you're there!

 

Disclaimer

This is a personal blog; any opinions expressed here are my own and do not necessarily reflect those of my employer. All content herein is my own original creation, and as such is protected by copyright law. Unless otherwise stated, all source code posted on this blog is freely usable under the Microsoft Permissive License.

What Readers Talk About

Comment RSS