Coding with an AI Assistant: Prompts, Review and Tests

Coding with an AI Assistant (Prompts, Code Review) is a beginner-level course of 5 lessons (about 2 h 30 min), with 15 exercises and 15 quiz questions. Prerequisites: Programming Basics and Algorithms. Exercises run in the browser, with nothing to install.

  • Foundations
  • Beginner
  • 5 lessons
  • 2 h 30 min
  • 15 exercises
  • Exercises run in the browser

The course in brief

AI assistants are now part of the daily routine of developers and analysts. This course teaches you to write precise requests, to review and test generated code, to debug methodically, and to avoid security and privacy pitfalls. You stay in control of your code while saving time.

What you will be able to do

  • Explain how a coding assistant works and what its limits are, including hallucinations
  • Write structured prompts with context, constraints and examples
  • Review generated code with a checklist and fix classic bugs
  • Write tests that catch errors and debug from a traceback
  • Protect secrets and personal data and avoid vulnerabilities such as SQL injection
  • Use AI as a tutor to make progress rather than to bypass learning

Syllabus: 5 lessons

    • Explain in simple terms how a coding assistant generates a response
    • Identify its strengths and limits, including hallucinations
    • Adopt the mindset of a developer who is responsible for their code

    Language model (LLM)HallucinationsContext window

  1. 02

    Writing a Good Prompt for Code

    15 min
    • Structure a request with context, goal, constraints and examples
    • Specify expected inputs and outputs
    • Iterate and break down a complex request

    Prompt writingSpecification by example

  2. 03

    Reviewing Generated Code

    20 min
    • Apply a systematic review checklist
    • Spot the classic bugs in generated code
    • Simplify overly complex code

    Reviewing generated codeEdge cases

  3. 04

    Testing and Debugging with AI

    20 min
    • Write assert tests that cover normal and edge cases
    • Have the AI generate tests and verify them
    • Debug effectively by providing the right context

    Automated testsDebugging

  4. 05

    Responsible Use: Security, Data and Learning

    20 min
    • Protect secrets and personal data when using an assistant
    • Spot common security flaws in generated code
    • Use AI to learn rather than to bypass learning

    Security of generated codeData privacyResponsible use

Final project

Develop a Small Module with an AI Assistant, Traceably

Choose a small need (shipping cost calculation, analysis of a list of sales, validation of a sign-up form) and develop it in Python with the help of an AI assistant. Document your process: prompts used, responses obtained, problems detected during review, tests written and fixes made.

Deliverables

  • The final Python module, with documented functions
  • A test file (assert or pytest) covering normal, edge and invalid cases
  • A logbook listing at least 3 prompts, their summarized responses and the iterations
  • A completed review checklist pointing out at least 2 problems found in the generated code and their fixes

Assessment criteria

  • Prompts are structured (context, goal, examples, constraints, format)
  • Tests are written from the specification and fail on a deliberately buggy version
  • The final code contains no secret, no vulnerable query and no unverified dependency
  • The author can explain every line of the final code
  • The logbook shows a critical eye on the AI's suggestions

Frequently asked questions

Can you learn to program using AI?

Yes, as long as you use it as a tutor: try on your own first, ask for explanations and hints, then verify and test. This course teaches exactly these habits.

Is this course tied to a particular AI assistant?

No. The methods presented (structured prompts, review, tests, security) apply to all coding assistants, whether they are built into the editor, used through chat, or run as agents.

Is AI-generated code reliable?

It is often correct on simple cases but can contain off-by-one errors, forgotten edge cases, invented functions or security flaws. It must always be reviewed and tested.

What are the prerequisites?

The basics of Python programming (variables, conditions, loops, functions), covered by the Programming Fundamentals and Algorithmics course.

This course, told for your job

Say what you want to be able to do: “Coding with an AI Assistant (Prompts, Code Review)” takes its place in your path, with examples from your field. The concepts stay those of the course.

The preview is free, and you can take the courses one at a time without paying. The path only contains lessons from the catalogue.