Using Test Generation Features

There are multiple pathways to initiate test generation, catering to your workflow and preferences:

From the Chat:

  • /test-suite Command: Execute the /test-suite command on selected code within the chat interface to trigger test generation.

From the Editor:

  • For a function, class or method: Click the Test this function button above the function declaration (can be disabled from the extension settings).

  • For code snippets: Select the code you want to test. Right-click on your selection and choose Codiumate. From the dropdown menu choose Generate Tests.

  • Command Palette (VSCode): use command palettes to generate tests.

The Qodo Gen Testing tab will open.

The Advanced Panel

Upon initiating test generation, the advanced panel opens, marking the beginning of your test creation process. The panel is divided into two main sections:

List of Behaviors

The panel starts by presenting a list of behaviors detected in your selected code. Each behavior corresponds to a specific use case or functionality that your code is expected to perform, serving as a foundation for test coverage.

Read more about behaviors

Generated Tests

Following the behavior list, you will see generated tests covering a selection of the identified behaviors. These tests are designed to provide immediate value, offering examples of how each behavior can be tested.

Read more about the generated tests

Example Test

At the top of the tab, there's an Example Test field, that lets you guide the style of generated tests by providing a sample test. Insert a test in the designated field or save it in the settings. If unspecified, Qodo Gen chooses an existing project test as a template, ensuring consistency across your test suite.

Read more about example test

Next Steps

After reviewing the generated tests and behaviors, you can further refine the tests, add new tests for uncovered behaviors, or modify existing tests to better suit your project's needs. The advanced panel provides a powerful, interactive environment for enhancing your project's test coverage and ensuring the reliability of your code.

Last updated

Logo

2025 Qodo. All Rights Reserved.