On that day, I conducted a program specification training for new employees of the company. I divided these specifications:
1) Micro specifications.
2) macro specifications.
First, let's talk about micro-standards.
First, contractual programming. This is the specification of the link between processes, functions, and functions. Like the workers on both sides of the assembly line. If the worker in the next process starts to use the parts produced by the worker without checking the parts produced by the previous process, the worker shall take responsibility even if there is a problem with the parts of the superior worker. If he checks for problems before use, the workers in the previous process will be responsible. Therefore, when a higher-level worker passes down a part, check it first. Similarly, if Program When passing parameters, the function of member A does not check and outgoing incorrect values, so programmer A needs to be responsible. However, if the next-level programmer B does not check, it is the responsibility of programmer B to have problems. Requirement: when passing in and out parameters, the function must make judgments to eliminate errors within the minimum range.
Second, assertion. We are releasing the program Code Debugging is required before, and assertions can be made during debugging.
Example (C #): system. Diagnostics. Debug. Assert (keyword. length> = 3 );
In the above example, if the length of keyword is less than 3, an error will pop up and you will be asked for further operations. However, this code is not executed in the release. This is advantageous. Writing more code will not affect the release version.
Of course, we need to add the following sentence: If (Keyword. Length < 3 )
{
Return Null;
}
This is for the release version.
The above two are important and there are other standards. The document is on the card. Remember to write it again.Article.
there are several basic principles on the macro level: three layers, MVC, and object-oriented. This article will be discussed later.
finally, there are tests, including unit tests.
if you have time, write another object-oriented analysis technology.