Chapter 2. How AI Coding Technology Works

In this chapter, we’ll crack open the hood of AI-assisted programming tools and take a peek at what makes them tick. We’ll briefly wade through the history, take a whirl with transformer models and LLMs, and demo the OpenAI Playground. Then we’ll get some advice on how to evaluate LLMs.

Grasping what this powerful technology can and can’t do will pave the way for smarter use of AI-assisted programming tools for real-world software projects.

Key Features

The market has been buzzing about AI-assisted programming tools such as GitHub Copilot, Tabnine, CodiumAI, and Amazon CodeWhisperer. The makers of each product attempt to flaunt their own set of bells and whistles. But there’s a good chunk of capabilities these tools share. Table 2-1 summarizes some of the main features.

Table 2-1. Common functions of AI-assisted programming tools
Feature Description
Code suggestions Provides code suggestions based on comments and file context; recommends individual lines or whole functions.
Context-aware completions Offers context-aware code completions based on all or a part of the code base, as well as suggestions to aid in coding.
Test generation Analyzes code to generate meaningful tests, map code behaviors, and surface edge cases to ensure software reliability before shipping.
User–IDE interaction Automatically activates and provides guidance as users type code in the IDE; users can interact with the code through chat.
Code analysis ...

Get AI-Assisted Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.