Tongyi Lingma Practical Series: How to quickly start a new project and how to maintain the legacy system code base?

Author: Bie Xiang

Entering 2024, the popularity of AI continues to rise. Reading through the articles in the science and technology area, AI can be said to be twelve volumes of military books, each with its own name. A recent McKinsey research report shows that software engineering is one of the fields with the greatest impact of AI. AI has become a must for software engineering. Some studies also say that developers may account for about 70% of their daily transactional work, such as unilateral writing. Wait, and this part happens to be what AI is good at. Allowing large models to assist engineers in speeding up coding and improving quality allows us to focus more on the remaining 30% of business and technical innovation.

In daily work, we often hear some complaints and pain points from engineers. For example, writing unit tests is time-consuming; taking over a new code base, some ancestral codes are relatively expensive to understand; troubleshooting requires jumping to some browsers to find information, and it is difficult to find appropriate answers, which makes you feel overwhelmed. As an intelligent coding researcher and developer, this time I was finally able to give Hua Tuo an intravenous drip, and the doctor healed himself.

To sum up, developers have three main demands: 1) Quick coding, quick problem solving, and quick completion of requirements. 2) Reduce IDE pop-ups and enjoy immersive flow. 3) Reduce repeated coding and eliminate language restrictions.

For example, if I want to make a web page, although I don't know the front-end, with the help of large models, it can help me write HTML and JS code, so that I can focus more on business implementation and innovation. In a nutshell, developers only come to the IDE to do three things: write code, write code or write code. Tongyi Lingma helps developers improve quality and efficiency in the form of a coding assistant.

The core functions of Tongyi Lingma include row-level/function-level automatic continuation, natural language coding, comment generation, unit test generation, code explanation, code optimization, exception reporting, intelligent troubleshooting, technical document search, etc. At the same time, it also provides enterprise-specific capabilities, such as report display and various deployment forms of private clouds.

Tongyi Lingma supports more than 200 mainstream programming languages ​​​​such as Java, Python, and Go. It is currently available in the plug-in market of VS Code and JetBrains Family Bucket IDE. Visual Studio, which is highly requested by everyone, will also be launched next month, and The remote development modes of these IDEs are also supported, such as Remote, SSH, WSL, etc.

Generally speaking, Tongyi Lingma is developed based on the Tongyi large model, combined with massive open source knowledge and Alibaba Cloud's Document SDK, thus having the core capabilities of upper-level code completion and research and development of question and answer. The upper level is our engineering side, such as question and answer intent recognition, user habit learning, Prompt engineering, cross-file learning, etc. From the basic model to the model in the vertical field, and then to the overall simultaneous construction of core capabilities on the end side, we can use the Tongyi Lingma product on the IDE.

Demonstration of Tongyi Lingma ability

Some classmates will ask, but what you learn on paper is ultimately shallow, can you do some practical practice?

01/ Create a new project using Spring Boot

Next, we will use Spring Boot to create a new project as a case to show everyone the capabilities of Tongyi Lingma. First, we asked Lingma: How to write a Web program for uploading and downloading photos through Spring Boot? The spirit code will react immediately and start to be generated. First, write the XML file of Spring Boot and some data structure configuration files, and then write the controller layer, service interface and service implementation class. You will see that the speed of AI code writing is very fast. , and the idea is very clear, knowing what files and steps are needed, and how to deploy the Web service.

We can interact with Lingma through question and answer anytime and anywhere. If you are not satisfied with its answer in any way, or you want Lingma to expand some more general codes and let it continue writing, or you encounter some kind of error or special request to find a solution, etc., You can further communicate with Lingma by asking questions. Lingma will be happy to help you during the question and answer process.

For example, I asked if there are any examples of storage through memory database instead of using mysql database. Lingma can understand what I mean and provide a redis solution for this storage.

02/ Maintain legacy system code base

Another common scenario is that as engineers we often maintain an old system left by others, which may also contain some ancestral code . Then Lingma's ability to predict the task of interpreting codes can be better reflected.

For example, there is a piece of code like this. There are many if elses and it is quite messy. We can click on a shortcut entry above the method and let Lingma explain it. We have a design here, that is, Lingma will first give a relatively short  high-level explanation to help developers understand the meaning of this code faster. If developers want a more specific explanation, they can use the question button below to get a more detailed answer. The English system is called in detail , and Lingma will give a more specific explanation.

Unit testing is also a common topic. Everyone knows that unit testing is good, but not many can actually do it. Unit testing can improve the maintainability of the code, make the code more robust, and can be better maintained when others take over, but the daily development needs of engineers will be greater.

Objectively speaking, single testing is definitely a relatively time-consuming thing in the short term, but many developers tend to pursue short-term convenience and abandon long-term benefits. Lingma can help engineers write unit tests more quickly, improve unit test coverage, and improve the maintainability of the code base.

Code optimization is also a high-frequency scenario. There have been many requests from users in the past, hoping to have such a capability. Users can right-click the box or click the shortcut entry above the method to trigger code optimization. But objectively speaking, code optimization is a very broad term. It designs style optimization, defect repair, program reconstruction, security optimization, etc. Therefore, we are also doing our best to improve the model capabilities of code optimization so that developers can have higher code quality.

Finally, let’s introduce our running debugging error troubleshooting capabilities. When the IDE encounters some runtime errors, Lingma will provide a one-click troubleshooting function in the error stack. After clicking the one-click troubleshooting button, Lingma will automatically collect the error stack and locate the context of the error code. Help users generate a prompt for error reporting to ask questions about the model and seek solutions. This function is currently released in IDEA and Java, and will be released in various terminals and languages ​​in the future.

Product highlights and advantages of Tongyi Lingma

First of all, Tongyi Lingma products pay special attention to the experience of developers, and developers are our users. We have made a lot of efforts in interaction design for the IDE's native visuals to fit developers' usage habits. At the same time, during the coding process, the completion triggering timing, length selection, model speed and other aspects have been processed to help developers have a coding flow experience.

Mr. Zhu Xi once said that there are three ways to read, namely from the heart to the eyes to the mouth. For the spirit code, to generate it accurately, you need:

  • The first is to cultivate inner skills, build powerful models, and learn more high-quality data, such as some of Alibaba Cloud's own SDKs and OpenAPIs.
  • The second is the prompt word project, which uses carefully crafted prompt words to cooperate with model training to double the generated effect.
  • The third is to look at six ways. For example, if a real developer wants to write the next line of code correctly, he not only needs to look at the context of the current file, but also needs to know some cross-file information, such as calling a method in another file, which can reduce some illusions. Problems arise.

The most important thing is the security and controllable factors that developers are more concerned about. During the generation process of Tongyi Lingma's large model, all code data will only be used for model inference, and no storage will be done in the middle, let alone training. At the same time, we also provide two models, one is a large cloud model, and the other is a small model that runs purely locally, without Internet access and with high speed. These two models support one-click switching to meet our coding needs under different network environments and different completion strength requirements.

Click here to quickly experience Tongyi Lingma

The Google Python Foundation team was laid off. Google confirmed the layoffs, and the teams involved in Flutter, Dart and Python rushed to the GitHub hot list - How can open source programming languages ​​and frameworks be so cute? Xshell 8 opens beta test: supports RDP protocol and can remotely connect to Windows 10/11. When passengers connect to high-speed rail WiFi , the "35-year-old curse" of Chinese coders pops up when they connect to high-speed rail WiFi. MySQL's first long-term support version 8.4 GA AI search tool Perplexica : Completely open source and free, an open source alternative to Perplexity. Huawei executives evaluate the value of open source Hongmeng: It still has its own operating system despite continued suppression by foreign countries. German automotive software company Elektrobit open sourced an automotive operating system solution based on Ubuntu.
{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/3874284/blog/11067038