Unit tests – testing individual parts of functionality by providing input data for every condition
What should be tested?
What should not be tested?
Integration tests – testing several modules together to make sure those interact as expected
Functional tests – tests whether or not the flow of an application is performing as designed from start to finish
Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved so that the tests pass.
In software engineering, behavior-driven development (BDD) is an agile software development process that encourages collaboration among developers, quality assurance testers, and customer representatives in a software project. It encourages teams to use conversation and concrete examples to formalize a shared understanding of how the application should behave.
TDD
BDD
Focus
Reader/Writer
Specificity
Speed
Coverage
Maintainability
Portability
code quality
value
writers: developers, readers: developers, testers
writer: product owner, reader: developers, testers, stakeholders, business owner, product owner
high specificity
when test fails, it unclear what exactly went wrong
fast
slow
100% code coverage is rare/difficult to achieve with Unit Test
100% code coverage is no uncommon
changes to the functionality changes to Unit Tests
change infrequently
highly specific to the code
not coupled with code
In BDD you will come across a better specification since communication between the software developer and the product owner is fast and easy.
TDD may lack the ability to specify the exact behavior and makes a process of functional code changes more complex, but you achieve higher quality with software code.