Someone said that the procedure is to be transferred out, and do not say whether this sentence is one-sided, it is undeniable that debugging is very important.
The purpose of debugging is to find out the problem, the dichotomy of smoke debugging is the simplest and most effective way to locate large code problems, because this debug method locates the error code line with the time complexity of the logarithmic order.
The name "Binary Smoke Debugging" may be a bit confusing. In fact, it is very simple, the concept of "dichotomy" is taken from our common "dichotomy", this should not be explained, and "smoke" is taken from the "smoke test", whether 3,721 run first to see if it is normal or not.
"Binary smoke Debugging" is ideal for use in dynamic languages such as PHP, Javascript, and many times because of the dynamic nature of language that makes it difficult to locate problem codes.
For example, a project is a custom development based on a third-party PHP system. The system defines its own template mechanism, which can nest PHP code in a template. A row in a hundreds of-line code has a wrong line in the template file, but the error message can only be located to the file.
At this time the two-way smoke debugging can debut:
- First the file waist cut off half of the code, refresh the browser, wrong?
- Have, cut off the remaining code of half the code, that is, the total code of 1/4, refresh the browser, error?
- Yes, it means there's a problem with the code that's at least just deleted.
- Cut off the existing normal code to just cut off half of the code to stick back, refresh the browser, wrong?
- ......
- So repeated, the basic three times can be fixed to the wrong.
Step seems troublesome, in fact, very save time and effort. You can use this method to locate the error code and then analyze the cause of the error.
The idea of dichotomy in the commissioning of a lot of deformation usage, the time is limited today is not discussed in detail, and later if there is time to add it.
Two-way smoke debugging--programming debugging kick