Powered by OpenAIRE graph
Found an issue? Give us feedback
image/svg+xml Jakob Voss, based on art designer at PLoS, modified by Wikipedia users Nina and Beao Closed Access logo, derived from PLoS Open Access logo. This version with transparent background. http://commons.wikimedia.org/wiki/File:Closed_Access_logo_transparent.svg Jakob Voss, based on art designer at PLoS, modified by Wikipedia users Nina and Beao https://doi.org/10.1...arrow_drop_down
image/svg+xml Jakob Voss, based on art designer at PLoS, modified by Wikipedia users Nina and Beao Closed Access logo, derived from PLoS Open Access logo. This version with transparent background. http://commons.wikimedia.org/wiki/File:Closed_Access_logo_transparent.svg Jakob Voss, based on art designer at PLoS, modified by Wikipedia users Nina and Beao
https://doi.org/10.1007/978-3-...
Part of book or chapter of book . 2025 . Peer-reviewed
License: Springer Nature TDM
Data sources: Crossref
DBLP
Conference object . 2025
Data sources: DBLP
versions View all 3 versions
addClaim

Mocking Classes in Kotlin with Mockative

Authors: Abrahamsen, Kristian Degn; Mauro, Jacopo;

Mocking Classes in Kotlin with Mockative

Abstract

Unit testing is instrumental in enhancing code quality, documenting system behavior, and preventing regressions in contemporary software development. One of the current limitations of the most popular existing unit-testing frameworks for the Kotlin language (e.g., MockK and Mockito) is that they are inherently tied to the Java Virtual Machine (JVM), restricting their use to JVM-compatible environments. To overcome this limitation, in this paper we present an extended version of Mockative, a Kotlin-specific mocking framework designed to operate across multiple platforms beyond the JVM. While originally Mockative was limited to interface mocking, we have enhanced it to support class mocking and spying through the utilization of Kotlin Symbol Processing (KSP) and KotlinPoet libraries. We show that Mockative is a viable alternative to traditional JVM-bound frameworks, particularly in Kotlin/Native environments. Our extension can mock simple classes up to four times faster than MockK and Mockito, although it exhibits a marginal performance decline in scenarios involving classes with extensive method definitions.

Country
Denmark
Related Organizations
Keywords

Mock, Unit Testing, Kotlin

  • BIP!
    Impact byBIP!
    selected citations
    These citations are derived from selected sources.
    This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
    0
    popularity
    This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network.
    Average
    influence
    This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
    Average
    impulse
    This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network.
    Average
Powered by OpenAIRE graph
Found an issue? Give us feedback
selected citations
These citations are derived from selected sources.
This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
BIP!Citations provided by BIP!
popularity
This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network.
BIP!Popularity provided by BIP!
influence
This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
BIP!Influence provided by BIP!
impulse
This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network.
BIP!Impulse provided by BIP!
0
Average
Average
Average
Upload OA version
Are you the author of this publication? Upload your Open Access version to Zenodo!
It’s fast and easy, just two clicks!