Cognition · Software component

Test-Based Vote Aggregator

Software componentCognitionCognition & Memoryarc:TestBasedVoteAggregator

A self-consistency aggregator for generated code that executes each sampled implementation against provided test cases and selects among the samples that pass, instead of comparing output text.

Responsibility. Selects consensus code solutions by test-execution outcomes.

Also known as: Test-driven aggregation, Execution-based voting

Variant of Self-Consistency Aggregator abstract

When to choose. Choose for code generation where implementations vary textually but test cases define correctness.

invokesspecializesis target of alternativeTois target of alternativeToreadsCode Execution Runner: invokesCode Execution RunnerSelf-Consistency Aggregator: specializesSelf-Consistency Aggrega…Quality-Weighted Vote Aggregator: is target of alternativeToQuality-Weighted Vote Ag…Majority Vote Aggregator: is target of alternativeToMajority Vote AggregatorUnit Test Suite: readsUnit Test Suite
Direct neighbourhood (hover for relationship types)

Relationships

invokes dependency

reads dependency

alternative to variability

Quantitative guidance

As stated by the sources; verify before use.

Classification

Patterns
Test-based voting
Quality attributes
Functional suitability: correctness and validity (ISO/IEC 25010 | NIST AI RMF: valid)Maintainability (ISO/IEC 25010)
Risks mitigated
Syntactically invalid generated codeEdge-case logic errors

Sources

  1. Ch5.3: T. Nguyen, "Self-Consistency Fundamentals," in Mastering Agentic AI Systems: Guide for the NVIDIA NCP-AAI Exam, 1st ed. 2026, ch. 5.3. ISBN: 9798244538229.