# Generate Tests

To generate tests for your annotated classes, run the command:

```
welltested generate unit
```

The execution can take anywhere between 1-10 minutes to generate tests depending upon the number of methods.&#x20;

After a successful run, the tests appear in `/test` directory of your project.

> In the beginning, we recommend you generate tests in batches for the best results. Check [The Batching Rule](https://docs.welltested.ai/documentation/unit-tests/good-to-knows/the-batching-rule)

### Scope Arguments \[Optional]

You may use the scope arguments to generate tests only for a certain file, class and/or method.

Examples:

`welltested generate unit -f lib/login/repository.dart`

`welltested generate unit -c AccountsRepository -m getAllTransactions`

*-f, -c or -m* can all be used independently of each other and will narrow the scope accordingly.

### Maintaining Tests

If you make any changes to your existing functions or add new methods, you can run the same commands and welltested will auto-update the tests.&#x20;

We ensure that your tests always stay up to date with minimal maintenance efforts 🙌🏼
