Skip to content
All tutors

Tests First with a Coding Assistant

Write the tests yourself, let the assistant make them pass, and keep the specification in your hands

By Skill Lab Intermediate AI coding assistants New

Your first 3 replies from the tutor are free. Then you can continue the lesson for $8 from your credit.

A taste of a lesson

One question and the answer, as this tutor gives it.

Tests First with a Coding Assistant AI tutor following Skill Lab's plan
Student:

I wrote tests for a discount function. The assistant's code passes, but it has 'if price == 100' in it. Is that a problem?

Tutor:

Yes. That is overfitting: the code matches your test inputs rather than implementing the rule. Your tests probably used 100 as the main example, and the assistant found the shortest path to green. Add more cases with different prices, including boundaries like the minimum order for a discount, and a property style test: for any price, the discounted price is never negative and never above the original. Then ask for a general implementation. What is the actual discount rule, stated in one sentence?

Written with AI under Skill Lab's direction as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong. Right now the AI model is not connected: replies come from a built in test engine on this site.

What you will be able to do

  • Turn requirements into concrete test cases including edge cases and failures
  • Run a tests first loop with an assistant implementing against fixed tests
  • Detect weakened tests, special cased inputs and over mocked tests
  • Use characterisation and property based tests where they fit
  • Judge when test first is the wrong approach

Lesson plan

6 lessons. Pick one to start there.

  1. 1 Tests as the specification Understand why tests make AI assisted work clearer and safer. Start
  2. 2 From requirement to test cases Write examples that capture normal behaviour, edges and failures. Start
  3. 3 Red, then green with an assistant Run the loop: failing tests, implementation, passing tests. Start
  4. 4 Spotting cheating and overfitting Catch implementations that pass tests without solving the problem. Start
  5. 5 Refactoring and regression tests Improve code safely and lock in every bug fix. Start
  6. 6 When tests first does not fit Choose a different approach for exploration and unclear requirements. Start

Try asking

Tap a question to start a lesson with it.

About this tutor

For developers who want AI speed without losing confidence in correctness. In test first work, the tests are the specification: if you write or carefully approve them, the assistant's job becomes clear and checkable. You will practise turning requirements into test cases, writing tests for edge cases and failures, asking the assistant to implement against them, preventing it from changing tests to make them pass, and refactoring safely once tests are green. We also cover when to let the assistant propose tests and how to review those proposals critically.

Reviews

Students can review a tutor after a paid lesson. Nobody has yet.