tdd


Should TDD and BDD be used in conjunction?


I am coming from a TDD mindset into BDD. I understand that using BDD is to focus on ensuring the behaviours and business goals of software are being met.
What confuses me is that if I start using BDD in place of TDD, it seems I'm not able to test at such a low-level. For example, when writing a test with a TDD mindset, I might test that properties have been attached to the scope:
it('should attach properties to scope', function () {
expect(MainCtrl.items.length).toEqual(1);
});
In doing this, another developer knows the assignment to scope was expected and required for future use, saving them some debugging should they have removed the assignments or changed defaults etc.
This example doesn't define a behavior so can't be considered BDD. Of course, I could rewrite the test description to make it more behavior orientated, such as, "when the page loads, setup properties for later use so the user can do so and so..." but this seems too abstract.
Is it a done-thing to use both TDD and BDD at the same time? Have BDD available to define the behaviors for all parties involved in the project (including non-technical) and TDD specifically for developers?
Short answer, yes.
However, the distinction between BDD and TDD is not as you've mentioned and I'd like to clear up what "ensuring the behaviours and business goals of software are being met" really means :)
BDD precedes, envelopes and goes beyond the development stage. BDD is far more than a syntax and not just a change from the word "test" to the word "should". BDD is actually a paradigm to writing software that involves the end-to-end business. This page explains that:
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.
BDD starts with deliberate discovery, where a group of people get together and flesh out the details of a story using scenarios. The group of people is typically made up of 1+ of each of the following disciplines: product, development and QA - also referred to as the three amigos. This exercise precedes development and is very good at identifying defects before you even start development and it creates better specifications through a shared understanding.
Once you have a good story with good scenarios, you can drive development using an outside-in testing approach:
This means you start with the acceptance test (avoid the UI if you can), and as you drive development into the system, you employ TDD at the integration and unit levels for things like your services and domain objects. Here you can choose any syntax you like, and what you have used above with "should" is fine.
If you're using Javascript, we created an open source tool called Chimp to make the process of outside-in testing easy.
Finally, I recommend you look at the following links:
Specification by Example
Shallow Depth of Test

Related Links

RhinoMock : Mocks Vs StrictMocks Vs DynamicMocks
Ideas on how to TDD application that needs to retrieve user name from system environment
ATDD versus BDD and the proper use of a framework
Bizmonade - testing orchestration that receives ANY document
Selenium vs Celerity? [closed]
TDD and Code Coverage
Testing state in S#arp Architecture - Best practice
TDD System Under Test Creation Patterns (AutoFixture)
What is test-driven development? [duplicate]
Unit tests in TDD
Is Agile different from TDD ? If so what are the main differences?
What are the types of bugs test-driven development is most effective at catching?
TDD with Strategy Pattern
Is there a good place to discuss Test Driven Development?
TDD and UML together
TDD Example for Business Apps

Categories

HOME
debugging
netbeans
zeromq
mockito
tinymce
smarty
lodash
cvs
dxl
ckeditor
acquia
kibana-4
windows-10-universal
vault
midi
etl
google-cloud-ml
static-libraries
highlight.js
saxon
jsdoc
propel
reactcsstransitiongroup
http-status-code-504
django-cms
viewport
swingx
plunker
orleans
css-animations
wkwebview
realex-payments-api
mmap
lcd
h2db
dynamic-featured-image
selectedindexchanged
bootstrap-material-design
phpfox
filezilla
facebook-apps
atlassian-crucible
vision
frame
semantic-versioning
code-contracts
host
suricata
file-format
disassembling
espeak
dism
grid.mvc
android-mediaprojection
skeleton-css-boilerplate
logparser
dotnetzip
powercli
veracode
qtwebview
pdfclown
iso8601
django-scheduler
migradoc
jquery-filter
android-fonts
nxt
grails-tomcat-plugin
fuzzy-search
prettytensor
hexdump
captivenetwork
goose
xpath-1.0
photobucket
libressl
pundit
computer-algebra-systems
arcanist
rake-task
tween
camanjs
angularjs-ng-click
asp.net-dynamic-data
file-copying
id3v2
xcode-6.2
flask-cors
p4java
fluentautomation
rebol3
mcts
rabl
free-variable
dsn
viewswitcher
hosts-file
windows-phone-7.1.1
nsmanagedobject
mercurial-server
libc++
django-tagging
netbeans-7.1
actionview
lpeg
w3wp.exe
digest-authentication
web-application-design
mozilla-prism
xsdobjectgen
nhibernate.search
nintendo-ds
iweb

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App