Are these such extreme cases that I have to consider when using unit testing?

When writing unit tests, it is usually recommended to check edge cases.

However, are they the right thing?

  • Check that the connection to db is not open (it is claimed that an exception is thrown)
  • Assert that a table that should always have> 1 row does this
  • Assert that the field that is required is! = Null.
  • Confirm that ip was installed in the correct format (I can parse the string to IP).

thank

+5
source share
1 answer

, " " , .

, , 50 . :

  • 49 -
  • 50 - (, , - )
  • 51 -

, , , , . , , , .

, 20 100 (), , .

+5

All Articles