I believe Test-Driven Development (TDD) can be improved through increased automation, and some of these ideas could likely be adapted to Behavior-Driven Development (BDD) as well.

Test-Driven Development is a manual repeated cycle of writing and running tests, writing the least amount of code to make the tests pass, and finally refactoring code (and tests) to make them shine. Writing tests produces the crucial "side effect" of simultaneously designing the API.

Automating the Coding Part?

The word automated is often mentioned alongside TDD, yet it usually refers only to automated unit test execution (where the tests themselves are still manually written) or automated refactoring (still manually triggered by the developer in an IDE).

Writing implementation code in TDD follows a greedy approach: writing just enough to make tests pass, meaning each TDD cycle typically adds only one or a few short methods called by the new test — small increments of code. These small increments could potentially be induced automatically using machine learning, such as inductive logic programming, program synthesis, or genetic programming.

There are at least two challenges with this:

  1. Readability of induced code — which can still be manually cleaned up during the refactoring step of the TDD cycle.
  2. Scalability of induction — where mocks could potentially be used to prune the search space for the learning algorithm.

Towards API-Driven Design (ADD?)

A hot topic in software testing research is building tools that automatically generate unit tests from code — for example, taking legacy code with low coverage and raising it to high or full coverage. In their simplest form, such tools permute inputs (including corner and extreme values), which often yields huge volumes of variable-quality tests. Smarter tools, such as DSD-Crasher, promise much higher-quality test generation.

Tools like this could fill in missing test cases inside TDD itself: if a developer writes one test with sample input values, the tool could generate the corner-case variants automatically. That nudges development toward API-Driven Design, where the developer defines the contract once without manually writing repetitive test variants.

Remarks on Code Size

I agree with Steve Yegge that size is code's worst enemy, and believe size becomes easier to manage if much of the boilerplate implementation and test permutation is offloaded to the computer so the programmer can focus on API-driven design. I don't think everybody should be afraid of a little typing when it improves readability — yet developers should spare their fingers whenever the computer is eager to fill in.