When writing JUnit tests, make sure that you keep in mind in mind:

xiaoxiao2021-04-08  406

Test habits

write

Junit

When testing, make sure you keep in mind in mind

:

·

It will only run very well with the places you test.

·

Measure word

,

Write a little

,

Measure word

,

Write a little

...

·

Take all the tests must be performed.

·

Have a minimum of running all test cases every day

(

Or one night

)

.

·

Write a perfect test for code that the most destroyed probability.

·

Write tests for you most likely to get the return.

·

If you are always debugging a place, write

Junit

Test automatic verification results instead of debugging.

·

If there is

Bug

Reported, write tests to expose this

Bug.

·

Someone let you help debug, help him write test cases.

·

Write a unit test code before writing the code, only written the new code when the test fails. Write the simplest new code to make the test pass.

转载请注明原文地址:https://www.9cbs.com/read-132854.html

New Post(0)