Skip to main content

AutoParams is a test data generator in Java and Kotlin.

Enhance your TDD experience!

Easy to Use

Just like the @ValueSource or @CsvSource annotations, when you add the @AutoSource annotation to a parameterized test method, AutoParams automatically generates the appropriate test arguments.

Focus on What Matters

Using AutoParams in parameterized methods allows you to skip the repetitive work of constructing test data. The required test data is automatically generated, so you can focus on what really matters: your domain-specific requirements.

Enhanced Coverage

By using random values ​​instead of static data, AutoParams allows your tests to cover a wider range of cases. Each test iteration validates your application under a variety of conditions, uncovering edge cases that might not be noticed with fixed values.

A Simple Example

The automatic generation of test data by AutoParams can potentially eliminate the need for triangulation in tests, streamlining the testing process.

@ParameterizedTest
@AutoSource
void parameterizedTest(int a, int b) {
var sut = new Calculator();
int actual = sut.add(a, b);
assertEquals(a + b, actual);
}