Create a gist now

Instantly share code, notes, and snippets.

@zsup /ddd.md
Last active Aug 8, 2017

What would you like to do?
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.
  • Documentation and software should both be versioned, and versions should match, so someone working with old versions of software should be able to find the proper documentation.

So, the preferred order of operations for new features:

  • Write documentation
  • Get feedback on documentation
  • Test-driven development (where tests align with documentation)
  • Push features to staging
  • Functional testing on staging, as necessary
  • Deliver feature
  • Publish documentation
  • Increment versions

zlosch commented Oct 3, 2016 edited

Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.

We're doing this for REST APIs, which have a formal specification (RAML). We use it to generate the documentation and parse it in tests to verify the implementation. But how can it be done with purely textual documentation?

One version on the purely textual:

We give the repo/readme to a "non-technical" person, interns, or more junior level engineers and see if they can reproduce the desired effect, stand up the app, or break it. Probably not a great workflow but we have noticed that as sample size ^ the perception of documentation quality seems to ^

Do you have any reference about document generation tool supporting DDD ?

Excellent - why don't you turn this into a repo that can be extended with more ideas ...

agree @ssmusoke; you should make this a repo

CsharpOnLinuxDev commented Apr 17, 2017 edited

Personally, I find documentation driven development approach to work very well with LaTex on Git to support callaborative development.

mikosullivan-dev commented Jun 14, 2017 edited

I'm really glad to see this idea is growing. I'm working on two projects through DDD: Testmin and Minvee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment