Maintenance and re-development of historical legacy code

Source: Internet
Author: User
I. Code maintenance when time is loose
For the new, generally set aside a period of time for the code to take over, then how to deal with the code in the hands, is not just to see the code, write ideas, or can take advantage of this time spare, forge to upgrade themselves, I expect the latter, combined with the company's department, the situation of personal interpretation:

1, familiar with the existing code. If the code to get the hands, do not know what to do, what is the use, it may mean nothing, the back of the need not to see.

2, add or add to test example, if there is no test example, the subsequent reconstruction is basically no way to infer whether the correct.

3, use the test example to test the code, in order to achieve the relevant results and understand the code logic and function purposes.

4, the gradual refactoring code, the related code through the use of a series of means to reconstruct.

5, the reconstruction part, using the relevant test example to test, for running just, through the control of the old code, find related problems and then deal with.

6, continue to reconstruct and execute the test example, until it can achieve a pleasant effect.

Second, the time is urgent function requirements
In the development process, most of the encounters should belong to this category of problems, the duration of the requirements are relatively tight, and for the original only a major understanding, or only to see part of, and immediately add or change the function. For such a situation, as far as possible to do a steady, new features do not know the old code related parts of the unclear, resolute not to make changes and new features to join, otherwise it will result in the change out of the quality of the demand is not high, later maintenance difficult. The individual feels able to take the following process as follows:

1, thoroughly understand the new needs.

2, the new requirements with the understanding of the existing code, to determine what needs to change, where to change, where to add, whether to new interfaces and so on.

3, the change of the partial collation of the relevant test examples, the missing to be supplemented.

4, add or change the code.

5, the implementation of test examples, so that the relevant use cases are passed. 4, 5 steps are very likely to repeat.

6, to test department, or published.

7, the change part of the reconstruction, and then perform a test example. (This step may be ignored when the time is particularly tight, but the individual does not want to)

Maintenance and re-development of historical legacy 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: info-contact@alibabacloud.com 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.