Skip to content

MessiasLima/Some

Some logo

Some

Maven Central Version

A Kotlin JVM library that generates populated instances of any Kotlin class for testing purposes, with zero configuration required.

The Problem

Writing tests means creating test data — lots of it. Constructing data classes, populating fields with dummy values, and keeping dependencies consistent is tedious and error-prone. As your model grows, so does the boilerplate.

// Without Some
val user = User(
    name = "John", age = 30,
    email = "john@example.com",
    address = Address(street = "123 Main St", city = "Springfield", zipCode = "12345"),
    orders = listOf(Order(id = "ord-1", amount = 99.99), Order(id = "ord-2", amount = 49.50))
)

// With Some
val user = some<User>()

Some eliminates boilerplate by generating fully populated instances of any Kotlin class with a single function call.

Features

  • Zero configurationsome<T>() generates a complete instance right out of the box. No builders, no factories, no setup.
  • Universal type support — Works with data classes, sealed classes/interfaces, object singletons, value classes, generics, and all standard collections. If Kotlin can represent it, Some can generate it.
  • Nested and recursive structures — Handles deeply nested data classes, circular references, and recursive sealed class hierarchies without infinite loops.
  • Fine-grained control — Override how specific fields are generated: control nullable probability, string format, collection sizes, register custom type factories for types, or use property factories for individual fields.
  • Deterministic by choice — Set a seed for reproducible test data across runs, or default to random for variation.

Installation

Add Some to your Gradle dependencies:

testImplementation("dev.appoutlet:some:<latest-version>")

Documentation

📖 Read the full documentation at some.appoutlet.dev for installation, configuration, and advanced usage.

Contributing

Interested in helping improve Some? Contributions are welcome. Please read the contributing guide to learn how to set up the project, run the checks, and prepare a good contribution.

License

Some is open source and available under the Apache 2.0 License.


A Project by AppOutlet

Some is developed and maintained by AppOutlet.

You can explore our other projects on our website.

About

Zero-config Kotlin fixture library. Generate test instances of any class with some<MyClass>()

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors

Languages