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

Get the headvalue and tailvalue with SensitivityMutator #250

Open
Cheng-017 opened this issue Apr 12, 2021 · 0 comments
Open

Get the headvalue and tailvalue with SensitivityMutator #250

Cheng-017 opened this issue Apr 12, 2021 · 0 comments

Comments

@Cheng-017
Copy link
Collaborator

Cheng-017 commented Apr 12, 2021

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~eKp9A6�h[k/";
    sensitivityMutatorExample0.instanceofExample(string0);
  • HeadValue is "^,!HtA~eKp9A6�h[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~eKp9A6�h[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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant