AI generated code accelerates code shit mountain nightmare?

Today, many programmers choose to use AI to assist programming, but with the rapid popularity of AI software development, concerns about code quality have become increasingly prominent. Adam Tornhill, who has been engaged in code research for a long time, once said that the main challenge faced by AI-assisted programming is that it can easily generate a large amount of code that does not need to be written.

According to the latest research, the results are indeed worrying. In addition to the problem of codes being deleted after repeated modifications, the proportion of duplicate codes is also becoming more and more serious.

Since its beta version was launched, GitHub Copilot has quickly taken the AI ​​coding field by storm. According to the company's CEO Thomas Dohmke, the software has attracted more than one million paying subscription developers, effectively increasing the speed of development tasks by 55%. Additionally, 46% of the code volume in Copilot-enabled files is generated by artificial intelligence.

According to research by developer analytics company GitClear, after collecting data on 150 million lines of changed code, it was found that two-thirds of the data came from data shared anonymously by private companies, while one-third of the data came from Google, Open source projects from technology giants such as Facebook and Microsoft.

The research focuses on processing code that has been modified, updated, deleted, copied, and moved, while eliminating the "noise" predefined by GitClear, such as the same piece of code being submitted to multiple branches, blank lines, and other meaningless artifacts. lines of code.

However, GitClear's research focused on code quality rather than code quantity, and found that the AI ​​assistant mainly provided "code addition suggestions" but rarely provided code update, move or deletion suggestions.

It's not easy to accurately measure code quality. The researchers did find some trends, showing that the amount of additions, deletions, updates, and copy/pastes of code increased significantly, but the proportion of code movements decreased. They also found a significant increase in code duplication rates, from 3.3% in 2020 to 7.1% currently.

Generally speaking, code movement is an important criterion for developers when refactoring code. Specifically, it is necessary to ensure that the original functionality is not changed while improving the code design and structure.

Researchers preliminarily speculate that this trend may be related to the rapid popularity of AI coding technology, but the specific reasons still need further verification. They harshly criticized the negative effects of excessive use of copy/paste code, stating: "This mindless use of AI-generated code will have a disastrous impact on the long-term maintainability of the code."

However, over-reliance on copy-paste is not a new problem. Developers may do this because it is faster and easier to just copy and paste without having to adjust and reuse existing code. Or it could be due to miscommunication between multiple developers, or excessive plagiarism from development examples and coding Q&A websites.

GitClear researchers did not discuss specifically how to solve the problems they found, but instead turned to "follow-up research questions." However, they also suggest that engineering leaders should "monitor submitted data and consider its impact on future product maintenance."

The research may go some way to appease developers worried about being replaced by artificial intelligence tools. A recent AI code refactoring study conducted by code analysis company CodeScene also concluded that “artificial intelligence is far from being able to replace humans in coding environments.”

But what is certain is that the AI ​​coding assistant will never disappear. On the contrary, like all new tools, it will continue to be improved, and developers will learn how to optimize its ideas and improve its effectiveness. In fact, today's developers have begun to realize the importance of code quality. According to a survey report by GitHub and Wakefield Research, among programmers surveyed, when asked "What metrics should be evaluated according to when actively using artificial intelligence?", "code quality" was considered the most important. question.

Recent research shows that the negative impact of code quality on business cannot be ignored. According to these studies, typically, a company's developers waste an average of 23% to 42% of their time due to technical debt and poor code. This result is enough to attract our attention. Additionally, research on productivity losses among software developers due to technical debt points out that developers often have to introduce new technical debt because companies have been sacrificing code quality for short-term gains such as new features.

Therefore, improve the readability and maintainability of the code, focus on the robustness and performance optimization of the code, and ensure the security of the code. Code compliance with norms and best practices such as naming conventions, annotation conventions, and unified code style are still issues that developers need to overcome. In order to meet these requirements, developers need to have solid coding skills, good teamwork spirit, and use the correct AI coding assistant to help them efficiently achieve high-quality code output.

Take FuncGPT (Hui Function) launched by Feisuan as an example. It integrates years of programming on-site big data and undergoes millions of lines of code training to help developers generate high-quality, high-quality functions in real time through natural language. Readable Java function code. The generated code can be copied directly to IDEA. In terms of code quality, because FuncGPT (Hui Function) has powerful natural language processing capabilities, it can accurately understand users’ descriptions and requirements for functions, reducing development communication costs and difficulty of understanding. At the same time, because of the best practices in coding and large-scale Machine joint training reduces bugs caused by human negligence and grammatical errors, so the quality of the generated code is guaranteed. Multiple internal tests have shown that compared with large models such as ChatGPT on the market, the code generated by FuncGPT (FuncGPT) is of higher quality and is easier for developers to use directly.

At present, it is understandable for enterprises to introduce artificial intelligence auxiliary tools to achieve "cost reduction and efficiency increase", but we need to use them carefully to give full play to the advantages and avoid disadvantages. Letting AI-assisted programming better help developers requires the joint efforts of all parties.

Google donated $1 million to the Rust Foundation to improve the interoperability between Rust and C++. The web engine project "Servo", which was abandoned by Mozilla, will be reborn in 2024. The father of the Go language summarizes the success factors: the mascot is indispensable jQuery 4.0 .0 beta released open source daily: "Small but beautiful" Tauri has supported Android and iOS; Apple's open source Pkl Google Bard was renamed Gemini, free independent APP Vite 5.1 was officially released, front-end construction tool gallery system PicHome 2.0.1 released Java tool set Hutool-5.8.26 is released, I wish you all the best. The large open source model MaLA-500 is released, supporting 534 languages.
{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/4868096/blog/11013335