Executable Specifications

Learn what an executable specification is, and dive into Gherkin.

An executable specification is a requirement or acceptance criteria written in an almost natural language that can be executed by a computer as-is to verify the desired functionality. In simple words, a non-developer can write an executable specification, and a machine can assert the program’s compliance with expectations. Note that a developer’s involvement is necessary to convert the text of expectations into corresponding function invocations.

The benefit of executable specifications is in the expressiveness of acceptance criteria and the ability to verify and see results of checks in an almost natural language instead of dealing with code that means nothing to non-technical people.

Here is a process distillation for writing executable specifications:

  1. A domain expert formulates acceptance criteria using a predefined, almost-natural, and slightly structured language. This step is necessary because it is technically more convenient to connect code with structured language than unstructured.

  2. A developer writes code that associates essential verification programming instructions with every line of acceptance criteria. In simple words, this step translates expectations into a program.

Get hands-on with 1200+ tech skills courses.