SlideShare a Scribd company logo
Presentations
TDD AND BDD
TOPIC:
Subject: SOFTWARE TESTING
Teacher: Le Thi Bich Hoa
Class: D14CQCP01-N
Group 7
Include Three Sections:
I. TDD
II.BDD
III.DIFFERENCES AND CONTRADICTIONS
IV.DEMO
Introduction in TDD:
- TDD is a software development process based on the repetition of a very short development
cycle: instead of the technical requirements, the test cases are very specific, then the software is
modified. Only to pass the new test. This is in contrast to software development that allows
adding features that have not been proven to meet the requirements.
- Kent Beck, who is credited with developing or rediscovering this programming technique,
stated in 2003 that TDD supports simple and highly reliable designs. Test-driven development
relates to eXtreme Programming's pre-test programming concepts, launched in 1999, but more
recently has created more general interest in its own right.
I. TDD
Test first and test last
TDD Rhythm
TDD is described by a basic red-green-refactor cycle, constantly repeatead to
add new features or fix bugs.
The development of every new feature should
start with a failing test.
Improve the structure of the code to ease
future changes and maintenance.
Enough production code should be
written to make the test pass.
TDD RHYMTHM
Crucial design principles
Do not allow writing any program code until it fails a failed
test.
Not allowed to write more than one unit test if only one unit test
was enough to fail.
Let's write code function to pass that test first.
It is not allowed to write more than one program code which is
enough to make a failed test switch to pass.
- Write tests first
- Write enough code to fail the (first) test
- Subsequent code updates and testing
- It’s about testing, not about writing specs
- Acceptance testing to prevent new software bugs
Driving design using TDD
It’s a collaborative process – TDD specialist Gojko Adzic stresses the collaborative
nature of TDD. The number of people that actually need to be involved depends very
much on the nature of the product. For instance, if you are working on a new product or
feature then it would be a good idea to have regular small workshops with the “Three
Amigos”; a developer, a tester and a business analyst. In contrast, when the product is
more mature it might just be a case of pairing two developers to work on it.
Different style of TDD
ATDD
Acceptance
test–driven
development
A development methodology based on
communication between the business
customers, the developers, and the testers.
Encompasses many of the same practices as
specification by example, behavior-driven
development (BDD), example-driven
development (EDD), and support-driven
development also called story test–driven
development (SDD).
II. BDD
WHAT is BDD?
Behavior driven development, or BDD,
is another agile software development process that encourages
collaboration in a software project between developers, QA, project
managers and the business team.
It was invented in 2003 by Dan North as a response to test-driven development (TDD). On the
“Agile specifications, BDD and Testing eXchange” in November 2009 in London, Dan North
gave the following definition of BDD, which I actually really liked:
“BDD is a second-generation, outside–in, pull-based, multiple-stakeholder, multiple-scale,
high-automation, agile methodology. It describes a cycle of interactions with well-defined
outputs, resulting in the delivery of working, tested software that matters.”
- It enables the technical team and the business team to reach their end goals. In fact, it helps when it
comes to defining the desired business outcomes, to communicating what needs to be built by the
developer and to understanding what are the technical challenges they might encounter.
- Basically, with BDD you focus on getting a clear understanding of the software behavior you are
aiming for, by communicating with stakeholders. So developers keep their focus on why a code
should be created instead of putting too much emphasis on technical details.
How do you use them in BDD?
The customer describes what they want and the developers ask questions
to flesh out enough detail about the behaviour to be able to code it.
Together with the tester they can then run through many real world
examples to derive the scenarios which need to be tested before the story
is accepted as “done”.
How do you use them in BDD?
Strong
collaboration.
High visibility
The ubiquitous
language
The software
design follows business
value.
Software development
meets user need
More confidence
from the developer’s
side.
A few
benefits you
get by doing
BDD
Lower costs
Key benefits of BDD
Key benefits of BDD
• With BDD, all the involved parties have a strong understanding of
the project and they can all have a role in the communication and
actually have constructive discussions. BDD increases and
improves collaboration. It enables everyone involved in the project to
easily engage in the product development cycle. And by using plain
language, all are able to write behavior scenarios.
Strong
collaboration
• By using a language understood by all, everyone gets a
strong visibility into the project’s progression.
High visibility
• By improving the quality of the code, you are basically reducing costs
of maintenance and missing the project’s risks.
Lower costs
• Teams using BDD are in general much more confident that they won’t
break code, and have better predictability when it comes to their work
More
confidence
from the
developer’s side
Key benefits of BDD
• In fact, BDD puts a great importance to the Business value & needs.
By setting priorities with the client, based on the value it provides,
developers are able to provide better result because they have a strong
understanding of how the client thinks. By focusing on the value, no
useless features are built.
The software
design follows
business
value
• As mentioned earlier, the ubiquitous language is understandable by all
the members of the team, which reduces misconceptions and
misunderstanding and makes it easier for new members to join the
working process.
The
ubiquitous
language
• By focusing on the business’ needs, you get satisfied users, and that
implies a happy business of course. Actually with BDD, as its name
says it, you focus on the behavior, which has a stronger impact than
the implementation itself.
Software
development
meets user
need
Featues of BDD
• Shifting from thinking in “tests” to thinking in “behavior”
• Collaboration between Business stakeholders, Business Analysts, QA Team and
developers
• Ubiquitous language, it is easy to describe
• Driven by Business Value
• Extends Test Driven Development (TDD) by utilizing natural language that non
technical stakeholders can understand
• BDD frameworks such as Cucumber or JBehave are an enabler, acting a “bridge”
between Business & Technical Language
Assuming you’re building a web application, you’ll probably use a browser
automation library like WatiR/WatiN or Selenium, and script it either using one of the
frameworks I just mentioned, or a given/when/then tool such as Cucumber (for Ruby)
or SpecFlow (for .NET).
The Rules When Writing BDD
BDD:
- It is written as a plain
English Text.
- It is easy to understand by
anybody because we write in
Simple English Format.
- It is a simple plain text
format, BDD can be
shared with Stakeholders.
- Easy to learn and
implement.
BDD Tools Available in the Market:
- Cucumber
- Jbehave
- Nbehave
- Specflow
=> All the above tools are used different platforms and
programming languages like Java, Ruby, CSharp, .Net
etc. But all the above tools have one language is
common which is know by “Gherkins Language”.
Gherkin is the format of BDD tools. It is a plain
English Text which is used to create scenarios. With the
use of that, anybody can easily understand the software
behavior. Gherkins have some specifically defined
structure and few syntax which is used by the
Automation Testers. The syntax is very easy and simple
to use.
Why BDD framework?
Example:
Step 1: Create Maven Project
Create a new Maven project from scratch and add the following dependencies and plugins to the pom.xml file. Choose
‘Enable Auto-Import’ Maven projects prompt at the beginning (to manually enable this, go to File > Settings > search and
select ‘Maven’ > choose ‘Importing’ > enable ‘Import Maven projects automatically’).
Step 2: Add Cucumber for Java IntelliJ IDEA plugin:
Go to File > Settings > Plugins > search ‘Cucumber for Java’> Install
You may need to download dependencies of the plugin as well. If you are accessing the internet through a Proxy server,
make sure you configure your IDE with proxy settings.
Step 3: Project Directory Structure
The directory structure of the sample project looks like the following. Note the structure of test features, step definitions,
and the runner classes.
Step 4: Create testng.xml
Create testng.xml file in the project root and add below lines.
Step 5: Build Maven Project
Run the following command to build your project.
How to apply BDD cucumber
- The choice between TDD and BDD is a
complicated one. It depends on if there is
an appropriate testing framework for your
given target language, what your
coworkers are comfortable with, and
sometimes other factors.
- Some argue that BDD is always better
than TDD because it has the possibility of
eliminating issues that might arise when
using TDD.
- The key to BDD is that it might prevent
issues; it isn’t guaranteed to. Issues like
poor code organization, bad design
practices, etc. will still persist. You’ll just
have a lower likely hood of writing bad
tests and thus have more robust features.
There is no essential difference between
them. What holds them together is that they
all require a group of people, specifying how
the software should behave, collaboratively,
before implementing it. That’s the important
bit, so maybe that’s what we should boil the
BDD definition down to. The idea is to work
from the outside, thinking about how we
want to pave, we use examples to make sure
that everybody on the team understands what
we’ve just agreed on – concrete examples
with concrete data – and we write these
examples in a ubiquitous language – a
language using terms that derive from the
business domain that are understood,
unambiguously, by everybody on the team.
conclusion
III. TDD and BDD: differences and contradictions
• HTTPS://www.testingexcellence.com/bdd-guidelines-best-practices/
• http://compilehorrors.com/test-driven-development-tdd-vs-test-last-development-tld-a-comparative-study/
• https://en.wikipedia.org/wiki/test-driven_development
• http://www.giorgiosironi.com/2010/03/tdd-checklist-red-green-refactor-in.html
• https://apiumhub.com/tech-blog-barcelona/behavior-driven-development/
• http://b4usolution.com/tutorial/
Original Sources:
IV. Demo for TDD and BDD
Please give some advise for our
presentations!

More Related Content

PDF
How to successfully execute fixed price agile projects
PPT
Behavior Driven Development Pros and Cons
PDF
BDD in Action - building software that matters
PPTX
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
PDF
Practiced agile developer with tdd & bdd
PDF
BDD in Action: Building Software Right and Building the Right Software
PDF
Code quality as a built-in process
PDF
Tdd vs bdd vs atdd — developers’ methodologies to navigate complex developmen...
How to successfully execute fixed price agile projects
Behavior Driven Development Pros and Cons
BDD in Action - building software that matters
Wednesday Webinar on "Strengthening your Agility with BDD - A demo using Cucu...
Practiced agile developer with tdd & bdd
BDD in Action: Building Software Right and Building the Right Software
Code quality as a built-in process
Tdd vs bdd vs atdd — developers’ methodologies to navigate complex developmen...

What's hot (20)

KEY
Getting Comfortable with BDD
PDF
Caring about Code Quality
PDF
BDD-Driven Microservices
PPTX
Behavior driven development (bdd)
PPTX
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
PDF
Test driven development and react js application go hand in hand
PDF
BDD in Action - Automated Web Testing with WebDriver and Serenity
PDF
To document or not to document? An exploratory study on developers' motivatio...
PPTX
Behavior Driven Development with AngularJS & Jasmine
PPTX
Code quality
PDF
Understanding, measuring and improving code quality in JavaScript
PDF
Brown aug11 bsdmag
PDF
JDD 2016 - Marcin Zajaczkowski - Cd for open source
KEY
TorontoRb Intro to BDD
PPTX
To document or not to document? An exploratory study on developers' motivatio...
PPTX
Practices of agile developers
PDF
BDD with JBehave
PPTX
DevOps Torino Meetup - DevOps Engineer, a role that does not exist but is muc...
PPTX
Top 10 Qualities of a QA Tester
PDF
1 deborah burton - why the testing community should care about dev ops
Getting Comfortable with BDD
Caring about Code Quality
BDD-Driven Microservices
Behavior driven development (bdd)
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Test driven development and react js application go hand in hand
BDD in Action - Automated Web Testing with WebDriver and Serenity
To document or not to document? An exploratory study on developers' motivatio...
Behavior Driven Development with AngularJS & Jasmine
Code quality
Understanding, measuring and improving code quality in JavaScript
Brown aug11 bsdmag
JDD 2016 - Marcin Zajaczkowski - Cd for open source
TorontoRb Intro to BDD
To document or not to document? An exploratory study on developers' motivatio...
Practices of agile developers
BDD with JBehave
DevOps Torino Meetup - DevOps Engineer, a role that does not exist but is muc...
Top 10 Qualities of a QA Tester
1 deborah burton - why the testing community should care about dev ops
Ad

Similar to Topic tdd-and-bdd b4usolution (20)

PDF
TDD vs. BDD: A Practical Comparison for Modern Development Teams
PPTX
CucumberSeleniumWD
PDF
TDD vs BDD_ Which Development Approach is Best for Your Project.pdf
PPTX
BDD presentation
PPTX
Behavior Driven Development
PDF
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
PDF
Software Development Standard Operating Procedure
PDF
BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...
PPT
Introduction to Behavior Driven Development
PDF
The Essentials Of Test Driven Development
PDF
Software Development Process (SDP).pdf
PDF
Introducing BDD and TDD with Cucumber
PPTX
Making the Move to Behavior Driven Development
PPT
Test Driven Development - Overview and Adoption
PDF
The BDD Process (Behavior-driven development)
DOC
Ravindra Prasad
PDF
Introduction to TDD and BDD
PPT
Agile Methodologies And Extreme Programming
PPT
Quality Software Development
PDF
L5555555555555555555555 Agile Scrum Framework.pdf
TDD vs. BDD: A Practical Comparison for Modern Development Teams
CucumberSeleniumWD
TDD vs BDD_ Which Development Approach is Best for Your Project.pdf
BDD presentation
Behavior Driven Development
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
Software Development Standard Operating Procedure
BA and Beyond 20 - Elke Steegmans and David Vandenbroeck - Behaviour-driven d...
Introduction to Behavior Driven Development
The Essentials Of Test Driven Development
Software Development Process (SDP).pdf
Introducing BDD and TDD with Cucumber
Making the Move to Behavior Driven Development
Test Driven Development - Overview and Adoption
The BDD Process (Behavior-driven development)
Ravindra Prasad
Introduction to TDD and BDD
Agile Methodologies And Extreme Programming
Quality Software Development
L5555555555555555555555 Agile Scrum Framework.pdf
Ad

More from Hoa Le (20)

PDF
Chương 9_Bộ phần mềm EC
PDF
Chương 8_Bảo mật và an ninh mạng
PDF
Chương 7_Thanh toán trực tuyến_Phần 2
PDF
Chương 7_Thanh toán trực tuyến_Phần 1
PDF
Chương 6_Mô hình tiếp thị trực tuyến_Phần 1_ThS Lê Thị Bích Hoà
PDF
Chương 5_Nội dung mô hình kinh doanh C2C và hệ thống đấu giá C2C_ThS Lê Thị B...
PDF
Chương 4_Nội dung mô hình kinh doanh B2C(Business To Customer)_ThS Lê Thị Bíc...
PDF
Chương 3_Nội dung mô hình kinh doanh B2B (Business To Business )_ThS Lê Thị B...
PDF
ChChương 2_Thiết kế website thương mại điện tử_ThS Lê Thị Bích Hoà
PDF
Chương 1_Tổng quan về thương mại điện tử và Website thương mại điện tử_ThS Lê...
PDF
Chương 8 Phân tích CSDL kinh doanh với SQL
PDF
Chương 6 CSDL Marketing
PDF
Chương 5 Chiến lược trong kinh doanh
PDF
Chương 4. Chuẩn hóa cơ sở dữ liệu
PDF
Chương 3 Ngôn ngữ truy vấn có cấu trúc (SQL)
PDF
Chương 2. Các khái niệm trong CSDL
PPTX
B4UConference_Sexy Angular Stack
PPTX
B4UConference_machine learning_deeplearning
PPTX
B4uConference_ethereum
PPTX
B4UConference_Design Big Data System
Chương 9_Bộ phần mềm EC
Chương 8_Bảo mật và an ninh mạng
Chương 7_Thanh toán trực tuyến_Phần 2
Chương 7_Thanh toán trực tuyến_Phần 1
Chương 6_Mô hình tiếp thị trực tuyến_Phần 1_ThS Lê Thị Bích Hoà
Chương 5_Nội dung mô hình kinh doanh C2C và hệ thống đấu giá C2C_ThS Lê Thị B...
Chương 4_Nội dung mô hình kinh doanh B2C(Business To Customer)_ThS Lê Thị Bíc...
Chương 3_Nội dung mô hình kinh doanh B2B (Business To Business )_ThS Lê Thị B...
ChChương 2_Thiết kế website thương mại điện tử_ThS Lê Thị Bích Hoà
Chương 1_Tổng quan về thương mại điện tử và Website thương mại điện tử_ThS Lê...
Chương 8 Phân tích CSDL kinh doanh với SQL
Chương 6 CSDL Marketing
Chương 5 Chiến lược trong kinh doanh
Chương 4. Chuẩn hóa cơ sở dữ liệu
Chương 3 Ngôn ngữ truy vấn có cấu trúc (SQL)
Chương 2. Các khái niệm trong CSDL
B4UConference_Sexy Angular Stack
B4UConference_machine learning_deeplearning
B4uConference_ethereum
B4UConference_Design Big Data System

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Modernizing your data center with Dell and AMD
PPT
Teaching material agriculture food technology
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Spectral efficient network and resource selection model in 5G networks
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Electronic commerce courselecture one. Pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Monthly Chronicles - July 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Advanced methodologies resolving dimensionality complications for autism neur...
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
Modernizing your data center with Dell and AMD
Teaching material agriculture food technology
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Network Security Unit 5.pdf for BCA BBA.
Spectral efficient network and resource selection model in 5G networks
The AUB Centre for AI in Media Proposal.docx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Understanding_Digital_Forensics_Presentation.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Electronic commerce courselecture one. Pdf
Per capita expenditure prediction using model stacking based on satellite ima...
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Monthly Chronicles - July 2025

Topic tdd-and-bdd b4usolution

  • 1. Presentations TDD AND BDD TOPIC: Subject: SOFTWARE TESTING Teacher: Le Thi Bich Hoa Class: D14CQCP01-N Group 7
  • 2. Include Three Sections: I. TDD II.BDD III.DIFFERENCES AND CONTRADICTIONS IV.DEMO
  • 3. Introduction in TDD: - TDD is a software development process based on the repetition of a very short development cycle: instead of the technical requirements, the test cases are very specific, then the software is modified. Only to pass the new test. This is in contrast to software development that allows adding features that have not been proven to meet the requirements. - Kent Beck, who is credited with developing or rediscovering this programming technique, stated in 2003 that TDD supports simple and highly reliable designs. Test-driven development relates to eXtreme Programming's pre-test programming concepts, launched in 1999, but more recently has created more general interest in its own right. I. TDD
  • 4. Test first and test last
  • 5. TDD Rhythm TDD is described by a basic red-green-refactor cycle, constantly repeatead to add new features or fix bugs.
  • 6. The development of every new feature should start with a failing test. Improve the structure of the code to ease future changes and maintenance. Enough production code should be written to make the test pass. TDD RHYMTHM
  • 7. Crucial design principles Do not allow writing any program code until it fails a failed test. Not allowed to write more than one unit test if only one unit test was enough to fail. Let's write code function to pass that test first. It is not allowed to write more than one program code which is enough to make a failed test switch to pass.
  • 8. - Write tests first - Write enough code to fail the (first) test - Subsequent code updates and testing - It’s about testing, not about writing specs - Acceptance testing to prevent new software bugs Driving design using TDD It’s a collaborative process – TDD specialist Gojko Adzic stresses the collaborative nature of TDD. The number of people that actually need to be involved depends very much on the nature of the product. For instance, if you are working on a new product or feature then it would be a good idea to have regular small workshops with the “Three Amigos”; a developer, a tester and a business analyst. In contrast, when the product is more mature it might just be a case of pairing two developers to work on it.
  • 9. Different style of TDD ATDD Acceptance test–driven development A development methodology based on communication between the business customers, the developers, and the testers. Encompasses many of the same practices as specification by example, behavior-driven development (BDD), example-driven development (EDD), and support-driven development also called story test–driven development (SDD).
  • 10. II. BDD WHAT is BDD? Behavior driven development, or BDD, is another agile software development process that encourages collaboration in a software project between developers, QA, project managers and the business team. It was invented in 2003 by Dan North as a response to test-driven development (TDD). On the “Agile specifications, BDD and Testing eXchange” in November 2009 in London, Dan North gave the following definition of BDD, which I actually really liked: “BDD is a second-generation, outside–in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters.” - It enables the technical team and the business team to reach their end goals. In fact, it helps when it comes to defining the desired business outcomes, to communicating what needs to be built by the developer and to understanding what are the technical challenges they might encounter. - Basically, with BDD you focus on getting a clear understanding of the software behavior you are aiming for, by communicating with stakeholders. So developers keep their focus on why a code should be created instead of putting too much emphasis on technical details.
  • 11. How do you use them in BDD?
  • 12. The customer describes what they want and the developers ask questions to flesh out enough detail about the behaviour to be able to code it. Together with the tester they can then run through many real world examples to derive the scenarios which need to be tested before the story is accepted as “done”. How do you use them in BDD?
  • 13. Strong collaboration. High visibility The ubiquitous language The software design follows business value. Software development meets user need More confidence from the developer’s side. A few benefits you get by doing BDD Lower costs Key benefits of BDD
  • 14. Key benefits of BDD • With BDD, all the involved parties have a strong understanding of the project and they can all have a role in the communication and actually have constructive discussions. BDD increases and improves collaboration. It enables everyone involved in the project to easily engage in the product development cycle. And by using plain language, all are able to write behavior scenarios. Strong collaboration • By using a language understood by all, everyone gets a strong visibility into the project’s progression. High visibility • By improving the quality of the code, you are basically reducing costs of maintenance and missing the project’s risks. Lower costs • Teams using BDD are in general much more confident that they won’t break code, and have better predictability when it comes to their work More confidence from the developer’s side
  • 15. Key benefits of BDD • In fact, BDD puts a great importance to the Business value & needs. By setting priorities with the client, based on the value it provides, developers are able to provide better result because they have a strong understanding of how the client thinks. By focusing on the value, no useless features are built. The software design follows business value • As mentioned earlier, the ubiquitous language is understandable by all the members of the team, which reduces misconceptions and misunderstanding and makes it easier for new members to join the working process. The ubiquitous language • By focusing on the business’ needs, you get satisfied users, and that implies a happy business of course. Actually with BDD, as its name says it, you focus on the behavior, which has a stronger impact than the implementation itself. Software development meets user need
  • 16. Featues of BDD • Shifting from thinking in “tests” to thinking in “behavior” • Collaboration between Business stakeholders, Business Analysts, QA Team and developers • Ubiquitous language, it is easy to describe • Driven by Business Value • Extends Test Driven Development (TDD) by utilizing natural language that non technical stakeholders can understand • BDD frameworks such as Cucumber or JBehave are an enabler, acting a “bridge” between Business & Technical Language Assuming you’re building a web application, you’ll probably use a browser automation library like WatiR/WatiN or Selenium, and script it either using one of the frameworks I just mentioned, or a given/when/then tool such as Cucumber (for Ruby) or SpecFlow (for .NET).
  • 17. The Rules When Writing BDD
  • 18. BDD: - It is written as a plain English Text. - It is easy to understand by anybody because we write in Simple English Format. - It is a simple plain text format, BDD can be shared with Stakeholders. - Easy to learn and implement. BDD Tools Available in the Market: - Cucumber - Jbehave - Nbehave - Specflow => All the above tools are used different platforms and programming languages like Java, Ruby, CSharp, .Net etc. But all the above tools have one language is common which is know by “Gherkins Language”. Gherkin is the format of BDD tools. It is a plain English Text which is used to create scenarios. With the use of that, anybody can easily understand the software behavior. Gherkins have some specifically defined structure and few syntax which is used by the Automation Testers. The syntax is very easy and simple to use. Why BDD framework?
  • 20. Step 1: Create Maven Project Create a new Maven project from scratch and add the following dependencies and plugins to the pom.xml file. Choose ‘Enable Auto-Import’ Maven projects prompt at the beginning (to manually enable this, go to File > Settings > search and select ‘Maven’ > choose ‘Importing’ > enable ‘Import Maven projects automatically’). Step 2: Add Cucumber for Java IntelliJ IDEA plugin: Go to File > Settings > Plugins > search ‘Cucumber for Java’> Install You may need to download dependencies of the plugin as well. If you are accessing the internet through a Proxy server, make sure you configure your IDE with proxy settings. Step 3: Project Directory Structure The directory structure of the sample project looks like the following. Note the structure of test features, step definitions, and the runner classes. Step 4: Create testng.xml Create testng.xml file in the project root and add below lines. Step 5: Build Maven Project Run the following command to build your project. How to apply BDD cucumber
  • 21. - The choice between TDD and BDD is a complicated one. It depends on if there is an appropriate testing framework for your given target language, what your coworkers are comfortable with, and sometimes other factors. - Some argue that BDD is always better than TDD because it has the possibility of eliminating issues that might arise when using TDD. - The key to BDD is that it might prevent issues; it isn’t guaranteed to. Issues like poor code organization, bad design practices, etc. will still persist. You’ll just have a lower likely hood of writing bad tests and thus have more robust features. There is no essential difference between them. What holds them together is that they all require a group of people, specifying how the software should behave, collaboratively, before implementing it. That’s the important bit, so maybe that’s what we should boil the BDD definition down to. The idea is to work from the outside, thinking about how we want to pave, we use examples to make sure that everybody on the team understands what we’ve just agreed on – concrete examples with concrete data – and we write these examples in a ubiquitous language – a language using terms that derive from the business domain that are understood, unambiguously, by everybody on the team. conclusion III. TDD and BDD: differences and contradictions
  • 22. • HTTPS://www.testingexcellence.com/bdd-guidelines-best-practices/ • http://compilehorrors.com/test-driven-development-tdd-vs-test-last-development-tld-a-comparative-study/ • https://en.wikipedia.org/wiki/test-driven_development • http://www.giorgiosironi.com/2010/03/tdd-checklist-red-green-refactor-in.html • https://apiumhub.com/tech-blog-barcelona/behavior-driven-development/ • http://b4usolution.com/tutorial/ Original Sources: IV. Demo for TDD and BDD
  • 23. Please give some advise for our presentations!