llmhyy / microbat

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

[Mutation] Provide New Mutation Function #40

Open llmhyy opened 6 years ago

llmhyy commented 6 years ago

Generate mutated traces on a given open source project. For now, we can use Apache Math (https://github.com/llmhyy/apache-common-math-2.2). We can start the new code in microbat_trace_predication project.

After running a passed test case, we will have a list of code covered by that test case. We are going to apply three mutations on the covered code: (1) remove a nested if-brackets, (2) remove a if-return block, and (3) remove a variable definition. A threshold will be set for the number of mutations we are going to apply.

Then we are going to compile the mutated code with "javac" command. If the mutated code has no compilation error, we will have a new mutation trace. We will store both the original trace and mutation trace in database.

==from 1 Mar 2018 We need to add one more mutation, which needs to combine dynamic and static code analysis. We can call it aim-oriented mutation.

We first collect the trace of a test case. Then, we detect the following trace steps which should meet the following requirements: (1) the step writes a variable (2) the step is control dominated by a step with condition expression (let's call the conditional expression as CE). If we find such a step, we mutate CE. In general, if CE does not contains '!', we add a not operation '!' for CE, otherwise, we remove the ! operator.

llmhyy commented 6 years ago

hi @lylytran

We need to add one more mutation, which needs to combine dynamic and static code analysis. We can call it aim-oriented mutation.

We first collect the trace of a test case. Then, we detect the following trace steps which should meet the following requirements: (1) the step writes a variable (2) the step is control dominated by a step with condition expression (let's call the conditional expression as CE). If we find such a step, we mutate CE. In general, if CE does not contains '!', we add a not operation '!' for CE, otherwise, we remove the ! operator.