AI for PHP, How to Make AI Assistant Generate Test Implementations

Take a more test-driven-development approach, writing tests first, and having AI Assistant generate an implementation.

View at original site


This article explores how to use JetBrains AI Assistant to generate code implementations based on written tests. Instead of starting with an implementation and generating tests, this approach follows a test-driven development (TDD) approach where tests are written first.

The article demonstrates how to use AI Assistant to generate an implementation by opening the AI Actions menu, selecting "New Chat Using Selection," and providing a prompt to write an implementation for a test. AI Assistant quickly generates the implementation, which can be copied into a file and tested.

The article also explains how to save and reuse custom prompts for future use. The author acknowledges that AI Assistant may not write perfect code, but it is useful for generating boilerplate code and saving time. While AI may not replace real programmers, it is a helpful tool for accelerating the coding process.

Related Resources

7 Things You Didn’t Know about AI Assistant Chat
7 Things You Didn’t Know about AI Assistant Chat
Discover 7 things you might not know about using JetBrains AI Assistant Chat.
7 Ways AI Assistant Can Help You with Version Control
7 Ways AI Assistant Can Help You with Version Control
Let's look at ways that JetBrains AI Assistant can help you work with version control.
The Problem of Understanding Code is Solved: AI Assistant to the Rescue
The Problem of Understanding Code is Solved: AI Assistant to the Rescue
Let's look at using JetBrains AI Assistant to help you understand existing code.