lundi 19 mars 2018

If TDD is for units, how can a test accidentally pass first (as a mistake)?

I have read a study about TDD and one of the common issues (survey between developers) stated that they are not really letting the test fail first. The authors then state:

If a new test does not fail, programmers receive an indication that the production code was not working as they thought it was and a code revision might be necessary. Another problem that might occur is that programmers cannot be sure about what made the test pass; nothing ensures the new code was actually responsible for it. The test implementation might have been wrong since the beginning.

I wonder, how can a TDD test ever pass first (because of the production code, like they mention), if it on a unit level? I mean, if all is mocked (stubbed..), it should be always isolated and thus never cannot really pass first.

Aucun commentaire:

Enregistrer un commentaire