If you're not writing tests first you're missing out
Most of us developers write unit tests. Only a percentage though writes them before the production code, before the code they're meant to test.
If you are not writing tests first you are missing out on a number of benefits.
Prevent false positives
If you write your tests after the production code is completed you will only see them pass. If they pass on the first run, how do you know they would fail if the code was wrong?
When writing tests before implementation you start with a failing test, and then you write just enough code to make it pass. This gives you confidence in the ability of your test to fail if the behaviour it's asserting will change in the future.
Read full article from If you're not writing tests first you're missing out
No comments:
Post a Comment