pub struct RLTestPrioritizer { /* private fields */ }Expand description
RL-based test prioritizer using Thompson Sampling
Learns optimal test prioritization policy by tracking success/failure rates for different feature combinations.
Implementations§
Source§impl RLTestPrioritizer
impl RLTestPrioritizer
Sourcepub fn with_exploration_rate(self, rate: f64) -> Self
pub fn with_exploration_rate(self, rate: f64) -> Self
Create prioritizer with custom exploration rate
Sourcepub fn prioritize(&self, features: &[CodeFeatures]) -> Vec<usize>
pub fn prioritize(&self, features: &[CodeFeatures]) -> Vec<usize>
Prioritize test cases using Thompson Sampling
Returns indices sorted by priority (highest failure probability first)
Sourcepub fn update_feedback(&mut self, features: &CodeFeatures, revealed_bug: bool)
pub fn update_feedback(&mut self, features: &CodeFeatures, revealed_bug: bool)
Update with feedback from test execution
§Arguments
features- Features of the executed test caserevealed_bug- True if test revealed a bug, false otherwise
Sourcepub fn failure_rate(&self, features: &CodeFeatures) -> f64
pub fn failure_rate(&self, features: &CodeFeatures) -> f64
Get current failure rate estimate for a feature signature
Sourcepub const fn total_tests(&self) -> usize
pub const fn total_tests(&self) -> usize
Get total number of tests executed
Sourcepub fn num_signatures(&self) -> usize
pub fn num_signatures(&self) -> usize
Get number of tracked feature signatures
Trait Implementations§
Source§impl Clone for RLTestPrioritizer
impl Clone for RLTestPrioritizer
Source§fn clone(&self) -> RLTestPrioritizer
fn clone(&self) -> RLTestPrioritizer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RLTestPrioritizer
impl Debug for RLTestPrioritizer
Auto Trait Implementations§
impl Freeze for RLTestPrioritizer
impl RefUnwindSafe for RLTestPrioritizer
impl Send for RLTestPrioritizer
impl Sync for RLTestPrioritizer
impl Unpin for RLTestPrioritizer
impl UnsafeUnpin for RLTestPrioritizer
impl UnwindSafe for RLTestPrioritizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more