The introduction of basic pre-environment and conditions.
Write the main boundary conditions.
Consider decoupling.
The point is that the code is written as a class, the way it looks.
Don't be process-oriented. One line after the other. If this is the case, you won't be able to test it without adding a breakpoint.
But adding breakpoints is not what we're after. Unit tests that do not interfere with the work code.
About decoupling: Another point is that it is convenient to compare small units to test
This makes it easy to judge the test results.
But can not be too small, too small to test the significance of little.
Unit tests must also be written during the development process.
The article about testing, mainly unit testing:
http://segmentfault.com/q/1010000000692485
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.