# Get started - Cover Refactor

Get started with Diffblue Cover Refactor - no download or install needed, it's integrated directly into Cover CLI and Cover Pipeline.

Diffblue Cover Refactor makes your code more testable - it suggests refactoring patches for your code that allow Diffblue Cover to create more and better tests for your project, and these suggestions can then be automatically applied to your code.

Note that this getting started topic focuses on Cover CLI - for information on using Cover Refactor with Cover Pipeline see [Cover Pipeline](/features/cover-pipeline.md).

Prefer video? No problem. Check out our getting started video.

{% embed url="<https://youtu.be/H_TCycPgf1o>" %}

## Using Cover Refactor <a href="#using-cover-refactor" id="using-cover-refactor"></a>

Diffblue Cover generates [Output Codes](/features/output-codes.md) when running `dcover create`. Each of these output codes identifies a potential issue with your environment or your code base, which could potentially be fixed automatically. Performing these fixes is the purpose of Diffblue Cover Refactor.

1. When running `dcover create` on a module, a `refactorings.yml` file is stored in the `.diffblue` directory of the module. This file contains a description of the refactorings that Diffblue Cover Refactor can perform on your code base.
2. Running `dcover refactor` applies these refactorings to your code base. You can view the code changes performed by Diffblue Cover Refactor using `git diff` or similar, and then commit them to your code base when you're happy.
3. If you run `dcover create` again after recompiling your project, Diffblue Cover will take the refactorings into account, potentially producing more and better tests for your code base.

**Note:** Steps 1 and 2 can be performed jointly using `dcover create --refactor`

## Considerations and limitations <a href="#current-limitations" id="current-limitations"></a>

* OpenRewrite Maven or Gradle plugin (and its transitive dependencies) must be available in your local Maven or Gradle mirror.
  * OpenRewrite Gradle plugin: 6.12.0
  * OpenRewrite Maven plugin: 5.28.0
* For Gradle projects, only the [Groovy DSL](https://docs.gradle.org/current/userguide/groovy_build_script_primer.html) is supported at this time.
* Cover Refactor only supports refactoring of the following. Future releases will expand this output code set.
  * Missing observers
    * [R002 - Missing observers](/features/output-codes/r-reason-codes.md#r002-missing-observers)
  * Missing dependencies
    * [E027 - JUnit Jupiter Engine not found](/features/output-codes/e-environment-codes.md#e027-junit-jupiter-engine-not-found)
    * [E052 - Missing dependency](/features/output-codes/e-environment-codes.md#e052-missing-dependency)
    * [E086 - Specified test framework not available](/features/output-codes/e-environment-codes.md#e086-specified-test-framework-not-available)
    * [E118 - JUnit Vintage Engine not found](/features/output-codes/e-environment-codes.md#e118-junit-vintage-engine-not-found)
    * [E137 - Mockito JUnit Jupiter is not configured](/features/output-codes/e-environment-codes.md#e137-mockito-junit-jupiter-is-not-configured)
  * Incompatible dependency versions
    * [E013 - Compatible launcher not found](/features/output-codes/e-environment-codes.md#e013-compatible-launcher-not-found)
    * [E053 - Unsupported dependency](/features/output-codes/e-environment-codes.md#e053-unsupported-dependency)
    * [E066 - Dependency incompatible with JDK](/features/output-codes/e-environment-codes.md#e066-dependency-incompatible-with-jdk)
    * [E119 - JUnit Vintage Engine incompatible](/features/output-codes/e-environment-codes.md#e119-junit-vintage-engine-incompatible)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cover-docs-preview.diffblue.com/features/cover-refactor/get-started-cover-refactor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
