Questions tagged [bdd]

BDD stands for Behavior Driven Development. It is related to, and derived from, TDD (Test Driven Development) and ATDD (Acceptance Test Driven Development). It differs from them in its language, preferring "example", "scenario" or "specification" to "test".

BDD stands for Behavior Driven Development.

It is related to, and derived from, TDD (Test Driven Development) and ATDD (Acceptance Test Driven Development). It differs from them in its language, preferring "example", "scenario" or "specification" to "test".

Unlike TDD, BDD is not focused on functionality but on behavior.

It improves communication between team members and it bridges the gap between non-technical and technical people working on the same project by using a common language. Whereas TDD focuses on "how" to implement the functionality, BDD explains "what" functionality to implement.

BDD is an Agile software development process...

...that encourages collaboration between developers, QA and business participants in a software project.

BDD is also known as...

... (Specification by Example) or (Acceptance Test Driven Development). It is derived from (Test Driven Development). It differs from them in its language, preferring example, scenario or specification to test. The language is intended to encourage questioning and conversation around the scenario or example, as BDD works from an assumption that we don't know enough to write an accurate test in the first place.

Scenario-based BDD tools use a Given / When / Then format to capture and automate the conversations. TDD and mocking tools are commonly used at a class level.

Tag questions about binary decision diagrams with . Tag questions about Microsoft's Business Desktop Deployment, now Microsoft Deployment Toolkit, with .

3390 questions
25
votes
4 answers

What javascript mocking frameworks are people using?

I'm using Jasmine for testing client & server side javascript and need to do some mocking. Has anyone got any suggestions for a good javascript mocking framework?
James Hollingworth
  • 14,040
  • 12
  • 39
  • 57
25
votes
3 answers

Is there a workable approach to use test-driven development (TDD) in a COBOL application?

Has anyone come across any workable approaches to implementing test-driven development (and potentially behavior-driven development) in/for COBOL applications? An ideal solution would enable both unit and integration testing of both transactional…
Paul Russell
  • 4,727
  • 1
  • 30
  • 28
25
votes
3 answers

Is BDD really applicable at the UI layer?

BDD is an "outside-in" methodology, which as I understand it, means you start with what you know. You write your stories and scenarios, and then implement the outermost domain objects, moving "inwards" and "deliberately" discovering collaborators…
Ryan Nelson
  • 4,466
  • 5
  • 29
  • 45
24
votes
3 answers

How to Load a File for Testing with Jasmine Node?

I have a simple JavaScript file, color.js, and a matching spec file, colorSpec.js. color.js: function Color() { } colorSpec.js: require('./color.js'); describe("color", function() { it("should work", function() { new Color(255, 255, 255); …
LandonSchropp
  • 10,084
  • 22
  • 86
  • 149
24
votes
1 answer

Rspec & large spec files organisation

I was just wondering how others organise large spec files (especially for models) with many contexts and sections organised in describe blocks for validations and other specs that can be grouped in some meaningful way. Do you guys keep all the specs…
Vito Botta
  • 395
  • 3
  • 10
24
votes
5 answers

How do I write context/specification style unit tests with an MSTest/xUnit framework?

I have been using MSpec to write my unit tests and really prefer the BDD style, I think it's a lot more readable. I'm now using Silverlight which MSpec doesn't support so I'm having to use MSTest but would still like to maintain a BDD style so am…
Charlie
  • 10,227
  • 10
  • 51
  • 92
24
votes
4 answers

Should BDD scenarios include actual test data, or just describe it?

We've come to a point where we've realised that there are two options for specifying test data when defining a typical CRUD scenario: Option 1: Describe the data to use, and let the implementation define the data Scenario: Create a region Given…
James Morcom
  • 1,749
  • 14
  • 17
23
votes
5 answers

Pretty output of Gherkin feature files

We're building up a specification in Gherkin, and we'd like to present the feature files to the business stakeholders. How can we export all our feature files in some sort of 'pretty' format? For example: Generate a document containing all…
dgmstuart
  • 728
  • 2
  • 7
  • 17
23
votes
5 answers

problem with rspec test, undefined method 'post'

I am writing a spec to test the behavior of the mashup_controller when someone sends a query through a URL. I need to simulate the parameters contained in the URL, and i read that the post() method will do that, however when i get an error: 1)…
user727403
  • 1,967
  • 3
  • 13
  • 14
23
votes
8 answers

Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: java.base doesn't "opens java.util" to unnamed module

I have created a Cucumber feature file and steps file, then I have clicked "Run configurations" for feature file and I see the following in the console. How can I solve this problem? *Feature: Login into account Existing user should be able to…
23
votes
8 answers

SpecFlow and complex objects

I'm evaluating SpecFlow and I'm a bit stuck. All samples I have found are basically with simple objects. Project I'm working on heavily relies on a complex object. A close sample could be this object: public class MyObject { public int Id { get;…
Ramunas
  • 3,853
  • 1
  • 30
  • 31
23
votes
5 answers

Writing a spec for helper with Ruby on Rails and RSpec

I have been writing specs for controllers and models, but I have never written a helper spec. I have no idea where I start. I have the following snippet in application_helper.rb def title(page_title) content_for(:title) { page_title } …
TK.
  • 27,073
  • 20
  • 64
  • 72
23
votes
5 answers

Is there an rspec test for exact length of an attribute?

I'm trying to test the length of a zip code attribute to ensure its 5 characters long. Right now I'm testing to make sure its not blank and then too short with 4 characters and too long with 6 characters. Is there a way to test it being exactly 5…
gr0k
  • 789
  • 2
  • 9
  • 22
23
votes
3 answers

How/what to mock in BDD

I know one of Dan North's intentions in devising BDD was to move the vocabulary away from the complexity of the test domain. However, in implementing an outside-in approach, it seems we still require some understanding of mocked behavior (or…
Ryan Nelson
  • 4,466
  • 5
  • 29
  • 45
22
votes
3 answers

How to write stories / scenarios in BDD ( Behavior Driven Design )

I am about to use BDD (Behavior Driven Design) for the first time and am trying to get used to this different way of approaching a problem. Can you give some stories / scenarios that you would write for say a simple login application using BDD?…
Lill Lansey