Posts Tagged ‘cucumber’

From requirement to live document ? can we remove waste ?

Friday, January 6th, 2012

I had some discussion in previous blog Specification by Example – The way to enhance testing & Requirement for this.

Let’s continue.

Background

Now let’s take a look at in normal product development, what’s work flow for the requirement towards customer document and system document.

image

Requirement is put into focalpoint (or others) and bring to R&D, scrum is mostly used, product backlog and Sprint backlog will be generated in excel or agile tools (including redmine, teamforge, jira, whiteboard), it covers from high level requirement to user story level.

Testers start to analysis the requirement and generate test specification level document in word, it will be reviewed by senior group and put stamp – go!. test case description is more detail on use case testing level, mostly they will be converted into real test case script for automation inside CI.

When the project goes to end, test report is requested to be finalized and stored somewhere.

CPI technical writer will collect all the information and write in tagtool for CPI (product customer document)

System managers will collect information to update system document like System Architecture Description.

Observation

Every document exists for some reason, while from agile/lean point of view.

Do you see any waste here ? waste on the documentation and waste on time to write the document ?

Do you still understand the purpose of those documentation ?

And please don’t think from your roles (testers, managers, technical writters), stand from of your product.

From my point of view, the designer area (coding) is much improved compare to before, most of APIs are genrated into documentation automatically, quality is promised via tools like CI, sonar.

Specification by example

I don’t want to repeat the famous free delivery for bookstore example from “Specification by example” on how it could work with less waste, please read it sample chapter 2 from manning directly.

image

Possible solution for us

I don’t state it can 100% work for us, just give idea how it can work

We can combine all the test documents to cucumber (one nice tool) feature files like below

image

below the Feature title, we can add detail background for the requirement, it can surve as test spec.

All the scenarios are exactly the same as test case description on detail enough for testing.

This specification (test case) could be directly executed by cucumber driver.

When the test case is executed, it could be automatically generated into html file, it could be test report

image

And if we had some scripts to convert .feature to latex/docbook, it can be automatically generated high-quality documents like pdf, since we can predefine some structure, which can be mapped to end result.

See good example from Pro Git book.

image image image 

From left to right: markdown plaintext, simple html, ebook pdf format. (it is coverted by pandoc to latex and texlive to pdf)

Furthermore, .epub (iPad), .mobi (Kindle) are supported as well, and everything is automatically.

And this could happen for us as well.

Summary & Go ahead

image Probably you want to challenge again that it doesn’t work for you because blah, blah, then I recommend to buy the book “Specification by example” from Gojko Adzic

I will continue to look into this area and I will try my best to remove useless project document using “Specification by example” and Cucumber.

Specification by Example – The way to enhance testing & Requirement

Wednesday, December 28th, 2011

image

Probably you are playing with agile for a while and notice some problems for testing and requirement handling, then I want to recommend “Specification by Example”

Let’s start with problem

Problem in requirement handling and testing

Testers are used to follow and verify the implementation

In traditional software development, it is pure waterfall, system level define the requirement, and testers write test specification on how to test it, designers are implementing it. After the coding is finished, the live system is verified by testers according to the test spec.

When we turns to agile way of working, mostly this model will be kept without change, some teams even use small waterfall inside the team.

Lots of technical debts come out in end of each iteration because there are gaps between testers’ understanding and designers’ undestanding, then people are used to complain on the requirement.

In the same time, tester’s motivation is used to be low, they just simple verify what has been done. Some senior testers used lots of method to make sure all the bugs can be found, which is great.

BUT do we testing the right thing ? !!!

No practical way to clarify the requirement

Some sites may run agile better, they invited PO frequently to clarify the requirement, and had PBR “Product Backlog Refineworkshop” meeting (see Craig & Bas’s book “Practices for Scaling Lean & Agile Development”). While this is just the framework, people mostly had problem how to make it effiency, and how to get the requirement and make it clearly.

ATDD doesn’t work

When quick scan the “Specification by example”, most people will treat it is the same as ATDD and BDD, while in the book and his workshop, he clearly stated,” yes, they are quite similar, and there are more mind-set changes for SBE”.

The importance of SBE is to the practical way to clarify the specification by examples, here are the key process patterns, I used to use this pursuide my colleagues

image

Some tips to deploy Specification by Example

it cannot be described easier in one blog, let give some tips that I used if you want to try

Start without tool

I made this mistake before as well, since mostly we will use tool to support your automation (this is good, but tough task), therefore I didn’t make ATDD works in my product.

It is quite easy to focus on automation instead of clarifying the requirement when you deploy it, so start without tool.

In my pilot, I just ask the testers (they are trainined for this concept for sure) to write specification with what SBE suggested, put the business value inside instead steps.

Understand the tool, but it is not necessary

People are used to lost why do this in this kind format, so you need to understand some tools to see how it can be automated to execute the specification and automate it easily.

There are lots of nice tool, like cucumber (http://cukes.info/), which is most popular and useful tool, and I push team members to write in its format.

image

Fitnesse and RobotFramework are good, but I don’t recommend, since they are built long time ago, it can support SBE, but they are not generated by SBE concept, while cucumber do comes from that.

Can do it as well for your products

People are used to say, “yeah, it works for web application, but our product is different”, it is not true. The way to clarify the requirement is the same, surely it may be more difficult and not so straight, but it do works.

You can read his book as well for some patterns.

Start with small and you can get benefit directly

Summary

I list some benefits so far for my consultant service on this area after 1-2 months (surely other practices are applied as well)

  1. Testers get more motivation than before, since they drive the requirement clarification and notice the importance the role inside the team, they drive what to implement
  2. Requirements are easier to be clear compare to before, therefore the technical debt from this is gone, less waste.

Therefore, I do suggest

  • Buy this book or at least read some free excellent sample chapters from manning to understand it, if possible, join his workshop
  • Try it and it can work from day one, trust me.