Generative AI

Code Generation

Write, complete and refactor source code from intent

Generation Code Intermediate Mature
Capability type
Generation
Modality
Code
Typical input
Instruction + repository context
Typical output
Source code / diff
Measured by
pass@1

Overview

Code generation applies language modelling to programming languages. Because code has strict syntax and testable behaviour, output can be verified automatically — which is why this capability moved from novelty to daily tooling faster than most others.

How it works

Models trained on large public code corpora predict the next token given the open file, related files, and the instruction. Modern coding tools add retrieval over the repository, run the test suite, read the failure, and iterate — turning one-shot completion into a short agentic loop.

Supported AI tools

Support level is recorded per tool, so an integration is never shown as a built-in feature.

Use cases

Inline completion

Suggest the next lines as a developer types, using the open file and imports as context.

Software

Test generation

Produce unit and edge-case tests for existing functions to raise coverage quickly.

Software

Framework migration

Mechanically translate a codebase between versions or languages with human review.

Software

Code explanation

Summarise what an unfamiliar module does before changing it.

Software

Benefits

  • Removes boilerplate and glue-code drudgery.
  • Explains unfamiliar code faster than reading it cold.
  • Generates test cases and edge cases developers skip.
  • Speeds migration work across languages and framework versions.

Limitations

  • Confidently produces code that compiles but is subtly wrong.
  • May reproduce insecure patterns present in training data.
  • Struggles with large, idiosyncratic private codebases without retrieval.
  • Licensing of generated snippets is still legally unsettled.

What to look for when choosing a tool

  • Repository-wide retrieval, not just open-file context
  • Explicit training opt-out in the contract
  • IDE and CI integration that fits your workflow
  • Self-hosting option if your code cannot leave your network
  • Licence-attribution scanning for generated snippets

FAQ

Is AI-generated code safe to ship?
Not without review. Treat it exactly like a pull request from a fast but junior contributor: read it, run the tests, and check anything touching auth, money or user data especially closely.
Will it work on a large private codebase?
Only if the tool can retrieve from your repository. Completion quality on a big proprietary codebase depends far more on retrieval quality than on raw model size.
Does my code get used for training?
That varies by vendor and plan. Business and enterprise tiers usually contractually exclude your code from training — verify it in writing before connecting a private repository.