24
kvsm
8y

Tests!

Before you write a piece of code, write tests which will check that the code does what you expect. This helps you in two ways:

1. It forces you to think about and understand the purpose and aim of the code you're about to write before you start hacking away at it.

2. You know when you're finished, because the tests will pass.

Comments
  • 2
    For those who want more information, this practice is referred to as TDD (test driven development )
Add Comment