Closed lisv closed 3 years ago
Links to some (incomplete?) specification for Ripple JSON-RPC API:
The layout however makes it not easy to automatically get an overview of all methods and corresponding params. How do I get such an overview to use as a basis for the population generation?
EvoMaster (https://github.com/EMResearch/EvoMaster/blob/master/docs/blackbox.md) performs black-box testing by using the schema of APIs, which are available for various REST APIs in the OpenAPI directory (swagger format). Unfortunately, I could not find something like this yet for RPC APIs.
There is something similar for RPC (OpenRPC: https://spec.open-rpc.org/) but this format is not yet used (not by Ripple and probably not by many others either as it seems quite new).
I would suggest starting with something simple, like the hill climber or (mu, lambda)-Evolutionary Algorithm. These algorithms use only the mutation operator and no crossover. The crossover could be a bit complicated in this case.
Following the meeting on the 12th of November
Update
I have used the OpenRPC format to create a specification for the public rippled methods (https://xrpl.org/public-rippled-methods.html). Since there are so many, I have now only included account methods, so not all methods are included in the specification yet.
Most elements (that I need) of the OpenRPC are required by the rules of the format and are in a prespecified format. Unfortunately, this does not hold for the 'schema' element of a parameter (which can be structured in various ways with different elements to represent the type of a parameter). This will likely cause problems later for other OpenRPC's. For now I have built code that can only deal with all the different ways that 'schema' is formatted in the Ripple OpenRPC.
An initial population is created based on the OpenRPC specification: each individual has a certain method with corresponding parameters. The required parameters are always included in the individual, optional parameters can be included. Because the population is generated based on the specification, all created requests are valid according to the API. It is currently not possible to create invalid requests (e.g. a method with parameters of another method).
Structure for fitness function is created, but currently fitness of an individual is a randomly generated value. I think I will have to do more research in order to find an appropriate way to calculate the fitness, e.g. certain ways to measure the coverage based on different outputs (since it is black-box).
BooleanGene is mutated to either the other boolean value, or to a different type (some parameters can be of multiple types, e.g. a String of an Integer/Long).
StringGene and LongGene cannot yet be mutated. I am not sure yet how I could best do this. And should I deviate from the specified (valid) ranges?
Stopping criterion for the EA is now a number of generations, but this can be easily changed to time in the future.
Update
Following the meeting on the 30th of October
Steps: