Some¶
A Kotlin test data generation library for JVM and Android tests, with optional Kotest Arb integration.
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.
@Test
fun `validate user welcome email`() {
val user = User(
name = "John Doe",
age = 30,
email = "[email protected]",
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)
)
)
val email = emailService.sendWelcome(user)
assertEquals("Welcome, John!", email.subject)
assertEquals("[email protected]", email.to)
}
Some eliminates boilerplate by generating fully populated instances of any Kotlin class with a single function call.
Features¶
- Zero configuration —
some<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.
- Extensible — Ship custom
ResolverProviderimplementations discovered viaServiceLoaderto add support for domain-specific, third-party, or internal application types — with custom strategies and no consumer configuration required. - Deterministic by choice — Set a seed for reproducible test data across runs, or default to random for variation.
Modules¶
Some is published as three user-facing artifacts:
some-corefor Java and Kotlin/JVM projects.some-androidfor Android projects. It re-exports the shared core API, so you do not need to addsome-coreseparately.some-kotestfor KotestArbintegration. Add it alongside eithersome-coreorsome-android.
Use Getting Started to install Some and learn the shared API.
Artifact rename¶
Artifact rename
We renamed the JVM artifact from dev.appoutlet:some to dev.appoutlet:some-core.
See the 0.2.1 to 0.2.2 migration guide for the upgrade steps.
Quick start¶
import dev.appoutlet.some.some
data class User(val name: String, val age: Int)
val user: User = some<User>()
// User(name=hjklmnoq, age=42)
See the Getting Started guide for installation, configuration, and advanced usage.
Roadmap¶
Some is under constant development. Releases are managed and tracked in the public GitHub Project, which is the canonical source for what is planned, in progress, and shipped.
Consult the project board to see what is actively being worked on, what is planned for upcoming releases, and what has been released.
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.