Connecting...

back to xpand blog

Ruby & Cucumber- So Hot Right Now

9th Apr 2014

Blank

What’s hot in Testing Technology right now? Ruby & Cucumber… sounds like an exotic salad combination right?  Not quite… Cucumber is a BDD (Behaviour Driven Development) testing tool and framework. This means its software development process is based on Test Driven Development (TDD).   Cucumber itself is written in Ruby but it can be used to “test” code written in other languages including Java, C# and Python. 

Cucumber is fast becoming the standard for acceptance testing.  With the use of Cucumber, the user describes the behaviour of the system with natural languages with some specific keywords.  The step definitions are written in Ruby.  This gives a great deal of flexibility on how the test steps are executed.  It can also be combined with web automation framework to implement browser based web automation tests.

Just when you think you know everything about Cucumber, Gherkin is the language that Cucumber understands (technically speaking a small computer language).  It is a business readable, domain specific language that describes software’s behaviour without detailing how that behaviour is implemented.  Gherkin serves two purposes – documentation and automated testing The challenge with writing good automated acceptance tests is for them to be really effective, they need to be readable by not only the computer but also by the stakeholders.   Gherkin gives a lightweight structure for documenting examples of the behaviour required by the stakeholders, in a way that it can be easily understood both by the stakeholders and by Cucumber.  Although Gherkin is called a programming language, its primary design goal is human readability, meaning it can be written in automated tests that read like documentation.

Stay tuned for my next blog; Cucumber verses Steak….