Eugen Martynov
06/30/2026, 7:05 AMEugen Martynov
06/30/2026, 7:19 AMval DB = testFixture{} but should be fun TestScope.DBFixture() = testFixture{}Eugen Martynov
06/30/2026, 8:22 AMOliver.O
06/30/2026, 8:48 AMEugen Martynov
06/30/2026, 8:50 AMEugen Martynov
06/30/2026, 8:51 AMOliver.O
06/30/2026, 8:55 AMEugen Martynov
06/30/2026, 9:03 AMtest("Name") requires more to read test name. I feel I need to add more empty lines and move extensions to make things lighter. I will also check projects that use Test Balloon for ages to learn writing style there.Eugen Martynov
06/30/2026, 9:03 AMEugen Martynov
06/30/2026, 9:15 AMOliver.O
06/30/2026, 10:20 AMtest("Get new resources - all entries are ordered by publish date description") {
is more efficiently processed than
@Test
fun getNewsResources_allEntries_areOrderedByPublishDateDesc() = runTest {
Code size differences become more pronounced with parameterization.
But for sure, with reasonably-sized efforts, we can only get close to actual perception. Ideally, we'd have a "treatment" group (TestBalloon), a control group (JUnit), measure time spent on comprehension, and then measure the actual level of comprehension.
And yes, habits matter a lot, like on the web where we routinely skip ads appearing in the usual places.Eugen Martynov
06/30/2026, 12:23 PMEugen Martynov
06/30/2026, 12:24 PMOliver.O
06/30/2026, 12:50 PMBen Liblit
06/30/2026, 2:17 PMval DB = testFixture{} but should be fun TestScope.DBFixture() = testFixture{}
Also keep in mind that "If a fixture's value is an AutoClosable, the fixture will use its close() method, without requiring closeWith." [docs]
I sometimes find that my test fixtures are cleanest when defined as instances of AutoCloseable-implementing classes. The class implementation can be arbitrarily long and complex, but implemented separately from the tests that use it, just like you'd do with any other class that you wanted to reuse in multiple places. Instantiating and using a fixture is then as simple as:
... by testSuite {
testFixture { MyFixture() } ...
}
Note in particular the absence of `closeWith`: fixture shutdown code is hidden away in `MyFixture`'s close() method.