code-philia / microbat

A feedback-based debugger for interactively recommending suspicious step in buggy program execution.
3 stars 2 forks source link

Static Analysis of Definition Inference #53

Open Weiyu-Kong opened 5 days ago

Weiyu-Kong commented 5 days ago

Observation

In " microbat.tracerecov.executionsimulator.ExecutionSimulator.estimateComplication( )", we have the input:

but it seems that this method (estimateComplication( )) only checks the first item of invokedMethods which is "java.lang.Integer#valueOf(I)Ljava/lang/Integer;" and return "GUARANTEE_NO_WRITE" after executing " candidateVarVerifier.getVarWriteStatus("size", "java.lang.Integer") ". image

Besides, when we check the method "java.util.List#add(Ljava/lang/Object;)Z" ("List" instead of "ArrayList"), the cfg will not be constructed ( cfg == null ) and the method returns "NO_GUARANTEE".

Possible solutions

  1. Consider all invoked methods
    • GUARANTEE_WRITE has the highest priority which means if there is a method leads to GUARANTEE_WRITE , the result is GUARANTEE_WRITE .
    • And probably GUARANTEE_WRITE > NO_GUARANTEE > GUARANTEE_NO_WRITE.
  2. Transfer from base class to derived class to successfully construct cfg ("List" --> "ArrayList").