AI for PHP, How to Tweak AI Prompts to Improve PHP Tests

Generate boiler plate code and jump straight to the more interesting part of making tests.

View at original site


The article discusses how JetBrains AI Assistant can automatically generate unit tests that fit within a project. The AI Assistant can generate code and help customize the output by providing hints about the desired outcome. An example of a test for the CreateArgumentComment class is given, where the AI Assistant did not generate tests for the notification part.

The article suggests that testing the notification separately is a better approach. The AI Assistant can be further refined by using the Specify button to send additional information and prompts. It is important not to over-specify prompts and instead focus on generating code that is mostly suitable. The article also mentions that the AI Assistant learns from prompts over time. In conclusion, the AI Assistant simplifies the process of generating tests and allows developers to focus on making final tweaks.

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.