What is UNIT in unit test? And what should it be?

Is a unit a class or a component (more than one class)?

What should be unit test? How grainy should the unit be?

+3
source share
5 answers

Unit is the smallest part of the application tested, usually a function.

+5
source

The term (similar to many other things related to Agile) is overloaded (means different things to different people). He has undergone many changes and is now subjective. Some have come up with a new term for microtests to prevent confusion.

. , , ( ). TDD

  • ( ). . unit test , w.r.t. , .
  • .

, ; .

+5

: unit test - , . : .

+3

It could be a class. It can be several classes. It could be the whole system. This is the logical part that takes input and gives the result, but it is defined for this component.

+2
source

It may also be smaller; a unit test for one method.

+2
source

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


All Articles