How to ensure the validity of the code

Source: Internet
Author: User

1, a full self-test, all kinds of scenes to be tested, into the participation in the results and calculation to maintain consistency;

2, consider a number of boundary values, the critical situation is generally a potential hidden danger;
3, draw a clear line of code boundaries, consider whether the current code affects other code;
4, consider whether the efficiency of the implementation of the code to drag the overall performance of the system;
5, to QA testing;
6, on-line monitoring of a code of log output, the log can be mainly concerned about the situation of anomalies, you can use AOP to weave code into the code, through the occurrence of an exception message or text message to inform the developer, in order to quickly identify the problem.
7, give the return code after the exception is clear prompt information, that is, because of what caused the anomaly, may not be accurate positioning as a problem, but at least to ensure that the scope of troubleshooting can be greatly reduced.
8, coding to standardize, strongly recommended according to code to implement.
9, the code coupling degree is low, the cohesion is high.
10. The database changes in the development environment should be recorded, and the better method is to generate the SQL of the data table changes by date, and submit them to operation and maintenance at the same time.
11, the database must do a full amount of backup, incremental backup according to the specific circumstances as appropriate choice. Be sure to back up the database completely before you go online.
12, do not do not fully demonstrate before (at least to ensure that two of the participation and approval), stop any service on the production; do not stop the application before it is fully justified, and do not perform any operations on the database before it is fully justified.
13, get a demand, first understand what to do? To understand the requirements in a profound sense, it is important to reiterate that it is better to find a logical loophole for the requirements and to be able to discuss and refine it with PD.
14, thoroughly understand needs, to consider what technology to achieve, we have no experience in this area, if there is no need to find the relevant personnel (people with this experience, if there is no experience in this area, you can report the leadership, the next outcome of how to be decided by the leadership, such as cut off, such as to take other methods).
15, thoroughly understand needs, but also know what technology to achieve, the next is to consider how to achieve the problem, how to dismantle the demand into a small function, the size of the dismantling of how to control the length of the problem, whether the impact of other business problems, performance problems, seriousness and meticulous problems (this point of emphasis is not excessive, do not ignore!) )。
16, understand the status quo of the system, such as the status of the use of what technology? What is the logic for dealing with business? What are the advantages? What needs to improve the aspect (the system has been running for a long time, generally do not need us to change the overall system of thinking, if you want to improve, you can communicate with the leadership, after agreeing to a little improvement, optimization, don't come up on the fencing, so heavy blood, do not believe try).

17, multi-dimensional grasp of my business needs, thereby reducing the complexity of the business.
18, do the function of a very important reference is the function is very self-closed loop.
19, a functional demand if too large, in the specified duration can not be completed, with the leadership, PD communication, staged.
20, determine the completion of the current function of the dependency, that is, to complete the current function, we need to complete the first function, but also to complete this feature may be the exception, if you handle these abnormal conditions.
21, in the development of a function, a list of the functions of the disassembly of the small function, and after each of the completion of a small function to be crossed out, so as to boost confidence, improve morale, while preventing omission.
22, to avoid the client to do the interface should do things, such as the interface should be done for the loop, by the client to do, the performance will be very poor.
23, to avoid exposing useless, untested interface, that is, to follow the minimum interface exposure principle.
24, the function of the problem on the line should be closed first, the general problems are new on-line, or on-line time will not be too long, the amount of natural users will not be much, special cases special treatment, here only consider the general situation.
25, optimize the execution of slow SQL, monitoring CPU, memory, disk, network usage.
26, ready to face the pressure of the heart preparation.
27, complex problems disassembled into small problems, small problems and then disassembled into curd, sub-steps, batches of times, a little solution, million can not panic.

How to ensure the validity of the code

Contact Us

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: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.