Real-world data prove that Agile, BDD & co. work – lecture by G. Adzic
Join the DZone community and get the full member experience.Join For Free
i’ve attended a very inspirational lecture by gojko adzic , organized by the oslo xp meetup. many people including some respectable persons claim that lean, agile, and high-level testing based on specifications (whether you call it agile acceptance testing, acceptance-test driven development, example-driven development, story-testing, behavior-driven development, or otherwise – let’s call them all specification by example) do not work.
to prove the contrary, gojko has collected over 50 case studies of projects that were very successful thanks to using these methods. in his soon-to-be-published book, specification by example ( download ch1 , a review ), he investigates what these projects and teams had in common, which was missing in the failed ones. so it’s great for two reasons: it documents how great success you can achieve with specification by example and it shows you how to implement it successfully.
in the case you’ve never heard about specification by example before, the idea is (as i understand it with my limited knowledge) that the business users can express their requirements in such a way that it can be directly used for verifying that the system satisfies them. a popular tool in this area is fitnesse , where tests are created as wiki pages with tables containing inputs and expected outputs.
according to gojko, you can achieve great software quality – sometimes up to the point that you can abandon your issue tracking software – thanks to specification by example. however you must implement it properly. some of the key points that he mentioned were ( beware: most of the text is what i understand under what he said, it doesn’t necessarily mean what he actually meant ):
- don’t start with user stories but understand the business goal – the desired effect – first because user stories may already imply a solution. this is, i’d say, rather known but perhaps too often forgotten wisdom.
- specify collaboratively – it’s essential that business users, developers, and testers work together (ideally face to face) on creating the specification for thus a common understanding can arise (we all know that most projects fail due to wrong or misunderstood requirements) and each of them can contribute to increase the quality of the specifications thanks to his unique point of view.
- specification with examples – the user acceptance testing tools such as fitnesse are not intended for integration and full regression testing, it’s nonsense to create tables with hundreds of rows. the “test” should first contain the specification itself in few sentences and then a table with few key examples so that anybody reading it – now or in one year – can easily understand the point. such testable specification is maintainable and can serve its primary purpose of being means of communication between all involved parties and between their current and future selves)
- best specifications/tests are aligned with the business domain , using the same language, concepts, relationships, models as the business people. thus they can understand them and use them as the primary source of documentation and, more importantly, – if you’ve really managed to preserve the models and relationships – a small change in requirements will require only a small change in the software and the tests and vice versa so the business people can directly estimate the impact of changes. one of the key enablers is that tests are not expressed in the terms of clics, css classes, and xpaths, because then it could easily happen that a small change to a webpage header would break hundreds of tests. (and many teams certainly fall into this trap.)
- living documentation – such tests become very valuable and easily accessible documentation of what the system does. of course you must keep it alive, meaning that it must be updated as the system evolves, and the system itself must evolve as the business needs change (including removal of business functionality which is not anymore needed – something often neglected). because the specifications are so close to the system, it’s actually very easy to keep them synchronized, something that is a huge problem with standard documentation.
these are just few points i’ve remembered and i’ve certainly omitted many important things and all the interesting real-world stories that accompany and exemplify.
already for a long time i’m attracted by the concept of specification by example, but i was never sure whether it can really work. thanks to gojko and his book i know it can work and i also have guidance for avoiding the pitfalls and attaining a success. i’m therefore very much thankful to him and looking forward to reading his book.
ps: to be fair, i should mention that also the other lecture of the evening, “lead better – essential skills for software team leadership” by roy osherove was excellent and has brought me new insights into the role of a team leader. i’ve never before thought that team leader should so much care for the personal/professional development of his team members and that helping them grow is his main responsibility (provided that the team isn’t anymore in chaos, having enough problems striving to survive). he shares his ideas about leadership in software teams via 5whys.com , which i’d recommend.
Opinions expressed by DZone contributors are their own.