What is GaSubtle?
GaSubtle is a tool based on Java that uses genetic algorithm to generate subtle higher order mutants.
How to use the API?
You can use the API to integrate GaSubtle with your application.
copy
GeneticAlgorithm
.builder()
.mutationPercentage(10) // the mutation percentage
.maxOrder(5) // max order of the HOMs not to be exceeded
.runRepeat(1) // how many time to run the algorithm [for benchmarking]
// stopping conditions, at least one should be provided
.requiredSubtleHoms(1000) // stopping condition: minimum subtle HOMs needed
.maxHoms(1500) // stopping condition: maximum HOMs to generate
.maxGeneration(300) // stopping condition: maximum generation to reach
.timeout(1000) // stopping condition: timeout in seconds
.originalFile("/some/.java/file") // path to the original file
.testCasesPath("/some/.class/test/path") // path to test cases
.resultPath("/some/path") // path to store the results in
.mutantsPath("/some/path") // path to store the mutants in
.evaluation(new EvaluationDefaultImpl())
.crossover(new CrossoverDefaultImpl())
.mutation(new MutationDefaultImpl())
.selection(new TournamentSelection())
.messageListener(new MessageListener() {
@Override
public void info(String value) {
System.out.println("Info message from the GA is: "+ value);
}
@Override
public void error(String value) {
System.out.println("There was an error:" + value);
}
@Override
public void debug(String value) {
System.out.println("Debugging: "+ value);
}
})
.geneticAlgorithmListener((int generation, int populationSize, int liveMutants, int subtleMutants)
-> LOG.info(String.format("Generation [%s] Population [%s] Live Mutants [%s] Subtle Mutants [%s]",
generation, populationSize, liveMutants, subtleMutants)))
.build()
.run();
See GaSubtle in action
Whether you are a developer or a researcher, you can use Gasubtle.
-
Guide
Everything you want to know.
Start -
Java Docs
Check the docs.
Learn more -
License
GaSubtle License.
Check License
Got a minute? Message us
If you have any suggestions do not hesitate to email us on abdullah.asendarz@gmail.com.