Some suggestions on how to reduce program Bugs by program apes

Source: Internet
Author: User

There is no doubt that the procedural ape is a good thinker.

A program is written through: think, design, write, debug, test, and execute these major phases.

But most program apes have a problem with being reluctant to test their code.

After they had finished their work, they felt that the job was over and that it was the work of the Test crew.

According to theory. Suppose there is a problem with the code. Then the testers and finally the users will certainly be able to find these bugs, and waiting for the time to return to find out where the problem is really the cost is not small, the cost is:

1. Affecting the program Ape's own reputation

2. Affect the quality of the product

3. Influence the trust of the customer

4. The difficulty of debugging at this time has increased a lot.

Big don't say, say more own reputation influence it. Assuming that your program always has bugs like that, you'll get a lower profit, even if you write a lot of code.

In fact the last point is also very important, when we face a piece of code. It's good to do anything, but suppose you put this code behind a huge system. Simple questions are hard to find right away. For your own consideration, save yourself DEBUG time, we should let our program as far as possible without bugs.

So how can you ensure that your code has no bugs?

Program apes must overcome some of their own fatal shortcomings in order to fundamentally solve the problem.

So what's the problem? We have mentioned earlier. Program apes are very tolerant of their own code, and feel that it is right without problems. In fact, the idea is more normal, the program is through the program ape Thinking and design after writing, the program ape will not think of things they do not feel wrong in the code, and at this time has been if the program is correct, but err, how can not make mistakes. In fact, the monkey's attitude towards other procedural apes is very good, with a fastidious and learning attitude, but it is very difficult to do so once the code is treated, which is the most deadly. Program apes also have to be picky and learning about their code, which is based on how the code is wrong and what needs to be done to prove that your code is correct. The program ape itself can do these things at every stage of the program generation:

Detailed design, writing code, Unit test (important), functional test.

1. Meticulous design: This detail is that before the program apes write code, it must have a clear understanding of the entire structure of the code and the logical structure, only at this time can be enough to write code. The document is not mentioned here. But I said it must be clear thinking, but clear thinking is not everyone can be directly formed in the head, very many people are normal, there is no way in the head of all the problems to think clearly, then write down, especially for complex logic ( this time to draw a little time is worthwhile. We have to make sure that we have a clear outline of our program and then we start writing .

2. Write code: For the code that is not sure. For example: The new design algorithm, it is best to ensure its correctness.

Being able to test this part alone will allow the code to be modularized at the same time to ensure the correctness of the code. Bottom line: A small amount of code ensures that the quality is still relatively simple.

3. Unit test: The importance of unit testing is not redundant, there are many tools to help the program ape and reduce the workload.

4. Function test: The program ape to ensure their own code quality of the last level; In order to do this we may have to write some code to test, even test work.

Use a lot of case to test, and the wrong case. The difference between this and the tester's test is that it still puts the program ape's attention within its own code. Reduces the difficulty of troubleshooting.

*. If you have passed the above steps, you can not find any problem in your program. Then I think your program may need more than just review, you may have to abandon it, according to the previous idea or another way of thinking again, the process of thinking may be very troublesome. In fact, when you really calm down to do, you will find that you are not only a bug-free program. Many of the other things you have never imagined. And this time the code is written much more smoothly and faster than the first. More robust.

It ' s unbelievable.

It says that the attitude of the program ape to other people's code is fastidious and learning attitude. So it's a good idea to have other program apes REVIEW your code as well as checking the program for any logic errors. The team should cross-REVIEW code, which is a practical experience.

As a good program apes must have the above habits. and treat yourself to code like a child. We have to cherish our code. At the same time, let the code go the right way.

Some suggestions on how to reduce program Bugs by program apes

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.