Being a programmer is a very challenging job. No one can be perfect, and writing wrong code is common.

A. Code written by others has bugs

The great Sabbi wrote such a crappy code, thanks to god like me, I am the savior.

B. There are bugs in the code written by myself

1. Run for a long time <1> others found

This program has been running for a long time, is it really buggy, is it your mistake, can you reproduce it? What? Can reproduce, there is a nima problem is not big, otherwise the user complained early, look at you that panic-stricken appearance, really want to spit you a face of dog excrement.

<2> Discover for yourself

This bug hidden deep ah, fortunately brother sharp sharp, was not found by the leadership, tonight add a dish.

2. New on-line program <1> is discovered by others

This program just went online is still in the debugging stage, there is a bug is normal, who has no bug program, even the operating system has a bug.

<2> Discover for yourself

I am sharp, develop their own test, see the test of those guys can’t do anything, can’t detect such an obvious bug, what a bunch of crap.

C. Enter the program to modify the BUG

1. “Delete it or modify it? What a mess!”

There must be a solution online.

Who touched my code?

4. Have no idea what this code is.

5. Oh, why didn’t I write a comment?

Forget it, waste him, I still start from scratch!

Therefore, writing high-quality code plays an important role in advancing a programmer’s career path.

If you look around you, you’ll find that the more powerful the program, the less buggy the code.

Bugs often trouble programmers. If bugs are not found in the development and testing stage, they will be triggered in the production process along with the product release, sometimes bringing very serious consequences.

For their own sake and to save their DEBUG time, programmers should make their programs as bug-free as possible.

Programmers themselves can do this at every stage of program generation: careful design, code writing, unit testing (important), functional testing.

  1. The careful design of this means that programmers must have a clear understanding of the overall structure and logical structure of the code before writing it. Only then can they write the code.

There is no document here, but it must be clear thinking, clear thinking is not everyone can directly form in the head, many people are ordinary people, can not think of all the problems clearly in the head, so write it down, especially for complex logic.

Bottom line: Quality is relatively simple with a small amount of code.

  1. Unit testing Unit testing is no longer important because there are many tools available to help programmers and reduce their workload.

  2. The final hurdle for functional test programmers to ensure the quality of their code; In order to do this we may have to write some code to test, or even test the work. Use lots of cases for testing, and wrong cases.

The difference between this and tester testing is that it still allows the programmer to focus on the scope of his own code, reducing the difficulty of troubleshooting.