Home> Common Problem> body text

What is the purpose of software debugging?

青灯夜游
Release: 2021-06-10 15:54:41
Original
16428 people have browsed it

The purpose of software debugging is: to correct errors. Software debugging is the process of testing the prepared program manually or by compiling the program to correct grammatical and logical errors before putting it into actual operation; it is an indispensable step to ensure the correctness of the computer information system.

What is the purpose of software debugging?

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

The purpose of software debugging is: to correct errors.

The concept of software debugging

Software debugging generally refers to the process of reproducing software defects, locating and finding the root cause of the problem, and finally solving the problem. Software debugging usually has the following two different definitions:

  • Definition 1:

    Software debugging is to discover and eliminate errors in software programs, which can be done through a certain method A method to control the execution process of the debugged program so that you can view and modify the execution status of the debugged program at any time. In this definition, software testing is part of software debugging, similar to the Oxford dictionary definition of debugging. Debugging is defined in the Oxford Dictionary as: "The process of identifying and eliminating errors in computer hardware or software."

  • Definition 2:

    Debugging is the execution of a successful test What to do next. The so-called successful testing means that it can prove that the program does not achieve the expected functions. Debugging consists of two steps, starting from the execution of a successful test case and discovery of problems; the first step is to determine the exact nature and location of the suspicious error in the program; the second step is to modify the error. In this definition software testing is separated from debugging work.

The connotation of software debugging

Software debugging is to manually or compile the program before putting the compiled program into actual operation. The process of conducting tests and correcting grammatical and logical errors.This is an essential step to ensure the correctness of the computer information system. After the computer program is compiled, it must be sent to the computer for testing. Based on the errors found during the test, further diagnosis is carried out to find out the causes and specific locations for correction.

The term debugging can mean a lot of different things, but most literally, it means removing errors, exceptions, and bug. Now, there are many ways to do this. For example, you can debug by scanning the code for typing errors or using a code analyzer. You can use the performance profiler to debug your code. Alternatively, you can use a debugger to debug.

##The basic process of software debugging

##According to definition 1,The basic process of software system debugging is as follows:

    Use an editing program to send the compiled source program to the computer in a certain writing format. The editing program will add, delete or modify the source program according to the user's intention.
  • Translate the incoming source program into machine language, that is, use a compiler to check the source program's grammar and translate the source program statements that comply with the grammatical rules into a "language" that the computer can recognize ". If there are grammatical errors found after checking by the compiler, you must use an editing program to modify the grammatical errors in the source program, and then compile again until there are no grammatical errors.
  • Use the connection program in the computer to connect the translated computer language programs and build it into a program that the computer can actually run. During the connection process, connection errors generally do not occur. If connection errors occur, it means that there are problems such as confusion in subroutine calls or incorrect parameter transfer in the source program. At this time, you need to use an editing program to modify the source program, and then compile and connect it. This is repeated until there are no connection errors.
  • Conduct a trial calculation of the modified program. At this time, you can assume several simulated data to trial run, and compare the output results with the correct results of manual processing. If there is a difference, it indicates that there is a logical error in the computer program. If the program is not large, you can use manual methods to simulate the computer to modify and process these data of the source program; if the program is relatively large, manual simulation will obviously not work. At this time, you can only set the computer to single-step execution. Step tracking program execution. Once the problem is found, the source program still needs to be modified using an editing program, and then it still needs to be compiled, linked, and executed until there are no logical errors. You can also compile it after completion.

According to definition 2, the basic process of software system debugging is as follows:

  • Reproduce the problem: Reproduce the problem discovered by software testing;

  • ##Problem location: Determine the location of the program segment where the problem may occur;

  • #Find the cause: analyze the relevant code and determine the problem causing the defect The internal reason;

  • ## Design plan: put forward Solutions to software defect problems;

  • ## Modify the code : Modify the program code according to the design plan;

  • # Verification and validation: Use techniques such as review, analysis, and testing to determine whether errors have been eliminated and whether new errors have been introduced.

#The above 6 steps are continued iteratively. until the problem is solved. The basic process of software debugging is shown in Figure 1:


##In these steps, problem location and finding the cause are key aspects of software debugging, and its workload accounts for about 90% of the total workload. %above. Software debugging is a time-consuming, laborious, and skillful task. Currently, there are many studies on problem location in software debugging.It can be seen that the process of definition one is more suitable for our daily development and testing work; while the process of definition two is more suitable for our testing, especially the work related to the problem found after software release or online.

Basic characteristics of software debugging

  • Extensive correlation
    Requires debuggers to have strong basic computer knowledge (including operating systems, development languages, tools, etc.) and Proficient in business problem domain knowledge.
  • Difficulty
    You can tell whether it is difficult or not from the "extensive correlation". Of course, it also depends on the specific problems faced and the quality of the debugger
  • It is difficult to estimate the completion time
    This time is really impossible to estimate, unless there are experts in the field of a certain problem and the overall software architecture and code understanding and familiarity.

Software debugging classification

  • Classification according to the system environment of the debugging target: software debugging under Windows, software debugging under Linux, software debugging under Dos Software debugging, etc.
  • is divided according to the execution method of the target code:
    Script program – script debugger
    The compiled program is executed:
    It is first compiled into intermediate code, and then dynamically compiled into Target code that the current CPU can execute (such as .NET programs developed in C#) – Managed debugging
    Programs directly compiled and linked into target code (C/C) – Local debugging
    Both of the above – Mixed Debugging
  • According to the execution mode of the target code, it is divided into: user mode debugging (User Mode Debugging), kernel mode debugging (Kernel Mode Debugging); As a fundamental measure of order, the system defines two execution modes, namely the low-privilege level User Mode (User Mode) and the high-privilege level Kernel Mode (Kernel Mode).
    Application code runs in user mode, and the operating system's kernel, execution body, and most device drivers run in kernel mode.
  • According to the stage of the software: development period debugging, product period debugging (the dividing line is the official release of the product)
  • According to the relative position of the debugger and the debugging target: local debugging Oh, Haas, remote debugging
  • According to the activity of the debugging target: active target debugging, dump file debugging
For more related knowledge, please visit

FAQColumn!

The above is the detailed content of What is the purpose of software debugging?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!