Skip to content

Add safe Archive.updateUniqueCoveredIndividuals and DB-agnostic minimization pruning for DynamoDB actions - #1940

Open
aschenzle wants to merge 1 commit into
feat/ddb-more-seedingfrom
feat/archive-update-and-dynamodb-minimizer
Open

aschenzle wants to merge 1 commit into
feat/ddb-more-seedingfrom
feat/archive-update-and-dynamodb-minimizer

Conversation

@aschenzle

Copy link
Copy Markdown
Collaborator

Safe Archive.updateUniqueCoveredIndividuals and DB-agnostic initialization pruning for DynamoDB actions

Summary

This PR implements two complementary pieces of EvoMaster's post-processing minimization pipeline:

  1. Archive.updateUniqueCoveredIndividuals: Safely applies in-place post-processing updates across unique covered individuals in the archive while preserving shared object identity and preventing coverage regressions.
  2. DB-agnostic database pruning in Minimizer: Implements Minimizer.pruneNonNeededDatabaseActions() via a generic contract on Individual / EnterpriseIndividual, starting with INITIALIZATION_DYNAMODB (DynamoDbAction), without coupling Minimizer to DynamoDB-specific types.

Motivation & Impact

During search phase, individuals accumulate database setup actions (e.g., DynamoDbAction insertions from random initialization, mutation, or combining individuals) that are not actually needed by the final minimized API calls. Previously, Minimizer.pruneNonNeededDatabaseActions() was an unimplemented //TODO, leaving dead database setup inside generated test suites.

Example: Generated Test Before vs. After

Suppose EvoMaster is fuzzing GET /orders/ord-42, which only reads "ord-42" from the Orders DynamoDB table, while the evolved individual also carries leftover insertions from earlier mutations.

Without this PR

@Test
public void test_0() throws Exception {
    List<DynamoDbInsertionDto> insertions_dynamodb = dynamoDb()
        .insertInto("Orders")
            .s("orderId", "ord-42")
            .s("status", "PAID")
        .insertInto("Orders")          // <- never queried by GET /orders/ord-42
            .s("orderId", "foo_991")
            .s("status", "CANCELLED")
        .insertInto("AuditLogs")       // <- unrelated table from an earlier mutation
            .s("logId", "xyz")
            .bool("archived", true)
        .insertInto("Users")           // <- leftover item
            .s("userId", "u-7")
            .n("tier", "3")
        .dtos();
    DynamoDbInsertionResultsDto insertions_dynamodb_result =
        controller.execInsertionsIntoDynamoDb(insertions_dynamodb);

    given().accept("*/*")
        .get(baseUrlOfSut + "/orders/ord-42")
        .then()
        .statusCode(200);
}

With this PR

@Test
public void test_0() throws Exception {
    List<DynamoDbInsertionDto> insertions_dynamodb = dynamoDb()
        .insertInto("Orders")
            .s("orderId", "ord-42")
            .s("status", "PAID")
        .dtos();
    DynamoDbInsertionResultsDto insertions_dynamodb_result =
        controller.execInsertionsIntoDynamoDb(insertions_dynamodb);

    given().accept("*/*")
        .get(baseUrlOfSut + "/orders/ord-42")
        .then()
        .statusCode(200);
}

In addition, when a single EvaluatedIndividual covers multiple targets in Archive, updating targets carelessly can split one shared test into duplicate copies in Solution or silently drop coverage if a minimized candidate regresses on one target. Archive.updateUniqueCoveredIndividuals prevents both failure modes.

@aschenzle
aschenzle requested a review from jgaleotti November 18, 2026 08:38
@aschenzle
aschenzle requested a review from jgaleotti November 28, 2026 04:39
@aschenzle
aschenzle force-pushed the feat/archive-update-and-dynamodb-minimizer branch from 76b7628 to 7836c35 Compare November 28, 2026 17:45
@aschenzle
aschenzle changed the base branch from master to feat/ddb-more-seeding November 28, 2026 17:46
@aschenzle
aschenzle added this pull request to stack #1966 November 28, 2026 17:46
@aschenzle aschenzle changed the title Add safe Archive.updateUniqueCoveredIndividuals and DB-agnostic minimization pruning for DynamoDB actions [Merges last] Add safe Archive.updateUniqueCoveredIndividuals and DB-agnostic minimization pruning for DynamoDB actions Dec 1, 2026
@aschenzle
aschenzle removed this pull request from stack #1966 December 2, 2026 06:50
@aschenzle
aschenzle force-pushed the feat/archive-update-and-dynamodb-minimizer branch from 7836c35 to defdc09 Compare December 2, 2026 06:56
@aschenzle
aschenzle added this pull request to stack #1960 December 2, 2026 07:00
@aschenzle aschenzle changed the title [Merges last] Add safe Archive.updateUniqueCoveredIndividuals and DB-agnostic minimization pruning for DynamoDB actions Add safe Archive.updateUniqueCoveredIndividuals and DB-agnostic minimization pruning for DynamoDB actions Dec 2, 2026
@jgaleotti
jgaleotti requested a review from arcuri82 December 2, 2026 19:47
@aschenzle
aschenzle force-pushed the feat/archive-update-and-dynamodb-minimizer branch from defdc09 to 2045a7b Compare December 4, 2026 04:45
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.

2 participants