https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
x

xxfast

04/27/2021, 9:10 AM
androidAndroidTest
.. ha
s

Sebastian Sellmair [JB]

04/27/2021, 10:12 AM
Unfortunate naming. {targetName}{android source set name} targetName = ‘android’ android source set name = ‘androidTest’ Will be solved in a some bright future, that we’re actively working on!
👍 2
x

xxfast

04/27/2021, 10:15 AM
understandable 🙂 i think android should’ve gone with
instrumentationTest
similar to ios
j

jw

04/27/2021, 12:27 PM
it was originally called that and was changed to androidTest in the very very early AGP 0.x days
Looks like it was instrumentTest. I misremembered. In 0.9.0 notes http://tools.android.com/tech-docs/new-build-system
🙌 1
j

jw

12/28/2022, 10:14 PM
Oof that's a bad change
Unit is a type of test, instrumented is a mechanism
You can run unit tests within instrumentation
JVM test or host test describe the execution mechanism similar to what instrumented describes
Your host-side tests may also not be unit tests but functional or integration tests
x

xxfast

12/29/2022, 8:45 AM
Looks like another issue for #naming
s

Sebastian Sellmair [JB]

12/29/2022, 6:02 PM
Kotlin Multiplatform just follows the naming schema from Android. Inventing just another terminology would be the worse option.
The naming change also fixes issues under the hood, where names were wrongly clashing.
@jw just out curiosity: if you would be the AGP team: how would you name the source sets?
j

jw

01/04/2023, 12:59 AM
Instrumented is a good word, but not well defined for an average developer. I'd wager most don't know the instrumentation class in the Android SDK or what it's function is. It's also complicated by Robolectric running instrumentation. I tend to say host vs. device. Both are words people should be able to understand. Device covers physical and emulator pretty well, but fails on Chromebooks where the host is effectively also the device. That's rare enough that I'm okay with it (and most developers probably understand Android apps run in an emulator-like simulator on Chromebooks so still kinda works) Host isn't perfect but it has the benefit of being short. The ideal name for host is really jvmTest, or androidJvmTest in MPP. The ideal name for device is dalvikTest or artTest. The problem with these ideal names is that they're jargon you probably don't know when you're getting started, so there's an ordering problem for learning. That's why when I talk about tests I use host and device, and it would be my vote.
Maybe we can @-mention Xav tomorrow and get his take? I remember being involved on adt-dev@ list when they switched from instrumentTest to androidTest as well.
15 Views