🧠 Artificial intelligence

AI and software development: using coding assistants wisely

How to use artificial intelligence in software development: where coding assistants truly help, which errors they introduce and how to review their output.

AI-based coding assistants have quickly become one of the tools developers use most. They complete lines as you type, generate functions from a description, explain other people's code and propose tests. Used well, they speed up work considerably; used badly, they produce software that seems to work and is full of hidden problems. Method makes the difference.

What they do well

Coding assistants deliver most on tasks for which there are many similar examples in the training data and whose result is easy to verify.

  • Repetitive code. Data structures, format conversions, field validation, configuration: necessary but uncreative work.
  • Explaining existing code. Pasting an unclear function and asking what it does, line by line, is an excellent way to find your bearings in an inherited project.
  • Writing tests. Given a module, the assistant can propose test cases, including the edge cases that are often forgotten.
  • Translating between languages. Porting a script from one language to another, with the necessary review.
  • Regular expressions and queries. Compact syntax that is hard to remember, where an explanation alongside the result is invaluable.
  • Documentation. Comments, function descriptions, installation instructions.

Where they most often go wrong

Non-existent libraries and functions

An assistant may confidently propose a method that does not exist in the version of the library you use, or the name of a package that sounds plausible but has never been published. The latter is also a security risk: someone could register a package under that name to spread malicious code. Before installing any suggested dependency, check that it exists, that it is the official one and that it is maintained.

Outdated code

Models learn from code written over many years. They may therefore suggest deprecated or vulnerable approaches, such as cryptographic functions now considered weak or ways of building queries that expose you to injection.

Subtly wrong logic

The most insidious case: code that compiles, passes superficial checks and handles the common case, but fails at the margins. A loop that skips the last element, a date comparison that ignores time zones, a wrong rounding of amounts.

Lack of context

The assistant usually sees only part of the project. It may duplicate existing functions or ignore team conventions.

A reliable way of working

  1. Describe the task precisely. Language, version, available libraries, expected inputs and outputs, edge cases to handle.
  2. Ask for small steps. One function at a time is easier to verify than an entire module generated in one go.
  3. Read everything you accept. If you could not explain a line, you are not ready to include it.
  4. Write tests, or have them written, before trusting the code. Tests are the most objective way to know whether the code does what it should.
  5. Run analysis tools. Linters and security analysers catch many problems typical of generated code.
  6. Peer review. AI-produced code should be reviewed like any other, if not more carefully.
Phase AI contribution Human responsibility
Design Structural proposals, alternatives Architectural choice
Writing Draft functions, repetitive code Reading and understanding
Testing Suggested test cases Checking they cover real requirements
Review First flagging of issues Final approval

Security and confidentiality

Pasting code into an external service means sharing it with the provider. Before doing so with company code:

  • check the terms of service and whether data is used for training;
  • never include API keys, passwords, certificates or customer data found in the code or configuration files;
  • consider business plans with contractual guarantees or solutions that can be installed on your own servers.

Accepted suggestions should also be treated as external code: they may introduce vulnerabilities or reproduce fragments under licences that are not compatible with your project.

The impact on the craft

Assistants shift the weight of the work: you write less code by hand and read, verify and design more. For beginners there is a concrete risk: relying on AI without understanding, skipping the experience that lets you recognise an error. A good exercise is to use the assistant as a tutor, asking for explanations and alternatives, rather than only as a solution generator.

In short

  • Coding assistants excel at repetitive code, explanations, tests and documentation.
  • They go wrong with non-existent libraries, outdated code and faulty logic in edge cases.
  • Work in small steps, read everything, write tests and use analysis tools.
  • Do not share secrets and confidential data with external services lacking guarantees.
  • Responsibility for the code always rests with whoever integrates it into the project.
MM
Marco Marzaduri

Marco Marzaduri works in cybersecurity, digital forensics and web development. A computer science graduate, he combines rigorous technical analysis with attention to the people who use technology.

Read also