Sei sulla pagina 1di 1

WATERFALL AGILE

TDD vs BDD
Testing the spark plug
vs
Testing for a spark
CHEATSHEET CHEATSHEET
Trying to start a motorbike
is a test of a component in isolation. Its an example of a is a test of a collection of components. Its an example of a is a System Test/Blackbox Test. Its also a

Unit Test Functional Test Behavioural Test

Unit Tests are the building blocks of Behavioural Tests are the building blocks of

TEST DRIVEN DEVELOPMENT BEHAVIOUR DRIVEN DEVELOPMENT


TDD is an inside-out process. BDD is an outside-in process.
The focus is on quality.
Focus Who writes the tests? The plain English format
The focus is on value.
means that the tests can be written by the
Who writes the tests? The tests are written at the person that understands the customer best: the
same time as the code. So it is the Developer that Product Owner. Who reads the tests? Almost
writes the tests. Who reads the tests? Reader/Writer
anyone: Developers, Testers, Stakeholders,
Developers. And Testers. Its unlikely that anyone Business Owner, Product Owner.
When I test a spark plug in
else will read them. When my motorbike doesnt start,
isolation - and the test
fails - I know that spark plug is Specificity I know that something is wrong.
Behavioural Tests are tests of the
faulty. When a Unit Test fails, you But I dont know what is wrong.
system as a whole. The system
A Unit Test is a test of a component in isolation. know exactly what has failed. must be put into a known state
This may require mocking of (potentially slow)
Speed before each and every test. Not
external dependencies. As a result, Unit Tests are particularly difficult to do but
super-quick to run. not quick either.
The higher the level of code Code coverage percentages for
coverage, the better you sleep at Behavioural Tests tend to be high.
night. But 100% code coverage Coverage 100% code coverage is not Not all functional changes impact
is rare/difficult to achieve where uncommon. the external behaviour; the high
Any change to the functionality of a system will Unit Test are concerned. level nature of Behavioural Tests
require a change to one or more Unit Tests. Maintainability mean that they change
(Remember: the tests change first!) infrequently.
Unit Tests are highly specific to Behavioural Tests are not
the code that they cover; theyre coupled to code. Without
intertwined. Unit Tests are not Portability changing a single test you
portable. could:
rewrite your application
in a different programming
language;
refactor your monolithic
No rth
application into a set of BDD b y D an
cin g
du
microservices. d f ro m I n t ro
d a p te
A

2017 Development That Pays | Issue 1.5 (quattro stagioni) http://www.DevelopmentThatPays.com - Cutting-edge strategies for profitable software development
2017 Development That Pays | Issue 0.4 (american hot) http://www.DevelopmentThatPays.com Cutting-edge strategies for profitable software development

Potrebbero piacerti anche