ThoughtWorks
  • Kontakt
  • Español
  • Português
  • English
  • 中文
Übersicht
  • Delivery Mindset trifft Software-Exzellenz

    Verfolgen Sie einen innovativen Ansatz in der Softwareentwicklung, um noch schneller erfolgreich zu sein.

    Erkenntnisgestützte Entscheidungsfindung

    Nutzen Sie Ihre Datenbestände, um neue Geschäftsmöglichkeiten zu erschließen.

  • Betriebsmodelle ohne Reibungsverluste

    Verbessern Sie die Fähigkeit Ihres Unternehmens, auf Veränderungen zu reagieren.

    Plattform Strategie

    Entwicklung dynamischer Technologieplattformen, die sich an Ihre Geschäftsstrategie anpassen.

  • Experience Design und innovative Produkte

    Liefern Sie schnell außergewöhnliche Produkte und Kundenerlebnisse. Entwickeln Sie Design und Funktion kontinuierlich weiter.

    Partnerschaften

    Nutzung unseres Netzwerks aus vertrauenswürdigen Partnern, um noch bessere Ergebnisse für unsere Kunden zu erzielen.

Übersicht
  • Automobil
  • Clientech, Energie und Versorgung
  • Banken und Versicherungen
  • Gesundheit
  • Medien
  • Non-Profit
  • Öffentlicher Sektor
  • Handel und E-Commerce
  • Reise und Transport
Übersicht

Unsere Empfehlungen

  • Technologie

    Ausführliche Betrachtungen neuer Technologien.

  • Business

    Aktuelle Business-Insights, Strategien und Impulse für digitale Querdenker.

  • Kultur

    Insights zu Karrieremöglichkeiten und unsere Sicht auf soziale Gerechtigkeit und Inklusivität.

Digitale Veröffentlichungen und Tools

  • Technology Radar

    Unser Leitfaden für aktuelle Technologietrends.

  • Perspectives

    Unsere Publikation für digitale Vordenker*innen

  • Digital Fluency Model

    Ein Modell zur Priorisierung digitaler Fähigkeiten, um für das Unvorhersehbare bereit zu sein.

  • Decoder

    Der Technology-Guide für Business Entscheider

Alle Insights

  • Artikel

    Expertenwissen für Ihr Unternehmen.

  • Blogs

    Persönliche Perspektiven von ThoughtWorkern aus aller Welt.

  • Bücher

    Stöbern Sie durch unsere umfangreiche Bibliothek.

  • Podcasts

    Spannende Gespräche über das Neueste aus Business und Technologie.

Übersicht
  • Bewerbungsprozess

    Finde heraus, was dich in unserem Bewerbungsprozess erwartet.

  • Hochschulabsovent*innen und Quereinsteiger*innen

    Dein Einstieg in die IT-Welt.

  • Stellenangebote

    Finde offene Stellen in deiner Region.

  • In Kontakt bleiben

    Abonniere unsere monatlichen Updates.

Übersicht
  • Konferenzen und Events
  • Diversity und Inclusion
  • Neuigkeiten
  • Open Source
  • Management
  • Social Change
  • Español
  • Português
  • English
  • 中文
ThoughtWorksMenü
  • schließen   ✕
  • Unsere Services
  • Unsere Kunden
  • Insights
  • Karriere
  • Über uns
  • Kontakt
  • Zurück
  • schließen   ✕
  • Übersicht
  • Delivery Mindset trifft Software-Exzellenz

    Verfolgen Sie einen innovativen Ansatz in der Softwareentwicklung, um noch schneller erfolgreich zu sein.

  • Experience Design und innovative Produkte

    Liefern Sie schnell außergewöhnliche Produkte und Kundenerlebnisse. Entwickeln Sie Design und Funktion kontinuierlich weiter.

  • Betriebsmodelle ohne Reibungsverluste

    Verbessern Sie die Fähigkeit Ihres Unternehmens, auf Veränderungen zu reagieren.

  • Erkenntnisgestützte Entscheidungsfindung

    Nutzen Sie Ihre Datenbestände, um neue Geschäftsmöglichkeiten zu erschließen.

  • Partnerschaften

    Nutzung unseres Netzwerks aus vertrauenswürdigen Partnern, um noch bessere Ergebnisse für unsere Kunden zu erzielen.

  • Plattform Strategie

    Entwicklung dynamischer Technologieplattformen, die sich an Ihre Geschäftsstrategie anpassen.

  • Zurück
  • schließen   ✕
  • Übersicht
  • Automobil
  • Clientech, Energie und Versorgung
  • Banken und Versicherungen
  • Gesundheit
  • Medien
  • Non-Profit
  • Öffentlicher Sektor
  • Handel und E-Commerce
  • Reise und Transport
  • Zurück
  • schließen   ✕
  • Übersicht
  • Unsere Empfehlungen

  • Technologie

    Ausführliche Betrachtungen neuer Technologien.

  • Business

    Aktuelle Business-Insights, Strategien und Impulse für digitale Querdenker.

  • Kultur

    Insights zu Karrieremöglichkeiten und unsere Sicht auf soziale Gerechtigkeit und Inklusivität.

  • Digitale Veröffentlichungen und Tools

  • Technology Radar

    Unser Leitfaden für aktuelle Technologietrends.

  • Perspectives

    Unsere Publikation für digitale Vordenker*innen

  • Digital Fluency Model

    Ein Modell zur Priorisierung digitaler Fähigkeiten, um für das Unvorhersehbare bereit zu sein.

  • Decoder

    Der Technology-Guide für Business Entscheider

  • Alle Insights

  • Artikel

    Expertenwissen für Ihr Unternehmen.

  • Blogs

    Persönliche Perspektiven von ThoughtWorkern aus aller Welt.

  • Bücher

    Stöbern Sie durch unsere umfangreiche Bibliothek.

  • Podcasts

    Spannende Gespräche über das Neueste aus Business und Technologie.

  • Zurück
  • schließen   ✕
  • Übersicht
  • Bewerbungsprozess

    Finde heraus, was dich in unserem Bewerbungsprozess erwartet.

  • Hochschulabsovent*innen und Quereinsteiger*innen

    Dein Einstieg in die IT-Welt.

  • Stellenangebote

    Finde offene Stellen in deiner Region.

  • In Kontakt bleiben

    Abonniere unsere monatlichen Updates.

  • Zurück
  • schließen   ✕
  • Übersicht
  • Konferenzen und Events
  • Diversity und Inclusion
  • Neuigkeiten
  • Open Source
  • Management
  • Social Change
Blogs
Wählen Sie ein Thema
Alle Themen ansehenschließen
Technologie 
Agiles Projektmanagement Cloud Continuous Delivery  Data Science & Engineering Defending the Free Internet Evolutionäre Architekturen Experience Design IoT Sprachen, Tools & Frameworks Modernisierung bestehender Alt-Systeme Machine Learning & Artificial Intelligence Microservices Plattformen Sicherheit Software Testing Technologiestrategie 
Geschäft 
Financial Services Global Health Innovation Retail  Transformation 
Karriere 
Karriere Hacks Diversity und Inclusion Social Change 
Blogs

Themen

Thema auswählen
  • Technologie
    Technologie
  • Technologie Überblick
  • Agiles Projektmanagement
  • Cloud
  • Continuous Delivery
  • Data Science & Engineering
  • Defending the Free Internet
  • Evolutionäre Architekturen
  • Experience Design
  • IoT
  • Sprachen, Tools & Frameworks
  • Modernisierung bestehender Alt-Systeme
  • Machine Learning & Artificial Intelligence
  • Microservices
  • Plattformen
  • Sicherheit
  • Software Testing
  • Technologiestrategie
  • Geschäft
    Geschäft
  • Geschäft Überblick
  • Financial Services
  • Global Health
  • Innovation
  • Retail
  • Transformation
  • Karriere
    Karriere
  • Karriere Überblick
  • Karriere Hacks
  • Diversity und Inclusion
  • Social Change
Software TestingPuneTechnologie

Test-Induced Design Damage. Fallacy or Reality?

Anand Bagmar Anand Bagmar

Published: May 27, 2014

There is an intriguing ongoing debate between Martin Fowler, Kent Beck and David Heinemeier Hansson (DHH) about Test Driven Development (TDD) and its impact on software design.

Though there were strong agreements and disagreements all along the way, one thing stood out to me all the way - there is no right or wrong answer. The answer depends on the context. There are various parameters and considerations to be examined to determine what answer you come up with.

As Kent said sometime during the beginning of Part 3, “Almost no question in Computer Science can be answered as A or B. The answer starts with “it depends” and what it depends on is the interesting part.”

After the 1st part, Fabio Periera published his thoughts about “Mockists Are Dead. Long Live Classicists". Below are my key takeaways from Part 2 of the series - Test-induced design damage.

Martin started with summarizing the themes:

  1. Is TDD the cause of damage to design?

  2. Is it actually damaging or is it a good thing?

  3. How can we tell if something is damaging or not? How do we judge that?

DHH shared this example of “ test-induced design damage”. He opined that the larger the code base is, the more difficult it is to change because TDD creates multiple levels of redirection to be kept in sync. As a result - it is costly to change, costly to understand what the layers of indirection are doing, and costly to understand what the system is doing.

People get addicted to TDD leading to overkill. Using more code to do the same thing is bad - unless there is a domain complexity that needs to be broken down. The cost of every additional wrapper or layer of indirection is a high price to pay in terms of understanding, evolution, maintenance.

Kent offered the middle ground of focusing more on getting an understanding of when each of the design approaches is worth the cost and when it isn’t. You cannot apply all design ideas every time to everything. Context is important - else you will be in deep yogurt whether you write tests or not. While TDD does put evolutionary pressure on design, testability as a principle also puts pressure on the design. What is the right grain size for the tests? People want to go to either one end or the other. Whereas the goal should be about being aware of the different dimensions and adapting the style to the actual cost benefit structure that you are currently facing. It is ok to not take extreme positions on TDD.

Martin felt that this test-induced design damage has nothing to do with TDD. The driver is the desire to make something testable. Is the need for isolation from different layers the driver of why TDD leads to bad design? When people say they want to create indirection layers, they actually want to isolate themselves from specific layers (ex: rails / database). They want the app to be independent of the environment and the world around it

However, DHH countered that people see isolation as a goal because of TDD, because something that is isolated is easier to unit test. For instance, in the context of a MVC Rails application, isolating the layers and testing only the controller / application doesn’t necessarily help. The relationship between cohesion and coupling should be fluid and well balanced - at times you want to make things highly coupled instead of aiming for loosely coupled. In ideal situations - testing drives to a better design. Tests should tell me about how I can make my system better. Instead with most cases with TDD, the opposite happens- this is easily testable, thus it’s better. This is a fallacy that a lot of poor decisions are being driven off. It is not a trade off.

Building on the email example that DHH shared, Kent had another interesting counter insight - the option of reifying the intermediate result. For instance, in the case of compilers - parse tree, single assignment form, or some symbolic form of assembly code as intermediate results - the objective and  tradeoff of reifying these intermediate results can add much leverage in the testability and design. Mocking is not the only way to eliminate external dependencies. In case of testing emails, there is probably a missing piece of the design when thinking about how intermediate results can help make the code more testable without needing to use mocks. When one faces difficulty in testing, or finds the system very hard to test, it is usually a symptom of poor system design. We should ideally aim for testable design that is easy to comprehend, easy to use and easy to modify in various different contexts.

In Summary

Martin, Kent and DHH brought great points to mull over on the table. What resonated with me was the emphasis on designing the testing plan, strategy and execution in the context of the product-under-test (something I’ve found to be very helpful in my experience) and a growing shift to using context-driven and testable design at the very start of the product life-cycle.

What are your thoughts on TDD and Test-induced design damage?

  • Unsere Services
  • Unsere Kunden
  • Insights
  • Karriere
  • Über uns
  • Kontakt

WeChat

×
QR code to ThoughtWorks China WeChat subscription account

Presseanfragen | Datenschutz | Impressum | Modern Slavery statement ThoughtWorks| Barrierefreies Webdesign | © 2021 ThoughtWorks, Inc.