Site icon TestingDocs.com

JBehave( BDD) Testing Questions

Introduction

In this post, we will discuss some common JBehave Behavior Driven Development (BDD) testing interview questions.

What is JBehave?

JBehave is a framework for Behavior Driven Development.  BDD is an evolution of Test-driven development also called an acceptance test-driven development. Working with the JBehave framework is shown in the picture.

What is BDD?

Behavior-driven development (or BDD in short) emerged from the process known as Test-Driven Development (or TDD in short ). It combines the basic principles of TDD with object-oriented analysis and design, to make the process of creating software as optimized and effective. BDD takes into consideration both technical & business interests in software development. BDD makes use of simple domain-specific language( known as DSL ). This language uses plain English and logical statements to express the behavior of the application.

 

 

What is Business Readable DSL?

Business Readable, Domain Specific Language:  with this programmers write application code but they show that code frequently to business people who can understand what it means. These customers can then make changes. Based on those developers make improvements and do debug/testing.

What is Gherkin?

It is a Business Readable, Domain Specific Language that lets you describe software’s behavior without detailing how that behavior is implemented. Gherkin helps with documentation and tests. Gherkin is a line-oriented language that uses indentation to define the structure.

Sample gherkin story file below:

Story Title

Meta Information

Scenario: <Business situation>

As a <role>

I want to <goal>

So that <value>
Given <Precondition>
When <Action by actor>
Then <Testable outcome>

 

Login page gherkin

Sample generic gherkin in BDD Style below.

Login to the system with valid username and password

Meta:
@Login
@Positive

Scenario: <Scenario Title>

Given <Pre-condition>
And <Optional Additional Pre-Condition>
…

When <Action>
And <Optional Additional Action>
…

Then <Post-condition>
And <Optional Additional Post-Condition>
…


Examples:
|username|password|
|admin|admin1234|


JBehave Tutorials on this website can be found at:
https://www.testingdocs.com/jbehave-framework-tutorial/

For more details on the JBehave framework, visit the official JBehave website at:
http://jbehave.org

 
Exit mobile version