Unit Testing felt

Unit Testing felt

These days, went to see what the teacher issued a "road test of the unit," the book, to be honest, a great feeling, the author cites many examples, tell us of the importance of unit testing, unit testing it is to serve the people it can make your job easier, reducing the time and effort you spend on the test, so the question is, what is the unit testing, unit testing is a piece of code developers to write and test code for testing a very small, very specific function is correct. Typically, a test unit for judging a specific condition (or scene) acts at a particular function. , And the authors also suggested that the test should be indirect and refined, which means that each test should be highly relevant, and independent of the environment and other tests
in the preparation of the test, make sure you only once tested the same what
a test function should focus on the function of a product code, or combined together to provide a set of functions and certain characteristics
Ideally, you can have a corresponding relationship between the traceability of potential bug and test code. in other words, when a test fails, it should immediately be aware of the potential bug in the code location
"independent" means that no tests rely on any other test; you should be able to run any single test at any time, in any order, we are. have a habit, often not willing to write a simple unit test program to verify your code. Their program has been very confident, or luck after each run by a direct throw test group. However, you will find BUG after each test group submitted over its own procedures did not think there are many loopholes. But after each modification or good BUG With luck, this will not be considered a bug. Then again confidently submit, the result has lost the battle. Because after several visits. Developers spent to find and fix BUG BUG time of these add up to this module also spend more time than he has developed, so this is the importance of unit testing, reduce the time and effort, do not always go a long Finding fault. Why the

Guess you like

Origin www.cnblogs.com/baidu1213/p/12580873.html
Recommended