Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summarize the definition, classification, detection and repair of software defects.

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "summarizing the definition, classification, detection and repair of software defects". In daily operation, I believe many people have doubts about summarizing the definition, classification, detection and repair of software defects. The editor consulted all kinds of materials and sorted out simple and useful operation methods. I hope it will be helpful to answer the doubts of "summarizing the definition, classification, detection and repair of software defects". Next, please follow the editor to study!

Software defects and their classification

Many Chinese words in computer science are translated from English, and sometimes they can not accurately describe or depict the true meaning of words. In the field of software, the words you can think of related to defects may be: bug,defect,fault,error,failure,exception and so on. To tell you the truth, I have never understood the difference between these words. But understanding the differences between these words is not only a word game, but also helps us understand the differences in detection and repair techniques for them. So I google for a while, but most articles have different definitions of these words. The following is the definition of these words in software code that I agree with.

Fault/Bug: code that does not conform to business logic appears in the software, such as a + sign written as a-sign

Error: a value that does not conform to expectations occurs during the operation of the software, such as a whose value is 2 and is calculated as 3

Failure: unexpected behavior occurs when software interacts with people, such as program crashes. So Fault may lead to Error, and eventually to Failure. Note that it is possible, not necessarily, here.

Defect: a Defect is a general term for a class of code defects, such as memory leaks.

Fault usually needs to detect from Error,Failure, that is, to compare whether the execution result of the program matches the expected specification (Specification). This process is actually debugging (debugging) and testing (testing). Fault can also be referred to as a defect related to business logic. Defect is a problem with the code itself, a software problem that does not depend on the execution results and expected specifications, so Defect is usually detected by statically scanning (not running) code.

Current situation of defect detection and repair

As you can see from the above, Fault is detected by testing, while Defect is detected by static analysis. In enterprises, the penetration and recognition of Fault testing is usually higher than that of Defect testing, mainly for the following reasons:

(1) Fault will directly affect the behavior of software, which is regarded as a serious problem, while many Defect can not directly affect the behavior of software, or affect the behavior of software only in very special situations. Developers think that it is optional.

(2) Software errors caused by Fault are easy to be observed. There is direct evidence to prove that there are errors in the software, and developers tend to modify them, while Defect is usually difficult to observe.

(3) the threshold for testing is lower, and testers only need to write some test scripts, but static analysis requires the accumulation of skills in program analysis.

(4) some inherent shortcomings of static analysis (time-consuming, false positives) cause dissatisfaction among developers.

In terms of automatic repair, it has been quite popular in academia in recent years, and gradually began to be used in enterprises, but it should still be in its infancy. Contrary to detection, the automatic repair of Fault is relatively difficult, because it involves business logic and requires some logic to be added manually. Of course, recently, many academic studies have used machine learning to automatically learn the automatic repair of Fault; and a lot of Defect repair does not need to add code related to business logic, so a high level of automation can be achieved, but there are no automation tools in this area.

Problems and prospects of Defect detection and repair

It is not difficult to find that the detection of Fault has been relatively mature, while the detection of Defect has not been paid enough attention. In the past, we may only focus on the correctness of the software, so the detection and repair of Fault is more popular, but Defect will also affect the quality of the software, which also needs attention.

Recently, the company is advocating to improve the ability of software engineering and create highly reliable software products, but also emphasizes that we should not only pay attention to the correctness of software functions, but also pay attention to the quality of non-functional aspects and write "beautiful" code. Therefore, automatic detection and repair of Defect is a valuable direction, here are some possible things to do:

(1) strengthen Defect training for developers to understand common Defect and avoid writing such Defect as much as possible when coding, which is much less expensive than subsequent detection and repair. Although the company has many programming specifications that define different Defect, developers may not study attentively, so it is critical to make developers aware of the harm of Defect.

(2) strengthen the Review mechanism of the code. I personally know this: when there is no Review, the code is written more casually, and when there is Review, it will be considered more comprehensively. After all, you have to show it to others.

(3) automatic detection of Defect. People are better at Fault detection than machines (such as writing test cases), but machines are better at Defect detection (such as enumerating program paths), so Defect detection is more suitable for automation. At present, the company has also introduced some automatic detection tools for Defect, such as coverity,fortify,findbugs, etc., but these tools are usually only used as black boxes. This can cover more Defect, but it also brings some problems: the same Defect instance is repeatedly reported by different tools, it is difficult to add some Defect detection rules, and it is difficult to deal with Defect exception scenarios. Therefore, we may need a unified Defect detection tool.

(4) automatic repair of Defect. In addition to time-consuming and false positives, another unpopular aspect of Defect detection is that developers don't know how to fix it. Therefore, the automatic repair of Defect is also an effective way to improve the importance of Defect. Moreover, compared with the automatic repair of Fault, the automatic repair of Defect is simpler for the machine, because the categories of Defect are limited and can be enumerated, and the nature of Defect is more formal and does not depend on business logic. We hope to develop a unified Defect repair tool in the future.

At this point, the study of "summarizing the definition, classification, detection and repair of software defects" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report