Document-driven development

doctests are nice things in Python that you can't find in many other programming languages. The fact that documentation can use code examples that are also runnable as tests changes the way TDD can be done, for instance, a part of the documentation can be done through doctests during the development cycle. This approach also ensures that the provided examples are always up to date and are really working.

Building software through doctests rather than regular unit tests can be a part of document-driven development (DDD). Developers explain what the code is doing in plain English, while they are implementing it.