You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When class contains methods which update (mutate) class fields then UtBot sometimes may use that update value as expected value for another tested method instead of using original field value.
To Reproduce
Install UnitTestBot plugin built from main in IntelliJ IDEA
Open UTBotJava project
Set Test generation method -> Fuzzer = 100% (that's just to better illustrate the problem, similar issue with symbolic engine)
Generate tests for whole ClassWithEnum class
Run testUseGetter generated test
Expected behavior
Test passes
Actual behavior
Test fails
Screenshots, logs
Code of testUseGetter test. Return value from useGetter(null) is -1, so it fails.
Additional context
If test is generated only for useGetter method then everything is okay and test passes. That's because when UTBot generates tests for whole class it also invokes changeMutableField(StatusEnum statusEnum) methods with updates StatusEnum.READY.mutableInt value to '-2', which later used as expected value.
The text was updated successfully, but these errors were encountered:
Description
When class contains methods which update (mutate) class fields then UtBot sometimes may use that update value as expected value for another tested method instead of using original field value.
To Reproduce
ClassWithEnum
classtestUseGetter
generated testExpected behavior
Test passes
Actual behavior
Test fails
Screenshots, logs
Code of
testUseGetter
test. Return value fromuseGetter(null)
is -1, so it fails.Additional context
If test is generated only for
useGetter
method then everything is okay and test passes. That's because when UTBot generates tests for whole class it also invokeschangeMutableField(StatusEnum statusEnum)
methods with updatesStatusEnum.READY.mutableInt
value to '-2', which later used as expected value.The text was updated successfully, but these errors were encountered: