---
title: "Discussion on \"Code Structure vs Behavior in TDD\" | Hashnode"
description: "Discussion on \"Code Structure vs Behavior in TDD\". Recently, I wrote a post about my talk at the 1st International Conference on Test-Driven Development (TDD).\nThe post covers the part where I discuss about the notion of robust tests and how unit size impacts robustness.\nIn that post, I leave one que..."
url: "https://hashnode.com/posts/code-structure-vs-behavior-in-tdd/6115482be249483e1210f4de"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Code Structure vs Behavior in TDD](https://mariocervera.com/code-structure-vs-behavior-in-tdd?utm_source=hashnode&utm_medium=feed)

Recently, I wrote a post about my talk at the 1st International Conference on Test-Driven Development (TDD). The post covers the part where I discuss about the notion of robust tests and how unit size impacts robustness. In that post, I leave one que...

Aug 12, 2021 · 6 min read · mariocervera.com  
Read the article

-   [#programming](https://hashnode.com/tag/programming)
-   [#tdd](https://hashnode.com/tag/tdd)
-   [#software-engineering](https://hashnode.com/tag/software-engineering)
-   [#testing](https://hashnode.com/tag/testing)
-   [#design](https://hashnode.com/tag/design)

## Written by

[Mario Cervera](https://hashnode.com/@macerub)

@macerub · Spain

  
[View profile](https://hashnode.com/@macerub)

Software craftsman. I write about Software Engineering (clean code, design, testing, ...) and also about Algorithms & Data Structures.

## Responses 1

Markdown supported · ⌘↵ to post

[Maxi Contieri](https://hashnode.com/@mcsee)

[Aug 14, 2021](https://hashnode.com/posts/code-structure-vs-behavior-in-tdd/6115482be249483e1210f4de/comment/6117cae7e9f08a51fd85fc9d)

Nice post!

Few people understand this

_Adding a new class is not the trigger for writing tests. The trigger is implementing a requirement._

Michael Feathers gives a great definition of a unit

_a Unit test is a fast test_

It is completely unrelated to classes, structure and file naming conventions.

I would mix the two concepts

[Mario Cervera](https://hashnode.com/@macerub)

[Aug 14, 2021](https://hashnode.com/posts/code-structure-vs-behavior-in-tdd/6115482be249483e1210f4de/comment/6117cae7e9f08a51fd85fc9d#reply-61182da0ac5c985f36434123)

Thanks Maxi!

Ian Cooper's statement was an eye-opener to me. The behavior-centric nature of TDD is far from obvious, specially for people that's learning the practice. And the ambiguity of the notion of unit does not help much.

I hope my article contributes to clarify the issue a bit 🙂
