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

Why are software defects more prone to using Python?

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

In this issue, the editor will bring you about why it is more prone to software defects when using Python. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Often new programmers try to compare the differences between major programming languages and then choose what they think is a better programming language to learn. Although it is recognized in the circle that there is no good or bad distinction between the major programming languages, only whether it is appropriate or not, I wonder if the majority of programmers have thought about the impact of programming languages on software quality.

Recently, researchers Baishakhi Ray, Daryl Posnett, Premkumar Devanbu, and Vladimir Filkov collected a large amount of data from GitHub (728 projects, 63 million SLOC,29000 authors, 1.5 million submissions, 17 languages) to answer the question: what is the relationship between programming languages and software quality?

They found that:

Programming language does have an impact on software quality, but to a moderate extent.

Programming languages that do not allow type confusion are better than those that allow type confusion.

In functional programming languages, static types are better than dynamic types

Functional programming languages are less effective than procedural programming languages.

Conclusion:

The quality of software written in functional programming languages is obviously not as good as that in procedural programming languages. C, C + +, Objective-C, Php, and Python are associated with a greater number of bug fixes, while Clojure, Haskell, Ruby, and Scala are less likely to lead to bug fixes. In functional programming languages, statically typed languages perform better. There is a small but important relationship between language types and software defects, and functional programming languages have more defects than procedural or scripting languages. Defect types are closely related to programming languages, and some defect types, such as memory errors and concurrency errors, depend on language primitives. For specific categories, the programming language has a greater impact on the overall defect.

The above figure shows that the first is the programming language, and the last is the corresponding number of bug fixes. It is not difficult to see that the 41.9 of Python is significantly higher than the 35.9 of Java. If Python wants to replace Java, there seems to be a long way to go. In addition, 182.6 of C is outrageous, probably because C came out earlier, so it experienced a longer period of exploration and repair. C++ and C # may have the same reason as C.

The language and project data selected in this experiment are extracted from the public GitHub database GitHub Archive. The researchers selected the top 20 programming languages from GitHub (excluding CSS, Shell scripts, and Vim scripts because they are not considered lingua franca) and added Typescript. At the same time, the top 50 open source projects in these mainstream programming languages are retrieved!

For each project (a total of 728), the researchers used git to download unmerged submissions, including the submission log, author date and author name. The code loss and the number of files submitted for modification are calculated based on the lines added and deleted per file, and then the language associated with each submission is retrieved from the modified file extension. For each submission, the submission cycle is calculated by subtracting its submission date from the first submission of the corresponding project, and statistics related to other projects are calculated, including the maximum submission cycle of the project and the total number of developers involved. The researchers identified error repair submissions for individual projects by searching for error-related keywords, such as "error", "fix", "problem", "incorrect", "fault", "defect" and so on.

Then, according to its cause and influence, the error is divided into two stages: keyword search and supervised classification. The researchers used regression models to record the number of defect submissions related to software projects.

These are the reasons why Python is more prone to software defects. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

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