The SamplingPruner implements "normal" sampling with equivalence-class reuse. Unlike the FESamplingPruner, the SamplingPruner implements uniform fault-space sampling that counts multiple hits of an equivalence class. This change modifies the database schema, more specifically it adds the "weight" column to the fspgroup table. Update existing databases with this query: ALTER TABLE fspgroup ADD COLUMN weight INT UNSIGNED; Change-Id: I668fc9b25fc4d79a60aa1ef8d69cdf5fa076cc6d
38 lines
1.0 KiB
C++
38 lines
1.0 KiB
C++
#ifndef __SAMPLING_PRUNER_H__
|
|
#define __SAMPLING_PRUNER_H__
|
|
|
|
#include <stdint.h>
|
|
#include "Pruner.hpp"
|
|
#include "util/CommandLine.hpp"
|
|
|
|
///
|
|
/// SamplingPruner: implements sampling with equivalence-class reuse
|
|
///
|
|
/// Unlike the FESamplingPruner, the SamplingPruner implements uniform
|
|
/// fault-space sampling that counts multiple hits of an equivalence class.
|
|
///
|
|
class SamplingPruner : public Pruner {
|
|
fail::CommandLine::option_handle SAMPLESIZE;
|
|
fail::CommandLine::option_handle USE_KNOWN_RESULTS;
|
|
fail::CommandLine::option_handle NO_WEIGHTING;
|
|
|
|
uint64_t m_samplesize;
|
|
bool m_use_known_results, m_weighting;
|
|
|
|
public:
|
|
SamplingPruner() : m_samplesize(0), m_use_known_results(false), m_weighting(true) { }
|
|
virtual std::string method_name() { return "sampling"; }
|
|
virtual bool commandline_init();
|
|
virtual bool prune_all();
|
|
|
|
void getAliases(std::deque<std::string> *aliases) {
|
|
aliases->push_back("SamplingPruner");
|
|
aliases->push_back("sampling");
|
|
}
|
|
|
|
private:
|
|
bool sampling_prune(const fail::Database::Variant& variant);
|
|
};
|
|
|
|
#endif
|