The Unit Test Agent is designed to help you generate test plans and unit tests for specific functions or classes in your codebase. This agent can create initial test cases and help you refine and expand your test suite.

Capabilities

  • Generate unit test plans for given functions or classes
  • Create unit test code based on the generated plans
  • Assist in adding additional test cases or assertions
  • Help improve test coverage for your codebase

How to Use

To use the Unit Test Agent, provide a reference to a function or class name using the @ symbol. You can then ask for test plans or specific test cases. Here are some example prompts:

  1. “Help me plan and write a unit test for @create_document"
  2. "Add an additional test to assert that the value returned is not null"
  3. "Generate a test plan for the @UserAuthentication class”

Best Practices

  • Clearly specify the function or class you want to test
  • Provide information about expected behavior or edge cases
  • Iterate on the generated tests, asking for modifications or additional cases as needed

By using the Unit Test Agent, you can quickly create a comprehensive suite of unit tests for your codebase, improving code quality and reducing the likelihood of bugs in your application.