Wednesday, December 17, 2014

Cucumber Testing Framework

Cucumber is BDD (behaviour driven development) framework. In contrast to other BDD frameworks (like RSpec) the specification is written in a natural human readable language.

Rubocop-yast

I wanted to write tests for the new Rubocop-yast plugin in some nice way. I started with RSpec, but the tests looked ugly (writing multiline indented Ruby code in a string literal requires extra escaping which makes it quite hard to read...).

Then I looked at the original Zombie Killer tests. They are written in Markdown so they are better readable, you can write some additional comments to the test etc... And how to run the Markdown tests? There is a custom Markdown renderer which converts the Markdown specification into a RSpec test.

Looks nice, but having a custom renderer makes it difficult, we have to maintain it and the Markdown format in specific, there is nothing else similar to it...

Then Cucumber come to my mind! It exactly fits our need! The specification allows to write extra comments and notes, it's readable almost like our Markdown and is a standard tool. The killer feature is multiline docstring parameter. It allows to write indented Ruby code directly without any extra escaping.

You can check how the tests looks here, check the *.feature files. Here is the code which converts the specification into the testing code.

Pros & Cons

Here is the summary of pros & cons I found when starting with Cucumber:

Advantages
  • Specification in natural language, readable tests and user stories
  • Allows to use other testing framework for running the real tests (like RSpec)
Disadvantages
  • Extra code for converting the textual specification to Ruby code
  • One more layer between test description and the code (you need to make sure the code really matches the description)
  • Test descriptions should describe the high level features (usually the user interaction), they should not describe the low-level implementation details
Ideally the features should be written by managers, designers or other non-technical people. They can describe the required features without any programming skills. That's probably the most important Cucumber feature.

Suitable for Yast?

In my opinion not. Why? We are usually focused on low-level features and we would probably need too much code for converting the specifications to tests. And the tests are usually too different, we would need to write extra conversion for each test and maintain it. The overall benefit would be small in my opinion and would not be worth of doing it.

Moreover the feature descriptions we usually get are hard to convert to a testing code, they are usually too generic or cannot be tested in unit tests (e.g. the installer features).

Links


29 comments:

Leslie Lim said...



I simply want to say I am new to weblog and truly savored you’re website. More than likely I’m want to bookmark your blog . You actually have excellent writings. Thanks a bunch for sharing your web site.

Jorcel
www.imarksweb.org

Sherlin Jones said...

The biggest change in Selenium recently has been the inclusion of the WebDriver API. Driving a browser natively as a user would either locally or on a remote machine using the Selenium Server it marks a leap forward in terms of browser automation.

Selenium WebDriver fits in the same role as RC did, and has incorporated the original 1.x bindings. It refers to both the language bindings and the implementations of the individual browser controlling code. This is commonly referred to as just "WebDriver" or sometimes as Selenium 2.
Selenium Training Institute in Chennai

Jones Sathya said...

A nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.


Selenium Training in Velachery
Selenium Training Center in Chennai

Nancy 12 said...

Thank you for sharing such a nice and interesting blog with us. Hope it might be much useful for us. keep on updating...!! Selenium Training in Chennai

raj kumar said...

Incredible Article… I want to peruse your articles on the grounds that you're composing style is too great, its is extremely useful for every one of us and I never get exhausted while perusing your article in light of the fact that

Selenium Training in Bangalore

rose said...

I accept there are numerous more pleasurable open doors ahead for people that took a gander at your site.

selenium training in bangalore|

Inigo joseph said...

Thanks a lot very much for the high your blog post quality and results-oriented help. I won’t think twice to endorse to anybody who wants and needs support about this area. Besant technologies Marathahalli

ari kesavan said...

I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.
hadoop training in bangalore
hadoop training in chennai

Anonymous said...

I accept there are numerous more pleasurable open doors ahead for people that took a gander at your site.
QTP Tutorial

rohit pal said...

Webtrackker is one only IT company who will provide you best class training with real time working on marketing from last 4 to 8 Years Experience Employee. We make you like a strong technically sound employee with our best class training.


WEBTRACKKER TECHNOLOGY (P) LTD.
C - 67, sector- 63, Noida, India.
F -1 Sector 3 (Near Sector 16 metro station) Noida, India.
+91 - 8802820025
0120-433-0760



Best SAS Training Institute in delhi

SAS Training in Delhi

SAS Training center in Delhi

Best Sap Training Institute in delhi

Best Sap Training center in delhi


Sap Training in delhi

Best Software Testing Training Institute in delhi

Software Testing Training in delhi

Software Testing Training center in delhi


Best Salesforce Training Institute in delhi


Salesforce Training in delhi

Salesforce Training center in delhi

Best Python Training Institute in delhi

Python Training in delhi

Best Python Training center in delhi

Best Android Training Institute In delhi

Android Training In delhi

best Android Training center In delhi

akhila priya said...

This concept is a good way to enhance the knowledge.thanks for sharing. please keep it up selenium Online Training Hyderabad

devi priya said...

Excellent!! You provided very useful information in this article. I have read many articles in various sites but this article is giving in depth explanation about Ruby Cucumber Training . Recently, I also took training on this “Ruby Cucumber Training Hyderabad '' from Excelr.
Ruby Cucumber Training Hyderabad

KRN Informatix said...

Really very useful blog who learn selenium & Cucumber, Selenium Training in Bangalore | Software Testing Training in Bangalore

priya said...


Best institute for 3d Animation and Multimedia Course training Classes

Best institute for 3d Animation and Multimedia

Best institute for 3d Animation Course training Classes in Noida- webtrackker Is providing the 3d Animation and Multimedia training in noida with 100% placement supports. for more call - 8802820025.

3D Animation Training in Noida

Company Address:

Webtrackker Technology

C- 67, Sector- 63, Noida

Phone: 01204330760, 8802820025

Email: info@webtrackker.com

Website: http://webtrackker.com/Best-institute-3dAnimation-Multimedia-Course-training-Classes-in-Noida.php


Our courses:
3D Animation and Multimedia Training in Noida.
3d Multimedia Institute in Noida.
Animation and Multimedia Training in Noida.
Animation and Multimedia Training institute in Noida .
Multimedia Training institute in Noida.
Multimedia Training classes in Noida.
3D Animation Training in Noida.
3D Animation Training institute in Noida.

sasha asha said...

it was an awesome article. i can learn more from this. thank you for this valuable informations.
best selenium training in chennai

john jersy said...

My rather long internet lookup has at the end of the day been compensated with pleasant insight to talk about with my family and friends.
Click here:www.besanttechnologies.in/selenium-training-in-bangalore.html

jagatsingh said...

Webtrackker Technology is IT Company and also providing the Solidwork
training in Noida at running project by the real time working trainers.
If you are looking for the Best Solidwork training institute in Noida
then you can contact to webtrackker technology.
Webtrackker Technology
C- 67, Sector- 63 (Noida)
Phone: 0120-4330760, 8802820025
8802820025
Solidwork training institute in Noida

Unknown said...

mytectra placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance.

SUN TRAININGS said...


Really it was an awesome article… very interesting to read…
Thanks for sharing.........

Tableau online training in Hyderabad

Tableau training in Hyderabad

Best Tableau online training in Hyderabad

Unknown said...

myTectra Placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance

Genga Savitha said...

You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us
angularjs Training in marathahalli

angularjs interview questions and answers

angularjs Training in bangalore

angularjs Training in bangalore

angularjs Training in chennai

automation anywhere online Training

simbu said...

Thank you for benefiting from time to focus on this kind of, I feel firmly about it and also really like comprehending far more with this particular subject matter. In case doable, when you get know-how, is it possible to thoughts modernizing your site together with far more details? It’s extremely useful to me
Java training in Bangalore | Java training in Btm layout

Java training in Bangalore |Java training in Rajaji nagar

Java training in Bangalore | Java training in Kalyan nagar

sakthi said...

Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information.

rpa training in chennai
rpa training in bangalore
rpa course in bangalore
best rpa training in bangalore
rpa online training

shri yadav said...

Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information. 
python course institute in bangalore
python Course in bangalore
python training institute in bangalore

sudhagar raja said...

I am really happy with your blog because your article is very unique and powerful for new reader.
Click here:
selenium training in chennai | selenium course in chennai
selenium training in bangalore | selenium course in bangalore
selenium training in Pune | selenium course in pune | selenium class in pune
selenium training in Pune | selenium course in pune | selenium class in pune
selenium online training | selenium training online | online training on selenium

johnsy sai said...

Really very nice blog information for this one and more technical skills are improve,i like that kind of post.
Devops Training courses
Devops Training in Bangalore
Best Devops Training in pune
Devops interview questions and answers

geetha sridhar said...

It seems you are so busy in last month. The detail you shared about your work and it is really impressive that's why i am waiting for your post because i get the new ideas over here and you really write so well.
Data Science Course in Indira nagar
Data Science Course in btm layout
Python course in Kalyan nagar
Data Science course in Indira nagar
Data Science Course in Marathahalli
Data Science Course in BTM Layout

softlogic systems said...

Thanks for sharing your informative article. As every business owner desire to be the part of digital marketing, there is massive demand for attractive and responsive website. block chain training in chennai | Selenium training in chennai

Ananya Krishnan said...


Thank you for taking the time to write about this much needed subject. I felt that your remarks on this technology is helpful and were especially timely.

Right now, DevOps is currently a popular model currently organizations all over the world moving towards to it. Your post gave a clear idea about knowing the DevOps model and its importance.

devops course fees in chennai | devops training in chennai with placement | devops training in chennai omr | best devops training in chennai quora | devops foundation certification chennai