DEV Community

Discussion on: Testing With TDD And BDD

Collapse
 
chimung profile image
chimung

"One advantage of writing tests this way is that you won't have to update the test implementation every time you update the code implementation." - I dont get that. Why we need update the test when the code implementation changes?
For example: Writing function which calculates Fibonacci.

In TDD: assert.equal(1, factorial(0));
In BDD: factorial(0).should.equal(1);

When we change the implementation, we dont need to update this test.
I only see the difference in syntax. Can you figure out with this example?