Djangocon: the power of natural language - Ilja Bauer

Tags: djangocon, django

(One of the summaries of a talk at the 2014 djangocon.eu.)

Ilja Bauer’s talk has as subtitle “from ATDD to lean modeling”. ATDD means Acceptance Test Driven Development.

Constantine the African was an ancient physician and one of the first ones to use test driven development: he tested people’s morning urine manually and could check whether they had diabetes or not. This is however a very manual process. In our test driven development, we can luckily automate a lot.

Software development is a communication problem. He showed a picture of the biblical Tower of Babel where people couldn’t understand each other anymore because they suddenly spoke different languages. It sometimes seems the same with the way our customers’ requirements somehow doesn’t quite end up in the software in the right way. Do we really understand each other?

A solution can be acceptance test driven development: you write the acceptance tests together with the programmer.

  • The client has a request.

  • You write down the requirements as textual scenarios.

  • You need to somehow convert the text into an automated acceptance test. He currently uses natspec, a plugin for Eclipse that is free for open source projects.

  • You write the software and continuously check it in the normal test driven development manner.

The advantage of textual scenarios in combination with natspec is that you have context. Every sentence works in the context of the whole document. So “open that page” uses the last meaning of “that page”.

The advantage of ATDD is that you continuously know how many features you have actually implemented.

You can go even further with using natural language. You can use it to describe your domain and try to generate part of your data model and application code out of it.

He showed a demo where he used (again) natspec to generate part of a django application. Natspec normally creates functions based upon the textual description. He tweaked the process a bit and got those functions to actually output a proper models.py.

In the same way he demoed a form consisting of multiple steps. Including optionally skipping step 3 (“billing address if it is different from the shipping address”) based on a checkbox. And of course, the textual description was not only used to generate the form, but also to generate an acceptance test.

You could look at https://github.com/iljabauer/django-leanmodelling or https://github.com/iljabauer/natpsec-example-python .

http://reinout.vanrees.org/images/2014/Djangocon_conference_hall.jpg

The django conference main hall on the Embriez island.

 
vanrees.org logo

Reinout van Rees

My name is Reinout van Rees and I program in Python, I live in the Netherlands, I cycle recumbent bikes and I have a model railway.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):