Hi, this is a small PR that opens a new path by allowing the developers to change the variable naming strategy.
Let's consider the following example with the current implementation.
At the moment, when a new Unit test is generated by EvoSuite, they look something like this:
Short[] shortArray0 = new Short[5];
Short short0 = shortArray0[0];
What If the user would prefer another naming? Something completely different?
Like:
Short[] var0Array = new Short[5];
Short var1 = var0Array[0];
This can now be achieved by only creating a new VariableNameStrategy.
For example, the example shown can be implemented with:
public class SimpleVariableNameStrategy extends AbstractVariableNameStrategy {
@Override
public String createNameForVariable(VariableReference variable) {
if (variable.isArray()) {
return variable.getName() + "Array";
} else {
return variable.getName();
}
}
}
Please let me know your thoughts/suggestion about it!
Hi, this is a small PR that opens a new path by allowing the developers to change the variable naming strategy.
Let's consider the following example with the current implementation. At the moment, when a new Unit test is generated by EvoSuite, they look something like this:
What If the user would prefer another naming? Something completely different? Like:
This can now be achieved by only creating a new
VariableNameStrategy
. For example, the example shown can be implemented with:Please let me know your thoughts/suggestion about it!