Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 1.13 KB

File metadata and controls

32 lines (25 loc) · 1.13 KB

Examples to use for TDD or Test-First with AI

Try them out with JetBrains AI Assistant or JetBrains Junie coding agent.

Example 1: FizzBuzz

With AI Assistant

  • Open file FizzBuzzTest
  • Open AI Assistant chat
  • Ask AI Assistant: "Implement code that passes the tests"
  • Make sure the file is attached to the prompt
  • Copy the provided code to the right location
  • Run tests

With Junie

  • Ask Junie: "Implement code that passes the tests in FizzBuzzTest.java"
  • Click "Run tests" when Junie asks to run the tests

Example 2: Calculator

With AI Assistant

  • Open file CalculatorTest
  • Open AI Assistant chat
  • Ask AI Assistant: "Implement code that passes the tests"
  • Make sure the file is attached to the prompt
  • Copy the provided code to the right location
  • Run tests Note: Since this example requires multiple classes/files to be created, AI Assistant isn't always able to solve it.

With Junie

  • Ask Junie: "Implement code that passes the tests in CalculatorTest.java"
  • Click "Run tests" when Junie asks to run the tests