Skip to content

Using Example Tests for Better Test Generation

Please Notice

In JetBrains this field is called "Reference Test"

Overview

Codiumate enhances its test generation capabilities by allowing the use of example tests. This feature enables Codiumate to generate new tests that follow a specific style or format you prefer, ensuring consistency and adherence to your project's testing conventions.

Providing an Example Test

There are several ways to provide Codiumate with an example test, each designed to suit different workflows and preferences:

  1. Direct Input: Copy and paste a test you like into the "Example Test" field located in the main test tab. Once you regenerate the test suite, Codiumate will attempt to generate new tests mirroring the styling of your example.
  2. Configuration Tab: For a more permanent setup, you can add the example test to the configuration tab. Saving this to the configuration file means all future tests generated by Codiumate will use this example as a template.
  3. Automatic Detection: If no example test is provided, Codiumate will search your project for a suitable test to use as an example. The identified test will be displayed in the main test tab with a note explaining Codiumate's choice. You have the option to delete or change this test if it doesn't meet your requirements.

Benefits of Using Example Tests

  • Consistency: Ensures that all generated tests adhere to your preferred style and formatting, maintaining consistency across your test suite.
  • Customization: Gives you the flexibility to influence the structure and content of the generated tests, tailoring them to better fit your project's needs.
  • Efficiency: Saves time by automating the generation of tests that align with your existing testing practices, reducing the need for manual adjustments.

Managing the Example Test

  • Change or Remove: At any point, you can modify or remove the current example test from the main test tab to adjust Codiumate's test generation behavior.
  • Update Configuration: To change the default example test for future test generations, simply update the example test in the configuration tab and save your changes.
Footer