For comments, Use this tweeter post

In fact, you are probably already doing Example Driven Development (EDD) without being aware of it ! This last week-end I realized I was designing software using this approach.

Example Driven Development is simply write code examples which are independent with progressive complexity while having one objective in mind (the software you want to write) :

  1. Write generic examples to
    • Improve your knowledge of the programming language you have chosen
    • Learn how to use the API you expect to use
  2. Write experimental examples to validate your choices
    • Try a single simple feature as an example
    • Check performance behavior, easy of use
  3. Write proof of concepts as code examples to
    • Iterate and fail fast
    • As soon as an example looks good, keep it and start a new better one
    • OF COURSE USE THEM in real world situations
  4. Then with complexity increase, create a true software project with its dedicated GIT repository
    • Switch Test Driven Development (TDD) approach
    • but you will still continue to use EDD, believe me ;)

Example Driven Development requires some rules and in fact while writing those words, I realized I’ve already described them in “The rules for good code examples” article :

The only differences is that you’ll write a set of code examples, with progressive complexity increase, for your current software objective. This set is your EDD living code examples for your current software objective.

Even better, I followed the EDD without naming it while I was writing my code-examples-manager (CEM) software. I’ve of course archived all the steps, which perfectly illustrate the EDD principles and the associated intellectual approach :

  • 2019-05 - 5 examples to prepare myself and learn Github API
  • 2019-06 - CEM PoC#1 proof of concept as code example (in production for my own usage)
  • 2019-07 - CEM PoC#2 proof of concept as code example (in production for my own usage)
  • 2019-08 - CEM Switch to a real world project : created the github project
  • 2019-09 - CEM in production for my own usage
  • 2020-07 - CEM First public release, feature complete, of course still in production for my own usage
  • 2021-04 - Learning ZIO, wrote more than 40 examples written and maintained
  • 2021-05 - CEM Full refactoring - pure functional - My first ZIO app ! It has replaced the old implementation.
  • 2021-05 - search engine code examples to prepare an elasticsearch based search engine for the published code examples
  • 2021-12 - CEM Search & Execution Engine POC

By practicing it, I can now say that EDD is perfect for individual software development, but not only I’m convinced it is also suitable for at least small coding teams, may be a subject for a next article as soon as I’ll have enough data and/or feedbacks.

That’s all Folks.

For comments, Use this tweeter post