Class CassandraHeuristicsCalculator
java.lang.Object
org.evomaster.client.java.controller.cassandra.calculator.CassandraHeuristicsCalculator
Calculator designed to compute a branch-distance-based heuristic for a CQL (Cassandra Query Language) query,
given the rows returned by executing that query against the database.
The distance reflects how far the query's WHERE condition is from being satisfied by the available data and is used to guide the search towards inserting data in the database that makes the executed queries return non-empty results during the execution of generated tests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecomputeDistance(String cqlQuery, Iterable<CassandraRow> returnedRows) Computes the heuristic distance of the given CQL query with respect to the provided rows.
-
Constructor Details
-
CassandraHeuristicsCalculator
public CassandraHeuristicsCalculator()
-
-
Method Details
-
computeDistance
Computes the heuristic distance of the given CQL query with respect to the provided rows. A distance of0.0means the query is satisfied, while values closer to1.0indicate the query is further from being satisfied.- Parameters:
cqlQuery- the CQL query to evaluatereturnedRows- all rows in the table the query targets, used to evaluate how close the query's condition is to matching at least one row- Returns:
- a distance value in
[0.0, 1.0], where0.0represents the best case
-