When developing unit tests, from what I read, you should try to adhere to these principles:
On the other hand, these functions do not always correlate with a good test:
Is this a fair approach?
. . . () .
, , , , .
, , "", , , , .
- , , , .. , .
, , , . . , ( ), , , -, , . , .
() . , . , ( ) , , .
. , - . , - ; ; . ( ). , - , , , , : ; ; . , , . , , . ; . . . , . .
unit test , unit test . , , .
.
, . , . , Clean Code , . , , assertTrue(hw.heaterState()), assertEquals("HBchL", hw.getState()), , - . - , , .
assertTrue(hw.heaterState())
assertEquals("HBchL", hw.getState())
, , ( 1 ). . , , , , . , , . , , .
/ , . , , ( ). .
:
, . unit test , . , , , , .
, , . , .
, . "" , .
, , "ba".
: unit test 100% . , , . 1%, 100%, , , .
70% -80%, , .
: , unit test, , . , . , . , .
, , 2 . --.
Source: https://habr.com/ru/post/1710516/More articles:Installing multiple versions of a library in Delphi / C ++ Builder - delphiКэширование Visual Studio 2008 App.config - cachingIs it possible to temporarily duplicate and change rows on the fly in an SQL SELECT query? - sqlПроектирование WPF UserControl, который получает свой DataContext из внешних элементов управления: как иметь некоторые примеры данных в дизайнере, но использовать унаследованный DC во время выполнения? - wpfHow to load assembly from GAC? - c #Python urllib2 timeout when using Tor as a proxy? - pythonHow to create multi-stage animation of UIImageView? - iphoneWhat effect will denormalization have on requests, connections, and response time? - databaseFlex 3, cannot convert SystemManager to SystemManager when booting from the server? - flexHow do multiple audio files play sequentially? - c #All Articles