• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TDD, design, and architecture

 
Allan Halme
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lasse,

What do you feel is the role of TDD in determining the design and architecture of an application?

You mention in a footnote that test-driven development, test-driven design, and test-first programming are all the same thing. I see clearly that test-driven development and test-driven programming are the same thing, but I feel that test-driven design is a broader issue.

At a certain level, TDD most definitely "drives" the design of the code, because of the refactoring that the tests enable you to do.

However, at a higher level of abstraction, there are architectural design decisions, patterns, and structures that--though they may and should evolve over time and during the project--are probably not best determined via the process of test-first programming.

Your thoughts?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Allan Halme:
You mention in a footnote that test-driven development, test-driven design, and test-first programming are all the same thing. I see clearly that test-driven development and test-driven programming are the same thing, but I feel that test-driven design is a broader issue.

At a certain level, TDD most definitely "drives" the design of the code, because of the refactoring that the tests enable you to do.


Fully agreed. I consider all three names synonymous because the tests will affect and drive your design.

Originally posted by Allan Halme:
However, at a higher level of abstraction, there are architectural design decisions, patterns, and structures that--though they may and should evolve over time and during the project--are probably not best determined via the process of test-first programming.


Again, fully agreed. Well, mostly agreed.

The design I talk about in the context of TDD is low level design. It's about objects.

In addition to the everyday design that happens when test driving, in my opinion, you need to have an idea of the system or application architecture. While test driving, you simply work within the constraints of that architecture. When your code is telling you that the architecture is funky, it's time to revise the architecture. That, however, should be a team activity and not a decision of an individual developer.

The reason I said "mostly agreed" is because I consider design patterns to be in the domain of code, not architecture. Architectural patterns again is a bit different.

Originally posted by Allan Halme:
What do you feel is the role of TDD in determining the design and architecture of an application?

To summarize what I tried to say above, I see TDD's role being absolutely essential in determining the design of an application and less essential in determining the architecture of the application.

How does this thinking map to yours?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic