Test-Driven Development

 

The Most Common Mistakes in Test-Driven Development





TDD is theoretically a simple technique with only a few steps to be followed. As we all know programmers are not perhaps as disciplined as they should be which can lead to poor-quality code and/or unexpected behaviors. Programmers feel this is an unnecessary step in TDD since they just wrote the test and know it’s expected to fail. However, when coders skip this step, they make a mistake if that new test does not fail. This can lead to ‘false positive’ tests of code and ultimately failing code passing into production.

Nearly 25% of programmers forget to watch the test failing which in itself is a failure.
Once the code is working TDD states that the programmer should refactor to create clean code. About 1% of coders always forget this step and I assume pass rubbish code into production.When you’re working on a piece of code you might see some other legacy code that needs fixing. TDD states that if there is a failing test you need to make it pass and only refactor when you have green. Almost 40% of programmers make this mistake regularly and probably costs them a great deal of time in the process. ”Don’t do two things at once. KISS”

Post a Comment

0 Comments