As we have already seen, TDD and BDD follow many of the same principles, but have some differences in their style. While these two styles provide the same functionality, BDD is considered to be easier to read by many developers.
The following table compares the naming and style of the suites, tests, and assertions used by the TDD and BBD styles:
TDD |
BDD |
suite |
describe |
setup |
before |
teardown |
after |
suiteSetup |
beforeEach |
suiteTeardown |
afterEach |
test |
it |
assert.equal(math.PI, 3.14159265359); |
expect(math.PI).to.equals(3.14159265359); |