Skip to content

SF100 Experiment

Yun Lin edited this page Nov 3, 2020 · 18 revisions

Method Retrieval (with condition)

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
...

Run Batch Experiment with Script

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.

Run Experiment Results

  1. 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 folder generate-jars
  2. Get targetMethodList.txt By default, users just need to run ListMethodsBatch.justRun() in shell project. Readers can check Method Retrieval for more details.
  3. 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
  4. The shall script has to be in the same directory as your target method txt file and the multiple SF100 project folders.

Experimental Projects and Their Required Platform

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 $project_name$/evosuite-files/evosuite.properties, which adds required libraries into classpath. However, different operation systems use different file separator, e.g., Linux system uses : while Windows system uses ;. Here, Evosuite++ provides a Java application (in ConfigurationTransformer) to translate between Linux and Windows.