# Traits for testing in Kotlin

DevFeed: [Traits for testing in Kotlin](<https://devfeed.tech/articles/traits-for-testing-in-kotlin-39385.md>)

Original publisher: [Read original article](<https://kt.academy/article/traits-testing>)

Published: 2021-08-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Integration testing](<https://devfeed.tech/topics/integration-testing.md>), [backend-development](<https://devfeed.tech/topics/backend-development.md>), [interface](<https://devfeed.tech/topics/interface.md>)

Tags: [backend-development](<https://devfeed.tech/tags/backend-development.md>), [integration-testing](<https://devfeed.tech/tags/integration-testing.md>), [interface](<https://devfeed.tech/tags/interface.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [testing](<https://devfeed.tech/tags/testing.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

## AI overview

This tutorial explains how to use Kotlin traits for integration testing, especially in backend applications. It presents an interface-based technique that lets traits access fake objects defined by a base integration test class.

## Source excerpt

A trick needed when using traits for testing in Kotlin.