# Behaviour driven development in OCaml

**URL:** <https://discuss.ocaml.org/t/behaviour-driven-development-in-ocaml/1814>\
**Category:** Ecosystem\
**Tags:** bdd, testing\
**Created:** [April 5, 2018, 3:13pm UTC](https://discuss.ocaml.org/t/behaviour-driven-development-in-ocaml/1814 "2018-04-05T15:13:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![egoholic](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/egoholic/32/574_2.png) [@egoholic](https://discuss.ocaml.org/u/egoholic)\
**Post date:** [April 5, 2018, 3:13pm UTC](https://discuss.ocaml.org/t/behaviour-driven-development-in-ocaml/1814/1 "2018-04-05T15:13:58Z")

</div>

Could you please share your experience and technological stack for BDD. I’m interested in which testing frameworks/libraries you’re using, how you configure them and all BDD/testing-related best practices in OCaml community.

---

<div class="post-metadata">

**Author:** ![cyocum](https://avatars.discourse-cdn.com/v4/letter/c/b5e925/32.png) [@cyocum](https://discuss.ocaml.org/u/cyocum)\
**Post date:** [April 6, 2018, 9:47am UTC](https://discuss.ocaml.org/t/behaviour-driven-development-in-ocaml/1814/2 "2018-04-06T09:47:27Z")

</div>

I had planned to hold off an announcement until a better time when I had more features. However, I and @Thegaram, who has been a great help, are working on [Cucumber.ml](https://github.com/cucumber/cucumber.ml) which is progressing towards implementing Cucumber in OCaml. I would caution that we are still in very early stages but if you are interested in it, please head over to the repository and have a look.

Things we can already do:

- Given, When, Then already work so there is a basic runtime.
- Before and After hooks work.
- State passing between steps by default

Things that are outstanding:

- Tags do not work at the moment (the structures are there but we need to hook them up)
- Running multiple feature files from the command line (we need to implement command line arguments but I am bouncing back and forth on using a getopt library or Cmdliner)
- I am sure there are things that I am missing

I will be attending CukenFest in London later in the month and I will be doing the OSS hack day so I am hoping to get basic tags working then.

---

<div class="post-metadata">

**Author:** ![egoholic](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/egoholic/32/574_2.png) [@egoholic](https://discuss.ocaml.org/u/egoholic)\
**Post date:** [April 6, 2018, 10:08am UTC](https://discuss.ocaml.org/t/behaviour-driven-development-in-ocaml/1814/3 "2018-04-06T10:08:08Z")

</div>

Thank you for your response. Cucumber is a good tool for end2end testing, however I’m more interested in tools like RSpec in Ruby which provides a BDD-tool for black box unit testing. Don’t you know testing solutions similar to RSpec?

---

<div class="post-metadata">

**Author:** ![cyocum](https://avatars.discourse-cdn.com/v4/letter/c/b5e925/32.png) [@cyocum](https://discuss.ocaml.org/u/cyocum)\
**Post date:** [April 6, 2018, 10:17am UTC](https://discuss.ocaml.org/t/behaviour-driven-development-in-ocaml/1814/4 "2018-04-06T10:17:24Z")

</div>

Having looked at RSpec very quickly, it seems similar to Jasmine. Sadly, I do not know anything at this time in OCaml that is similar to RSpec. Although, I imagine that you could possibly build something similar based on [OUnit](http://ounit.forge.ocamlcore.org/).

---

<div class="post-metadata">

**Author:** ![Thegaram](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/thegaram/32/846_2.png) [@Thegaram](https://discuss.ocaml.org/u/Thegaram)\
**Post date:** [April 6, 2018, 10:18am UTC](https://discuss.ocaml.org/t/behaviour-driven-development-in-ocaml/1814/5 "2018-04-06T10:18:37Z")

</div>

There is [ospec](https://github.com/andrenth/ospec). Unfortunately, it is not actively developed anymore.
