Skip to content

Conversation

@francastagna
Copy link
Collaborator

@francastagna francastagna commented Oct 29, 2025

PR Summary

Add (μ+λ) Evolutionary Algorithm


(μ+λ) EA Pseudocode

image

Source: https://www.researchgate.net/publication/327166354_An_Empirical_Evaluation_of_Evolutionary_Algorithms_for_Unit_Test_Suite_Generation


Main Changes

  • EMConfig

    • Add MuPlusLambdaEA to EMConfig.Algorithm.
    • Add/Expose muPlusLambdaOffspringSize (λ) for (μ+λ) EA.
  • Main wiring

    • Wire MuPlusLambdaEvolutionaryAlgorithm for all relevant problem types (GraphQL, RPC, Web, REST).
  • New algorithm

    • MuPlusLambdaEvolutionaryAlgorithm.kt
      • For each generation: generate λ offspring via mutation from parents (λ/μ per parent), then select the best µ from parents ∪ offspring.
  • Docs

    • Update docs/options.md to include MuPlusLambdaEA and muPlusLambdaOffspringSize.

Tests

  • MuPlusLambdaEvolutionaryAlgorithmTest.kt
    • Finds Optimum (testMuPlusLambdaEAFindsOptimum).
    • Edge cases:
      • xoverProbability=0.0, fixedRateMutation=1.0 → 0 crossovers, λ mutations, µ size preserved. (testNoCrossoverWhenProbabilityZero_MuPlusEA)
      • fixedRateMutation=0.0, xoverProbability=1.0 → 0 mutations, µ size preserved. (testNoMutationWhenProbabilityZero_MuPlusEA)
    • One-iteration properties (testSelectionBestMuAndMutationCount_MuPlusEA):
      • Final population size equals µ.
      • Final population equals top-µ by score from parents ∪ offspring.
      • With fixedRateMutation=1.0 and λ divisible by µ → mutations = λ.

@francastagna francastagna requested a review from arcuri82 October 30, 2025 13:25
@francastagna francastagna marked this pull request as ready for review October 30, 2025 13:26
@arcuri82
Copy link
Collaborator

@francastagna hi. this PR has conflicts that need to be resolved before review

@francastagna
Copy link
Collaborator Author

francastagna commented Oct 31, 2025

@francastagna hi. this PR has conflicts that need to be resolved before review

Hi Andrea! Thanks 👍🏽
I’ve just resolved the conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants