Effective unit tests Chapter Summary

The basic assertion assertion level of abstraction is too low; the removal of digital magic assertions can be used to improve the level of abstraction hamcrest
excessive assertion assertion too careful; clear assertion goal to ensure that the cause of the test failure is only a
bit assertion assertion level of abstraction is too low; converted into logical assertions
additional details of the test procedures are too detailed; the main test content to maintain a high level of abstraction, will be pulled out of the test related auxiliary function to an auxiliary function
split personality contains multiple test topics; the only assurance testing themes and objectives, will be too multi decomposition test to test other
logical partitions excessive decomposition; should be associated with the logic, the logic test to ensure that together
magic number literal into the function call parameters, can not know the meaning of the parameters; constants used instead of numbers, can be considered a common multi-test function packaging
lengthy installation steps too careful; details will be pulled to the auxiliary function, installation function to maintain a high level of abstraction
over protection before non-empty assertion assertion; should be removed, it is redundant

Guess you like

Origin www.cnblogs.com/webwei2017/p/11276953.html