Behavior Driven Development

Last night I went down to Draker Laboratories on Pine St. for a presentation on Behavior Driven Development.  The presentation was by Pete Brown in affiliation with "Burlington Web Application Group (BWAG)".

The presentation was excellent and there was a lot of good participation and feedback.  Here are my main takeaways from the presentation.

There were really 2 main topics, test driven development (TDD) which seems to focus on automated unit tests and behavior driven development (BDD) which seems to focus more on automated functional/user tests.  Think of it as automatically testing agile user stories.  If you do TDD well, you are probably doing BDD also.

There are tons of benefits of both of these strategies, but the ones that I liked were how you can get much better decoupled code as a result.  Decoupled code is much easier to reuse.  Also if you create your functional tests first (before writing code), it helps you analyse your requirements.  Then write your unit tests.  Then write your code.  One obvious benefit is code with fewer bugs ;)

When writing code, FAIL the test first.  Then make it work.  Then refactor and repeat.  This is known as the Red, Green, Refactor cycle.

A product called Cucumber was highly recommended for BDD which is a tool that allows you to create user stories and acceptance tests (think agile) and automate the testing of these.  Cucumber works with most languages.  (You can use Jasmine for javascript).

Having said all this, QA starts with developers but definitely does not end there.  You still get a lot of value from real user testing and testing by subject matter experts (SMEs).

Pete mentioned a book called "Refactoring" which came highly recommended.

Another topic that was mentioned was "continuous" testing, which means the minute you change the code, the test is run, so you can get instant feedback.

Finally, Selenium was mentioned as an automated browser testing tool.

There is more I could say, but these are some of the highlights.

Comments

Popular Posts