Unit tests in TDD

I'm new to TDD, and the first question that came to my mind is whether unit tests should be applied for each component developed. I ask for this, since I noticed that unit testing takes a lot of time, especially when some changes to the requirements are provided. So, could you suggest something like TDD best practices regarding unit testing?

+3
source share
4 answers

A brief description of TDD, expressed in three rules :

  • You are not allowed to write any production code unless it fails the unit test.
  • You are no longer allowed to write unit test than enough to fail; and compilation failures - crashes.
  • , , unit test.

: http://jamesshore.com/Agile-Book/test_driven_development.html

: http://www.growing-object-oriented-software.com/

+9

-

,

. , , . , , , : " ". . , - , , , , , , , , , . 2 , , , .

. , , , . .

, , , - , , , , , . .

+4

TDD , . unit test, , . , :

, .

+1
source

Tests lead to the development of your code. TDD is really everything to determine the desired behavior of your software, the fact that everything it checks is a good side effect.

A good essay on TDD is available here.

0
source

Source: https://habr.com/ru/post/1754009/


All Articles