How do you test the code you wrote yourself?

How do you effectively verify the code you wrote? I find it very difficult to check the tiger test code that I wrote for my site, because part of me feels that I do not want to find errors in my code, because it shows that I am not perfect. (Even writing that I may not really bother me.)

I believe in unit testing, but lately I have become a little gunsmith and deployed a lot of code for production from the hip (which is not always bad for a new web launch, but it often happens).

I have been bitten in the past few weeks by the serious errors received by my own testing. I have a partner whom I push to the black box, check my own code, but because of my knowledge of the implementation details, I really have to be the best person to check the code weaknesses by testing the white box.

So, what methods and tools are useful to help you test the code that you yourself wrote?

+3
source share
6 answers

Summarizing:

TDD:

  • Before writing code, write unit test to take the inputs and check the outputs.
  • Write your code to make unit test pass - nothing more, nothing less.
  • Repeat for each method you are working on.

regression:

  • , //, .
  • unit test, , BUG FIX

:

  • , , unit test, .
  • , unit test.

:

+3

, , ( , ) , .

+4

, .

  • . . . . , - , .

  • , . , , , . - TDD.

  • , , (.. , - ). , .

+4

20 . .

, , unittests TDD.

+1

, . , . ,

0
  • TDD, , , . , .
  • . , , .
0

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


All Articles