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

Get the headvalue and tailvalue with SensitivityMutator

Open Cheng-017 opened this issue 3 years ago • 0 comments

Context

  1. When obtaining HeadValue, first determine whether the types of HeadValue and TailValue are compatible If the types are compatible, get HeadValue directly If the types are not compatible, need to further obtain the value corresponding to HeadValue (e.g. HeadValue is an Object, get Object.a. Or HeadValue is an arrayList x[], get x[i]) Corresponding testcase: getfield instruction, getstatic instruction
  2. The situation where one HeadValue corresponds to multiple TailValues Corresponding testcase: lload instruction, iload instruction
  3. The value of tailVaule in instanceof instruction is incorrectly obtained

Steps to Reproduce

1.The types of HeadValue and TailValue(e.g. getfield instruction):

  • The testcase of getfield instruction can be found in geSensitivityMutatorExample.getfieldExample()
  • Debug SensitivityMutatorTest.testGetfieldExample()
  • The input is an object:IMenuItem i,but the headValue is null
  • SensitivityMutator return false

2.The situation where one HeadValue corresponds to multiple TailValues(e.g. lload instruction )

  • The testcase of lload instruction can be found in geSensitivityMutatorExample.laloadExample()
  • Debug SensitivityMutatorTest.testLloadExample()
  • The oldTestChromosome could be like this: SensitivityMutatorExample sensitivityMutatorExample0 = new SensitivityMutatorExample(); long[] longArray0 = new long[6]; long long0 = 112L; longArray0[0] = long0; long long1 = 0L; longArray0[1] = long1; long long2 = 896L; longArray0[2] = long2; long long3 = 3008L; longArray0[3] = long3; long long4 = 0L; longArray0[4] = long4; long long5 = (-1L); longArray0[5] = long5; sensitivityMutatorExample0.laloadExample(longArray0, longArray0[4]);
  • after mutate : SensitivityMutatorExample sensitivityMutatorExample0 = new SensitivityMutatorExample(); long[] longArray0 = new long[6]; long long0 = 112L; longArray0[0] = long0; long long1 = 12L; longArray0[1] = long1; long long2 = 896L; longArray0[2] = long2; long long3 = 3008L; longArray0[3] = long3; long long4 = 0L; longArray0[4] = long4; long long5 = (-1L); longArray0[5] = long5; sensitivityMutatorExample0.laloadExample(longArray0, longArray0[4]);
  • long1 changed but the tailValue is not change.The relevantStatement should be "long long4 = 0L;"
  • SensitivityMutator return false

3.The value of tailVaule in instanceof instruction is incorrectly obtained

  • The testcase of instanceof instruction can be found in geSensitivityMutatorExample.instanceofExample()
  • Debug SensitivityMutatorTest.testInstanceofExample()
  • The oldTestChromosome could be like this: SensitivityMutatorExample sensitivityMutatorExample0 = new SensitivityMutatorExample(); String string0 = "^,!HtA~eKp9A6h[k/"; sensitivityMutatorExample0.instanceofExample(string0);
  • HeadValue is "^,!HtA~eKp9A6h[k/",tailValue is 1.In this case,the tailValue should be the same with headValue,so there is something wrong in the code
  • SensitivityMutator return false

Current Result

1.The input is an object:IMenuItem i,but the headValue is null 2.headValue "long long1 = 0L;" changed but tailValue is not change 3.HeadValue is "^,!HtA~eKp9A6h[k/",tailValue is 1.

Expected result

1.The input is an object:IMenuItem i,and the headValue should be IMenuItem.name 2.The relevantStatement should be "long long4 = 0L;",and if the headValue changed,the tailValue will change. 3,TailValue should be the same with headValue.

Cheng-017 avatar Apr 12 '21 07:04 Cheng-017