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]

In software engineering, behavior-driven development (abbreviated BDD) is a software development process based on test-driven development (TDD).

2
votes
0answers
11 views

Formatting CSV as a table using BDD

This is the problem: Write a function to create a table from CSV data. The input to the function is a list of strings. Each string is formatted as a CSV record. Here’s an example for a ...
1
vote
2answers
59 views

Two BDD unit tests for an account repository with identical code

I am testing my repository class: interface AccountRepository{ void save(Account account); Optional<Account> findById(Long id); } And when writing ...
1
vote
0answers
80 views

Hello, World BDD in Golang

I've tried to do some BDD in Golang using Godog. File Hello.feature: ...
1
vote
2answers
103 views

Using Specs when testing the process of assigning offers to a customer

I am trying to spruce up my BDD skills using Specflow and Gherkin. Please see the classes below: ...
5
votes
1answer
190 views

Testing the process of assigning offers to a customer

I asked a similar question yesterday, which was criticised because I posted the test without the supporting code. Therefore I deleted the question yesterday as it was not clear enough. I am now ...
3
votes
0answers
95 views

linspace c++ and unit tests in catch BDD

I have implemented matlab's linspace function ...
6
votes
1answer
153 views

Generate pieces of an SQL query [closed]

Background I already changed my mind towards the SOLID principles, and am applying them in everything that I create. Now I am reading a lot of articles about TDD and BDD, aiming to begin applying ...
3
votes
0answers
247 views

Javascript FizzBuzz and Behavior-Driven Development Using Mocha and Chai

I am currently getting closely acquainted with Behavior-Driven Development. Could someone tell me how I am doing with the Fizzbuzz program below? I am interested in both improving the Javascipt code ...
1
vote
0answers
110 views

BDD on Android with Kotlin

I am considering an approach fo BDD tests on Android. The sample app — a simple messenger — has been made in Kotlin, so will be the tests. I ended up with something like this : ...
4
votes
1answer
70 views

PHP Vehicle / Event test

I was given a test to write a class that calculates a vehicle's average and expected mileage without using a database or framework. The mileages were to be calculated given some different types of ...
2
votes
0answers
303 views

PHPSpec, testing code that uses fluent mock

I've just completed writing a spec for a Doctrine2 repository. The repo contains only one method so far, the spec for which takes in an OAuth Identity token object (that contains an ID that matches up ...
4
votes
0answers
188 views

In-memory file system context for the behat PHP BDD testing framework

I wanted to come up with a 'utility' context to enable testing of the file system with behat. Specifically this is aimed at helping with the behavioral testing of php command line applications that ...
3
votes
1answer
422 views

BDD in PHP, Testing search in Wikipedia with Behat and Mink (Selenium2 Driver)

I am trying to learn BDD in PHP with Behat and Mink and I am using Selenium2 driver for the same. The scenario is given on this page and is as follows: ...
1
vote
0answers
325 views

Unit testing - Parsing data from the Weather Underground API

I'm writing unit tests for the first time. The tests are for my library on Github. I downloaded the JSON and stored it into a local file that looks like this: ...
1
vote
0answers
168 views

Mocha + should.js, testing for node

I'm new to the world of BDD, but I'd like to get a grip of it as soon as possible. It's one of my first tests: Fluent.js ...
8
votes
2answers
3k views

Using I18n in capybara feature specs

Here I am trying to avoid hardcoding in flash messages by using I18n. Also, I have tried to use a CSS selector for submitting the form to make the tests less brittle (I don't really care that much ...
5
votes
2answers
258 views

First time BDD: Testing the same things in both acceptance and unit tests

I just tried BDD for the first time and implemented a simple Semantic Versioning Bumper in Python. The class takes a version string in the format of major.minor.patch (i.e. 3.2.2, where major=3, ...
7
votes
2answers
482 views

Am I implementing BDD correctly?

I'm writing a utility that validates fields. I decided to try my hand at Behaviour Driven Development (BDD). The validator utilises "rules" to determine if field is valid. Three different types of ...
2
votes
1answer
186 views

Test for a Rails app

Here's a test from a Rails app I'm working on. I want to know if I'm using describe, let, ...
4
votes
3answers
212 views

First BDD/RSpec tests, would like some review regarding idioms, conventions and style

This is my first attempt at BDD and RSpec. I'm more of a C# xUnit kind of guy. I wrote this class while developing a 2D random tile map generator (just for fun). The project is still ongoing. I ...
3
votes
1answer
782 views

BDD tests in PHPUnit

No one in my team knows how to write BDD tests, so I started writing some and it's quite working well. I think the time has come to improve the code quality. This contains a lot of duplicated code ...