Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bdd]

BDD stands for "Behavior-Driven Development," a software development style that encourages cooperation between developers and stakeholders through identifying and exploring different examples of how a system or smaller element of code might work from a user's perspective.

1
vote
5answers
80 views

For BDD, should the step to wait be explicit in the feature file or just implemented in the step?

I'm using BDD and I'm writing Gherkin feature files. Is it good practice to add a step in a Scenario to wait for a while? Something like: Waits for 2 seconds after all the operations complete or ...
-2
votes
1answer
114 views

How exactly am I supposed to test business expectations?

I have been looking at BDD but there is something that keeps confusing me. Consider this user story: Given a user has placed their order And the payment was accepted Then a confirmation email should ...
0
votes
1answer
47 views

Gherkin Syntax and Unit Specification

I am wondering about the Gherkin syntax for some scenarios. Suppose I have following events A, B{1}, B{2}, C, D1, D2, G. Where uppercase{number} events like B1, D2 are parallel events(simultaneous). ...
2
votes
2answers
151 views

TDD how to avoid test duplication across team

Our team has decided to develop using BDD/TDD in an effort to become the Agile team we're supposed to be. Vertical slicing appears to be an important part of agile working and gaining the quick ...
0
votes
1answer
65 views

Should BDD/Gherkin be used only for user visible behaviour?

We're a small team of 3 senior and 1 junior developers and I've been tasked with introducing BDD within our development process. To say there's a lot of confusion about BDD is an understatement and ...
16
votes
7answers
4k views

Is it a good idea to write all possible test cases after transforming the team to TDD to achieve a full coverage?

Assume we have a large enterprise-level application without any unit/functional tests. There was no test-driven development process during the development due to very tight deadlines (I know we should ...
-2
votes
1answer
118 views

How can I unit test this code [closed]

How can I unit test a codebase which contains classes that includes two or three methods. In general these methods are too long. The methods contain lots of tasks like filtering datasets and a ...
1
vote
1answer
29 views

BDD Scenario Argument Resolution - file type is a prerequisite input to the scenario

I have to sympathetically resolve a debate internally. Take this scenario, it's not perfect but bear with me. As Arthur I want to upload multiple lists of appointment data during the day ...
1
vote
2answers
58 views

BDD process for SAP development

Perhaps this story should be titled "BDD definitions for agile service stories"... For our .NET-based stories (always vertical slices) we use definitions matching the well known BDD format. ...
3
votes
4answers
414 views

How to do BDD for CRUD?

I want to understand how Behavior-Driven Development (BDD) can be applied to building CRUD applications. I have read a lot on the subject but I just don't get how I'm supposed to apply it. I learn ...
0
votes
1answer
81 views

Client-Side TDD Tests?

More specifically, with regards to ATDD (sort of BDD flavored, or some could argue what was actually intended in the first place by TDD) should be there much UI testing? As I have been testing my UI ...
1
vote
1answer
87 views

Testing Client-Side Code w/o Introducing Brittleness

I'm finding it tough to test my client-side code without testing implementation details. For example, lets say you are testing a login form that displays client-side validation errors and does not ...
1
vote
1answer
86 views

Test RESTful APIs?

When testing RESTful JSON APIs with ATDD/BDD practices in mind is it good practice to test the structure of the response? I'm thinking that it could too easily change, thus making for a brittle test. ...
-3
votes
1answer
72 views

What constitutes AGILITY where Behavior-Driven and Unit Testing are concerned

This morning I had a presentation on PHPSPec which the official website describes as follows: A php toolset to drive emergent design by specification. As defined within an adjective context the ...
2
votes
1answer
216 views

Second step of BDD - write “failing scenario step”, does it mean the test for it?

Knowing that BDD somehow avoids using the term "test", I am trying to understand the process as described in a book called The Journey to Enterprise Agility: Systems Thinking and Organizational Legacy....
-1
votes
1answer
39 views

Testing Application Helper that Depends on Controller

I am working on practicing TDD/BDD/ATDD and I am working on a rails application. I created a helper method that depends conditionally on the type of controller being tested. module ApplicationHelper ...
1
vote
1answer
35 views

Worth it to test client side element presence for web application?

I've really been focusing on making my tests maintainable by focusing on BDD-style tests and only focusing on interfaces. I do not want my tests to be brittle and prevent refactoring. Is it worth it ...
3
votes
1answer
140 views

Should BDD scenario be as minimal as possible, or is doing multiple cases in them okay?

Suppose were testing line segment intersections, and the intersections consider parallel and collinear lines to never intersect. Which one would be more natural to write? One case has more jammed ...
-1
votes
1answer
197 views

Using BDD and DDD approaches, which seem to complement and contradict each other

I am trying to apply BDD and DDD together to a new project The problem I am having at the moment can be summed up by the following quote (taken from here: https://www.infoq.com/news/2015/02/bdd-ddd): ...
1
vote
3answers
153 views

Should an imperative style be used if the parameters drive the outcome?

I have done a lot of BDD reading since the beginning of the weekend. At the moment I am reading about the imperative style v the declarative style. The imperative style is often described as an anti ...
1
vote
1answer
194 views

Have I understood the term Honeycomb correctly?

Following on from my previous question and the comments under the accepted answer: One Acceptance Test project per layer or one Acceptance Test project per Bounded Context I have done a lot of ...
-1
votes
1answer
254 views

One Acceptance Test project per layer or one Acceptance Test project per Bounded Context

This link (http://www.taimila.com/blog/ddd-and-testing-strategy/) says: "Feature tests should depend only on the application layer" i.e. presentation layer. I am trying to understand how BDD fits in ...
0
votes
1answer
59 views

Does changing a Specflow scenario after it is written violate the open close principle?

I am trying to learn Specflow. I have bought a book and it arrives at the weekend. Most of the scenarios I see online are for simple things like calculators. For example, please see the scenario ...
0
votes
2answers
123 views

Testing a class that only has one field only that is an ID number

I am trying to incorporate BDD into the teams working practices to make interactions with Business Analysts more effective. I recently asked this question: Should I pass an ID number from the feature ...
0
votes
3answers
308 views

Should I pass an ID number from the feature file?

Say I have a domain object like this: public class Customer { private Guid _id; private string _name; private Address _address; public Customer (Guid id, string name, Address address)...
6
votes
4answers
2k views

What levels to test on with BDD/Cucumber?

I'm currently getting into BDD/Cucumber and I ask myself: On which levels is it good to use? There are the test levels (from the testing pyramid): User Interface Integration Unit You can apply ...
1
vote
1answer
1k views

Testing a private method in Java [duplicate]

I am new writing good test cases, so please bear with me. Writing a test case for private methods public Stock getStock(String stockTicker) { Stock company = new Stock(); ...
2
votes
1answer
53 views

Where should I do integration tests in a multi package project

Background: I am working on a node project which consists of a core package and several addon packages. For the end product to work, the core package and atleast one of the addon packages should be ...
0
votes
1answer
622 views

What is the difference between Traditional Software Development and Behavior Driven Development?

What is the difference between so called Traditional Software Development (TSD) and Behavior Driven Development (BDD)? I've seen a lot of different development methods that teach developers to talk ...
9
votes
3answers
481 views

How does Behavior Driven Development improves clarity when natural languages are ambiguous?

I'm currently exploring BDD test frameworks like cucumber and I find it curious when people say since the feature files are in simple natural language it improves clarity and gives a clear ...
4
votes
1answer
202 views

Boundaries of unit testing between my code and a library or sub-component

Background: I am new to testing in general, and have been studying it in context of JavaScript, specifically React.js, front-end development (actually new to this as well). For the question, I have ...
7
votes
1answer
2k views

Does BDD and DDD work well together?

Behavior-Driven Development (BDD) can be described as in this blog post as follows: Behaviour-driven development (BDD) takes the position that you can turn an idea for a requirement into ...
6
votes
2answers
277 views

Does BDD/TDD imply an automatable client?

I agree with all the fundamental ideas of BDD and try to use it as much as I can. However, one thing that strikes me is that the outside in development and tests that express a scenario need to have ...
0
votes
2answers
709 views

Functional programming, Domain Driven Design, and Test/Behavior Driven Development

I am posting because, first of all, I want to make sure my understanding on these 3 methodologies is correct. Secondly, I would like some clarification on how they could all fit in together. I see ...
5
votes
1answer
207 views

BDD - how to measure value / ROI of collaboration

When considering the value or ROI that we reap from our efforts in implementing and using BDD it is realitively straight forward to measure your savings for the test automation element. You can ...
5
votes
1answer
115 views

Acceptance test execution strategies for heavy first-time-setup apps

We have a system with about 250 tables. The first-time-setup include running about 50 queries (known also as seeds). We're trying out strategies to automatize our acceptance tests, and our first ...
2
votes
3answers
3k views

What advantages are there to using a BDD test tool like SpecFlow over simple unit test tools like MSTest?

I'm looking at BDD test tools, like SpecFlow, MSpec or NSpec, and I can't see from the examples what advantages they offer over simple unit test tools like MSTest. As far as I can see, when creating ...
-1
votes
4answers
604 views

Should a test scenario prepare all of its required data? [closed]

Consider a BDD scenario with some given steps that refer to existence of a set of data in database. For example consider the following scenario steps: Given there is an active customer When as and ...
2
votes
1answer
705 views

Side-by-side Functional and Acceptance Testing (SpecFlow)

Edit: I have found a closely related question: StackOverflow This question is not about the differences between functional and acceptance tests! Almost all the info I could find on the web just ...
12
votes
3answers
6k views

Differences between Given When Then (GWT) and Arrange Act Assert (AAA)?

In TDD there is Arrange Act Assert (AAA) syntax: [Test] public void Test_ReturnItemForRefund_ReturnsStockOfBlackSweatersAsTwo_WhenOneInStockAndOneIsReturned() { //Arrange ShopStock shopStock =...
11
votes
1answer
347 views

Migrate legacy requirements to BDD

Q: What is the best way to move a large company to Cucumber with at least 15 years of legacy software requirements maintained in a requirements database? Currently considering: 1) Migrate Everything ...
-2
votes
3answers
583 views

TDD/BDD: Mocks with expectations: bad? [closed]

Is using mocks in the following way a bad idea: writing tests where mocks expect certain calls from the subject under test Or even just writing mocks that return values to the subject under test if/...
2
votes
1answer
340 views

TDD/BDD - Properly defining tests, adjusting tests, putting describe blocks inside it blocks

I am coming around with TDD/BDD. I am a bit confused though, when it comes to initially writing my BDD tests and then adding more tests after the very broad tests. For Example, lets say that I am ...
3
votes
2answers
255 views

How to track technical tasks with BDD?

I am working on a team that is adopting BDD for the first time. We are doing greenfield work building a market data system that allows users to request market data from different sources. We are ...
2
votes
1answer
129 views

TDD Duplicate Testing on Related Classes

In following the principle of testing only the exported functions on a package (using Go - or for others languages, the public functions on a class), I'm running into a scenario where related packages ...
2
votes
2answers
125 views

Which style to use for features that are not directly driven by humans when using BDD Gherkin language?

Should they be written same way as human workflows, first person "I have entered..." style language etc.? Is the user effectively a gender-less "AI"?
1
vote
1answer
616 views

Behat/Mink: best practice for testing strings in a web application's GUI

I'm writing acceptance tests for a web application using Behat/Mink. I want to know best practice for testing strings in the GUI. For example: say I want to test that a link exists on the homepage ...
4
votes
2answers
4k views

BDD, Cucumber best practices

I'm trying to understand some best practices when it comes to BDD and Cucumber. I've only recently started to use it, and the first feature I have written a test for is testing a search feature, more ...
3
votes
1answer
3k views

Javascript unit testing - mocks or fixtures?

Interested in some opnion... I'm introducing unit testing of JS into a team, it'll largely be testing modules with many dom interactions and updates. Traditionally I've always used mocks and spys ...
6
votes
2answers
2k views

Gherkin: What is a reasonable number of scenarios per feature?

I'm keen to get thoughts on a reasonable number of scenarios per feature in Gherkin. At what point do you start to thing about re-organising the feature to keep the number of scenarios at a ...