evosuite-plus-plus icon indicating copy to clipboard operation
evosuite-plus-plus copied to clipboard

Potential issue with test code statement generation in ConstructionPathSynthesizer

Open darienchong opened this issue 3 years ago • 0 comments

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 InstanceFieldVariableWrappers 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.]

  1. Run the methods (firstExample, secondExample) in debug mode.
  2. Observe the test case statement generation in ConstructionPathSynthesizer (possibly using breakpoints at/near the while condition e.g. at L169 ofConstructionPathSynthesizer)
  3. 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 a this variable.
  4. Test case does not contain relevant statements to get the desired field.

darienchong avatar Mar 01 '22 10:03 darienchong