evosuite-plus-plus
evosuite-plus-plus copied to clipboard
Potential issue with test code statement generation in ConstructionPathSynthesizer
Context
When running EvoObj on the two methods indicated in shell/src/test/java/feature/objectconstruction/testgeneration/testcase/IncompleteOcgTest.java
, there is some odd behaviour that occurs when processing certain InstanceFieldVariableWrapper
nodes in the Object Construction Graph (OCG) to produce test case statements. The DepVariableWrapper
nodes obtained from the targetVariable
for that node are ThatVariableWrapper
, and not InstanceFieldVariableWrapper
s as expected.
Steps to Reproduce
Please break down here below all the needed steps to reproduce the issue. [If possible, please upload an example of the project you are generating tests for.]
- Run the methods (
firstExample
,secondExample
) in debug mode. - Observe the test case statement generation in
ConstructionPathSynthesizer
(possibly using breakpoints at/near thewhile
condition e.g. at L169 ofConstructionPathSynthesizer
) - Tracing the execution, note how on processing the second/third nodes of the OCG a
ThisVariableWrapper
node is processed for a node in the OCG that does not correspond to athis
variable. - Test case does not contain relevant statements to
get
the desired field.