The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Is it possible to have TDD without OO?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Piergiuliano Bossi

Posts: 92
Nickname: thebox
Registered: Jan, 2004

Piergiuliano Bossi is an XP coach & programmer & curious mind since a lot of time
Is it possible to have TDD without OO? Posted: Dec 23, 2005 10:54 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Piergiuliano Bossi.
Original Post: Is it possible to have TDD without OO?
Feed Title: theboxx
Feed URL: http://docs.codehaus.org/dashboard.action
Feed Description: Ideas, thoughts, feedback, rants and some noise about XP, agile, ruby, Fitnesse, etc.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Piergiuliano Bossi
Latest Posts From theboxx

Advertisement

On the Italian Extreme Programming mailing list there was a discussion originated from my TDD live demo held on the Second Italian Agile Day (more on this in a later post). At a certain point of the discussion it came up the idea that TDD and OO design are not necessarily tightly connected. Well, I disagree and here's my take on that.

Let's put it simple: there is no TDD without refactoring, that is refactoring is a constituent part of TDD, not something beyond TDD that I can consider as an option. TDD micro-cycle is: test => red bar => code => green bar => refactor => green bar. If you don't refactor you are not following TDD.

Period.

Let's consider now that refactoring is OO. There is no refactoring without OO. The smells that you recognize into code are another symptoms for rigidity, fragility, immobility. Every refactoring move is justified by 3 criterias:


  • enhance code readability
  • reduce coupling between classes/modules
  • enhance cohesion of classes/modules

Apart from readability, every refactoring move if correctly applied brings to OO design. What means correctly applied? It means if applying that move is appropriate, that is if it doesn't increase rigidity, fragility or immobility, that is if it doesn't introduce new smells. Refactoring means applying ex-post OO design principles.

Because of these reasons design is typically decomposed in several classes and responsibilities are fine-graned assigned.

Another period.

Is it possible to apply TDD following the functional paradigm? I don't know, my lisp reminiscences are too old. Today I would tend to write OO lisp code, merging together the good of both functional and OO paradigm. I'm quite sure that I would end doing something that is not TDD, probably closely related to, but not exactly TDD for what is commonly meant.

Read: Is it possible to have TDD without OO?

Topic: No change, no change! Previous Topic   Next Topic Topic: Firefly: Just not poular enough

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use