Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>TDD is really a good practice (But at the same time I don't think that we should try to achieve 100% code coverage).</p> <p>Its main advantages are:</p> <ol> <li><p>It makes developer think about the API because he needs to use that API first to write tests. At this step it's very easy to feel that something wrong with your API (bad method's names, to many lines are required for most common operations, too many odd checked exceptions or contrariwise user have no possibility to handle presumable exceptions). And you can improve it and change it as you like because nobody has used it yet.</p></li> <li><p>You think about how your methods should work. This often opens some implicit problems or misunderstandings at early steps.</p></li> <li><p>When you have tests you have a nice way to measure percentage of completed work (i.e. if you have 20 tests and 15 of them are passed then 75% of work is finished). It's more important for you as a developer than for you team or process. You just divide the whole task into many smaller tasks (e.g. 20) and can compete them one after another. It's much more pleasant than to take on the whole thing.</p></li> <li><p>Tests allow you to play with the code. You can do refactoring, you can improve performance etc. And again, even if you won't do it anyway it's very nicely to realize that you have the possibility to do that. It's kinda confidence that everything is fine.</p></li> </ol> <p>How to make yourself to do TDD? You don't need! If you want to gain all listed benefits then you won't make yourself - you'll just do TDD with pleasure and of your free will. If you don't need/want/able to gain them - don't do it now. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload