# Instantiate test data with Instantiator

DevFeed: [Instantiate test data with Instantiator](<https://devfeed.tech/articles/instantiate-test-data-with-instantiator-25469.md>)

Original publisher: [Read original article](<https://hannesdorfmann.com/instantiator/>)

Author: Hannes Dorfmann

Published: 2022-08-05T09:00:00Z

Content type: tutorial

Language: en

Sources: [Hannes Dorfmann](<https://devfeed.tech/sources/hannes-dorfmann.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [unit test](<https://devfeed.tech/topics/unit-test.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Android](<https://devfeed.tech/topics/android.md>), [data](<https://devfeed.tech/topics/data.md>), [Library](<https://devfeed.tech/topics/library.md>), [Tool](<https://devfeed.tech/topics/tool.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [data](<https://devfeed.tech/tags/data.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [library](<https://devfeed.tech/tags/library.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tool](<https://devfeed.tech/tags/tool.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

## AI overview

The article introduces Instantiator, a Kotlin library that uses reflection to fill objects with random test data. It is presented as a way to reduce the effort of creating test data for unit tests involving transformed backend data, pagination, and nested data classes.

## Source excerpt

I have noticed that most of the unit tests I write are testing how my code transforms data or business logic. My class or business logic just needs data as input (thus I need some test data to write unit tests). For example, most of my android apps load a list of items from the backend and then the android app is transforming that data into some state object or front-end specific domain objects.