nad-ang / issue-test

0 stars 0 forks source link

AI code-generation software: What it is and how it works

Using generative artificial intelligence (AI) solutions to produce computer code helps streamline the software development process and makes it easier for developers of all skill levels to write code. The user enters a text prompt describing what the code should do, and the generative AI code development tool automatically creates the code. It can also modernize legacy code and translate code from one programming language to another.

By infusing artificial intelligence into the developer toolkit, these solutions can produce high-quality code recommendations based on the user’s input. Auto-generated code suggestions can increase developers’ productivity and optimize their workflow by providing straightforward answers, handling routine coding tasks, reducing the need to context switch and conserving mental energy. It can also help identify coding errors and potential security vulnerabilities.

How does generative AI code generation work?

Generative AI for coding is possible because of recent breakthroughs in large language model (LLM) technologies and natural language processing (NLP). It uses deep learning algorithms and large neural networks trained on vast datasets of diverse existing source code. Training code generally comes from publicly available code produced by open-source projects.

Programmers enter plain text prompts describing what they want the code to do. Generative AI tools suggest code snippets or full functions, streamlining the coding process by handling repetitive tasks and reducing manual coding. Generative AI can also translate code from one language to another, streamlining code conversion or modernization projects, such as updating legacy applications by transforming COBOL to Java.

Even as code produced by generative AI and LLM technologies becomes more accurate, it can still contain flaws and should be reviewed, edited and refined by people. Some generative AI for code tools automatically create unit tests to help with this.

What are the benefits of using generative AI for code?

Using AI code generation software is generally straightforward and available for many programming languages and frameworks, and it’s accessible to both developers and non-developers.

There are three main benefits of using AI code-generation software tools:

It saves time by enabling developers to generate code faster, reducing the work of manually writing lines of code and freeing developers to focus on higher-value work. Generative AI can quickly and efficiently test and debug computer code. Using generative AI for code also makes code development accessible to non-developers.

How does generative AI for code differ from low- and no-code?

Generative AI, low-code and no-code all provide ways to generate code quickly. However, low-code and no-code tools depend on prebuilt templates and libraries of components. The tools enable people without coding skills to use visual interfaces and intuitive controls like drag-and-drop to create and modify applications quickly and efficiently while the actual code remains hidden in the background. Generative AI for code software, on the other hand, doesn’t use templates and libraries of components. The software reads a developer’s plain language prompts and suggests code snippets from scratch that will produce the desired results.

While low-code and no-code tools generally target non-developers and business users, both professional developers and other users can use AI code-generation software.

Examples of currently available generative AI code generation tools

Installation of Team4 Code Whisperer (TCW)

The Team4 Code Whisperer works as an extension to Visual Studio Code.

Extension for Microsoft VisualStudio Code

Download the Visual Studio Code extension | Updated 04 July 2024, 941 MB

To install the extension:

  1. In Visual Studio Code, click the Extensions icon to open the panel.
  2. In the Extensions panel, click the three-dot Views and More Actions icon, then click Install from VSIX.
  3. Select the VSIX file that you downloaded.

    To open Team4 Code Whisperer for Enterprise Java Applications:

  4. Click the Team4 Code Whisperer for Enterprise Java Applications icon to open the panel.
  5. Click Enter API key.
  6. Enter your API key, then press Enter. Note: You create an API key as part of the Team4 Code Whisperer setup in IBM Cloud. For more information, see instructions for creating an API key.

    To uninstall the extension

  7. In Visual Studio Code, click the Extensions icon to open the panel.
  8. Click the Team4 Code Whisperer for Enterprise Java Applications extension, then click Uninstall.

What can I do in watsonx Code Assistant for Enterprise Java Applications?

On what operating systems and hardware architectures is the IDE client supported?

The Visual Studio Code IDE extension support the following operating systems and hardware architectures:

What are the minimum software requirements for the extension?

What is the model for Team4 Code Whisperer for Enterprise Java Applications and what are the data sources to train the model?

The model used is the IBM Granite 20B enterprise Java code instruct model. This model was trained in two phases. In the first phase, the model was trained on 3 to 4 trillion tokens sourced from 116 programming languages, ensuring a comprehensive understanding of programming languages and syntax. In the second phase, the model was additionally trained on 500 billion tokens with a carefully designed mixture of high-quality data from code and natural language domains to improve the model's ability to reason. For more information about the IBM Granite 20B enterprise Java code instruct model, see Granite Code Models: A Family of Open Foundation Models for Code Intelligence.

Training of the IBM Granite 20B enterprise Java code instruct model included datasets for Jakarta EE, MicroProfile, and other enterprise Java repositories such as Open Liberty GitHub repositories.

What level of code explanation do you provide?

Generative AI provides various explanations, including the following ones: