Professional Documents
Culture Documents
What Is BDD
What Is BDD
What Is BDD
oo
what is TDD
I N E ! N I ! ! G O G!
KENT BECK 2003
In TDD, test cases are written before the code itself; at that point, they are unpassable (red). Code is written specically to pass a given test case. When the written code successfully passes the test (green), the passing code is refactored into a more elegant module without introducing any new functional elements. Known as redgreen-refractor, this whole process is the mantra of TDD
Advantages Of TDD?
In TDD, code is never written without rst writing a test Clean interface because programmers write the test rst, the APIs they produce are naturally written from Adding New Functionality in TDD gives programmers the condence to change the larger architecture of an application
Disadvantages Of TDD?
programmers like to Code not to test
I N E N I G O G
its never seems to be built Testing/QA point of view Using TDD 100% quality not guaranteed We don't know that test/code was built against stakeholder view point or not.
What is BDD
oo
Behaviour-Driven Development (BDD) builds upon Test-Driven Development (TDD) by formalising the good habits of the best TDD practitioners. The best TDD practitioners work from the outside-in, starting with a failing customer acceptance test that describes the behaviour of the system.With its roots in test-driven development, domain-driven design, and automated acceptance testing, BDD focuses on the ways an application is expected to work - its behaviour to get feedback from the business stakeholders about whether were setting out to build the right thing before we get started
I N E N I G O G
Feature :
Scenario: Scenarios are concrete examples Steps :A step is generally a single line of text
I N E N I G O G
! !
of how we want the software to behave. Scenarios allow us to answer these questions by describing exactly what should happen under what circumstances. that starts with one of the step keywords: Given, When, Then, And, and But. Given indicates something that we accept to be true in a scenario When indicates the event in a scenario
dene a single scenario outline and then provide tables of input data and expected output. Heres the scenario outline for our submit