I. Personal skills and processes
Most of the software is done by many people. Everyone's work is dependent on each other. The most typical example is that the function of a module that someone is responsible for is called by another person. Many of the errors in the software come from the programmer's misunderstanding of the function of the module, negligence or the failure to understand the module changes. How can I be responsible for the module function definition as clear as possible, the internal changes of the module will not affect the other modules, and the quality of the module can be stable, quantitative guarantee? Unit testing is a very effective solution.
The main steps for creating a unit test function are:
-
set data
-
Use the function of the type being tested
-
Compare actual results with expected results
The standard for good unit testing:
Unit tests should verify the correctness of the program on the most basic functions / Parameters
Unit tests must have the person most familiar with the code (the program's author) to write
Machine status remains the same after unit tests
Unit tests are fast.
Unit tests should produce repeatable, consistent results.
Unit tests should overwrite all code paths
Unit tests should be integrated into the framework of automated tests
Unit tests must be saved and maintained with the product code
Ii. cooperation of two persons
Code Style Specification:
Indent in
Line width
Brackets
Line break with blank {}
Branch
Named
Underline
Uppercase and lowercase
Comments
Code review. Including self-review, peer review, team review. The two more familiar members are usually reviewed by one another.
Two people need to work together constantly, need to think more, try to view the problem from the other side.
III. issues relating to cooperation between two persons
To lock files when checking out, each module requires write unit tests, check-in conflict handling-merge and recompile, test resubmit, code review required when checking in.
Two people may be in cooperation due to different personal habits, resulting in different styles of code, then two people need to negotiate. In addition, because the foundation is poor, the idea of code may be very different, then need to communicate with each other, choose a better one. Plus the comment is more important, convenient to view.
Two people trooped practice source code operation