Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

TDD and the Pressure to Create High-Quality Software

DZone's Guide to

TDD and the Pressure to Create High-Quality Software

The qualities of testable code are pretty much the same qualities of high-quality software. What does TDD have to do with this?

· DevOps Zone ·
Free Resource

Learn more about how CareerBuilder was able to resolve customer issues 5x faster by using Scalyr, the fastest log management tool on the market. 

Before test-driven development (TDD), the only thing that applied pressure for high-quality in software development was the knowledge, experience, and commitment of an individual software developer.

After TDD, there was something else.

High quality in software is widely agreed to include the following properties.

High-quality software:

  • Is modular.
  • Is loosely-coupled.
  • Has high cohesion.
  • Has a good separation of concerns.
  • Exhibits information hiding.

Test-driven development is only partially about testing. Of much greater importance is its impact on design.

Test-driven development is development (design) driven by tests. In test-driven development, we write the test before writing code to make the test pass. This is distinct from unit testing. TDD is much more than “good unit testing.”

Writing the test first is important. It means that we always end up with “testable” code.

What makes code testable? Testable code:

  • Is modular.
  • Is loosely-coupled.
  • Has high cohesion.
  • Has a good separation of concerns.
  • Exhibits information hiding.

These are precisely the same properties as those of high-quality code. So, with the introduction of TDD, we now have something else beyond the knowledge, experience, and commitment of a programmer to push us in the direction of high quality. Cool!

Find out more about how Scalyr built a proprietary database that does not use text indexing for their log management tool.

Topics:
software testing ,tdd ,code quality ,devops

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}