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

By generating the boring boilerplate code, it allows us to jump straight into the more interesting part of making our tests.

View at original site


Author: Brent Roose

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

Full Line Code Completion in JetBrains IDEs, All You Need to Know
What is full line code completion is, how does it work, what languages are supported, and how can you get started
Local and Fast AI comes to your developer workflow - Full Line Code Completion
Full line code completion is available for Java, Kotlin, Python, JavaScript, TypeScript, CSS, PHP, Go, and Ruby.
Stop using LLMs for these tasks!
Discover the ins and outs of large language models (LLMs) with Dr. Jodie Burchell.