-
Notifications
You must be signed in to change notification settings - Fork 15
SF100 Experiment
Evosuite++ provides a function to retrieve methods under specific condition.
For example, we would like to find all the methods in SF100 dataset which contains at least two branches.
To this end, we need to define an option in evosuite.shell.listmethod.MethodFilterOption
.
Evosuite++ has already provided a set of filters, for example MethodFilterOption.HAS_BRANCH
, MethodFilterOption.CALLS_INT_METHOD
(find target methods with method call), etc.
By default, users just need to run ListMethodsBatch.justRun()
in shell
project.
If any users is interested in extending their own filter, they need to
- add a new option in
MethodFilterOption
, - extend a case in
MethodFilterOption.getCorrespondingFilter()
, and - create an implementation for
IMethodFilter
interface.
As a result, Evosuite++ will generate a text file containing all the methods meeting the requirement of the filter-condition. An example is used as follows:
#------------------------------------------------------------------------
#Project=tullibee - 1_tullibee
#------------------------------------------------------------------------
com.ib.client.EClientSocket#cancelHistoricalData(I)V
com.ib.client.EClientSocket#cancelRealTimeBars(I)V
...
#------------------------------------------------------------------------
#Project=a4j - 2_a4j
#------------------------------------------------------------------------
net.kencochrane.a4j.beans.Authors#getAuthor(I)Ljava/lang/String;
net.kencochrane.a4j.beans.BlendedSearch#setProductLine([Lnet/kencochrane/a4j/beans/ProductLine;)V
...
Readers can refer to windows script example and linux script example on how to take the target method list as an input to run batch experiment.
- Use the maven command to package the source code into a jar package.
mvn clean source:jar install -DskipTests -Ppackage-jars -T 4
The result is in the foldergenerate-jars
- Get targetMethodList.txt
By default, users just need to run
ListMethodsBatch.justRun()
inshell
project. Readers can check Method Retrieval for more details. - We can change the seeding strategy parameters (e.g., -Ddynamic_pool and -Dprimitive_pool) and SBST strategy (e.g., -generateMOSuite -Dstrategy MOSUITE -Dalgorithm DYNAMOSA) in the shell script.
More details can be referred in Runtime Configuration - The shall script has to be in the same directory as your target method txt file and the multiple SF100 project folders.
Evosuite provides SF100 dataset as a standard benchmark to run experiment.
Readers can check https://www.evosuite.org/experimental-data/sf100/ for more details.
In this dataset, each project is specified with a configuration file in :
while Windows system uses ;
.
Here, Evosuite++ provides a Java application (in ConfigurationTransformer
) to translate between Linux and Windows.