module
Docs::A_GETTING_STARTED::EVOLUTION_GUIDE
Overview
Feedback-Driven Evolutionary Optimization
Crowbar enables programs to report candidate execution feedback (success/fitness) to evolve inputs toward maximizing coverage, depth, or custom test goals.
Executive Summary & Key Topics
| Topic | Method / Anchor | Description |
|---|---|---|
| Genetic Algorithms and Diversity Controls | .topic_01_evolution_mechanics |
Population selection, crossover, and preventing local locking. |
Related Guides & Source References
- src/crowbar/evolution/manager.cr
- src/crowbar/evolution/corpus.cr
Defined in:
docs/a_getting_started/evolution_guide.crClass Method Summary
-
.topic_01_evolution_mechanics : Nil
Genetic Algorithms and Diversity Controls: Population selection, crossover, and preventing local locking.
Class Method Detail
def self.topic_01_evolution_mechanics : Nil
#
Genetic Algorithms and Diversity Controls: Population selection, crossover, and preventing local locking.
| Parameter | Default | Purpose |
|---|---|---|
| `enabled` | `true` | Toggle evolutionary mode on/off |
| `population_size` | `64` | Maximum candidates preserved in memory |
| `exploration_rate` | `0.15` | Percentage of forced random baseline inputs |
| `crossover_rate` | `0.25` | Percentage of hybrid offspring recombination |
| `stagnation_limit` | `100` | Stagnant cycles before novelty culling |
Working Examples
fuzzer = Crowbar.define do
evolution do
enabled true
population_size 32
exploration_rate 0.15
end
end
1000.times do
candidate = fuzzer.fuzz(baseline)
# Evaluate candidate in target program
fitness_score = evaluate(candidate)
fuzzer.report(candidate, fitness: fitness_score)
end