<p>Is the real benefit in <code>TDD</code> the actual testing of the application, or the benefits that writing a testable application brings to the table? I ask because I feel too often the conversation revolves so much around testing, and not the total benefits package.</p>

[{'answer_id': 50959, 'author': 'harpo', 'author_id': 4525, 'author_profile': 'https://Stackoverflow.com/users/4525', 'pm_score': -1, 'selected': False, 'text': "<p>Automated testing keeps humans from doing a machine's job.</p>\n\n<p>Test-driven development maximizes the amount of automated testing.</p>\n\n<p>Beyond a certain point, of course, a human is still required.  You reach diminishing returns when you try to apply TDD beyond that point.</p>\n"}, {'answer_id': 50960, 'author': 'Jonas Follesø', 'author_id': 1199387, 'author_profile': 'https://Stackoverflow.com/users/1199387', 'pm_score': 3, 'selected': False, 'text': '<p>TDD helps you design your software. The tests becomes the design. By writing the test first you think about your code from a consumer perspective, making a more user friendly and more compact software design.</p>\n\n<p>Also, by applying TDD you typically end up writing your code in a way where you can supply test mocks and stubs. This leads to less coupled software, making it easier to change and maintain over time.</p>\n\n<p>So I guess allot of the talk around TDD is about testing, but by doing that other big benefits follow, such as quality (coverage), flexibility (decoupling), better design (think as the consumer of the API).</p>\n'}, {'answer_id': 50961, 'author': 'Kevin Pang', 'author_id': 1574, 'author_profile': 'https://Stackoverflow.com/users/1574', 'pm_score': 1, 'selected': False, 'text': "<p>The real benefit of TDD is <em>supposed</em> to be that it allows you to modify/refactor/enhance your application without worrying about whether you've broken existing functionality.  The fact that writing unit tests tends to result in loosely coupled code and better architecture isn't necessarily the <em>point</em> of TDD, but I think it's hard to have one without the other.  </p>\n\n<p>You can't really experience the benefit of TDD unless you have unit tests with good coverage.  In order to do that, you're going to have to write testable code.  That's why the two are often used in conjunction or in place of one another.</p>\n"}, {'answer_id': 50962, 'author': 'Vinko Vrsalovic', 'author_id': 5190, 'author_profile': 'https://Stackoverflow.com/users/5190', 'pm_score': 2, 'selected': False, 'text': "<p>The real improvement is that it is a good way to force you to really think through the design and implementation. Then, once you've prepared the tests and written the code, solutions to unforeseen problems appear more easily.</p>\n\n<p>Something that usually happens to me that is a good analogy: When I'm going to post a question to a forum or IRC channel, I like to have the problems well written and fully described, many times the process of preparing a well written and complete description of the problem magically makes the solution appear.</p>\n"}, {'answer_id': 51086, 'author': 'dan gibson', 'author_id': 4495, 'author_profile': 'https://Stackoverflow.com/users/4495', 'pm_score': 0, 'selected': False, 'text': "<p>Automated testing is such a time saver and confidence booster when you are developing a product that you'll ship multiple versions of. With automated tests, you know that you haven't broken anything between versions. This especially helpful when your product is something that people can write add-ons for - you don't want to break their add-ons between versions.</p>\n\n<p>With TDD, you get a good suite of tests as you develop. Without TDD writing those tests is much more difficult.</p>\n"}, {'answer_id': 59288, 'author': 'Pat Notz', 'author_id': 825, 'author_profile': 'https://Stackoverflow.com/users/825', 'pm_score': 0, 'selected': False, 'text': '<p>Michael Feathers has an insightful blog post about this titled <a href="http://michaelfeathers.typepad.com/michael_feathers_blog/2008/06/the-flawed-theo.html" rel="nofollow noreferrer">The Flawed Theory Behind Unit Testing</a>.  Seriously, go read it.  The punch line is </p>\n\n<blockquote>\n  <p>All of these techniques have been shown to increase quality.  And, if we look closely we can see why: all of them force us to reflect on our code.</p>\n</blockquote>\n\n<p>but you should read the full post for the context.</p>\n'}]
['https://Stackoverflow.com/questions/50954', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3517/']