Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calls to Kotlin autogenerated setter isn't changed to direct property access for tests from fuzzer #1241

Closed
volivan239 opened this issue Oct 26, 2022 · 0 comments · Fixed by #1243
Assignees
Labels
comp-codegen Issue is related to code generator comp-fuzzing Issue is related to the fuzzing ctg-bug Issue is a bug lang-kotlin Issue is related to Kotlin language support

Comments

@volivan239
Copy link
Collaborator

volivan239 commented Oct 26, 2022

Description

Fixes from #1002 seems not to work properly if the model is produced by fuzzer.

To Reproduce

Launch action on the following class (use only fuzzer):

class Example() {
    var x: Int = 3
    fun f(): Int {
        return x
    }
}

Expected behavior

Tests are generated properly.

Actual behavior

Incorrect tests with calls to .setX() are generated.

Visual proofs (screenshots, logs, images)

Example of generated test:

@Test
@DisplayName("f: arg_0 = Example() -> return 1409199696")
fun testF() {
    val example = Example()
    example.setX(1409199696)
    
    val actual = example.f()
    
    assertEquals(1409199696, actual)
}

Environment

Test generation method -- Fuzzing 100%

@volivan239 volivan239 added ctg-bug Issue is a bug comp-codegen Issue is related to code generator comp-fuzzing Issue is related to the fuzzing labels Oct 26, 2022
@volivan239 volivan239 self-assigned this Oct 26, 2022
@korifey korifey moved this to Todo in UTBot Java Oct 26, 2022
@alisevych alisevych added the lang-kotlin Issue is related to Kotlin language support label Oct 28, 2022
EgorkaKulikov pushed a commit that referenced this issue Nov 1, 2022
…zzer #1241 (#1243)

Replace Kotlin setters with direct property access for models from Fuzzer
Repository owner moved this from Todo to Done in UTBot Java Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-codegen Issue is related to code generator comp-fuzzing Issue is related to the fuzzing ctg-bug Issue is a bug lang-kotlin Issue is related to Kotlin language support
Projects
Archived in project
2 participants