Conversation
Add targeted tests for TableFormatter default trait methods (output.rs) and Unknown command error handling (commands/mod.rs). Exclude one equivalent mutant where Vec::new() -> vec![] is a no-op replacement.
Add execute and output test modules covering cohesion ratio arithmetic, boolean filter logic, threshold boundary values, accumulator operations, cross-dependency generation, and exact output string matching. Simplify three equivalent expressions to eliminate untestable mutants.
Add 36 unit tests to setup/output.rs covering conditional branches (>), negation guards (!), and arithmetic (+) in SetupResult::to_table(). Tests verify skills, agents, hooks, and git config sections with exact string matching.
Add execute and output test modules covering threshold boundary values (>= vs <), compound AND filter logic, and exact output string matching. Remove weak placeholder test that only checked struct field assignment.
Replace 5 tautological assertions with real group count, hash value, and member count checks. Add build_by_module accumulation test, run() integration tests, and hash truncation boundary tests for output.
Replace shallow !is_empty() assertions with exact count and content checks, fix module_filter to use exact match, add run() integration tests for Table and JSON output formats.
Add CLI parsing, output formatting, and execute boundary tests. Cover scoring formula arithmetic, threshold boundaries, and run() integration with Table/JSON output formats.
Add execute and output test modules covering DFS cycle detection, max_length boundary, path guard comparisons, and exact table output formatting. Make find_all_cycles/deduplicate_cycles pub(crate) for testability.
Add CLI parsing, execute, and output test modules covering threshold filtering, module grouping deduplication (! negation guard), and exact output string matching for all formatters.
Add CLI parsing, execute, and output test modules covering clause count thresholds, module grouping deduplication (! negation guard), and exact output string matching for all formatters.
Add CLI parsing, execute, and output test modules with 32 tests covering type pattern matching, module filtering, arity exclusion, and exact output string matching for all formatters.
Replace empty execute_tests.rs with 12 tests covering dependency relationships, no-match case, regex/limit filtering, and run() integration for Table/JSON output.
Replace empty execute_tests.rs with 13 tests covering function signature lookup, arity filtering, module scoping, and run() integration for Table/JSON output.
Add CLI parsing, execute, and output test modules with 31 tests covering return type pattern matching, module filtering, and exact output string matching for all formatters.
Rewrite test module with 60 tests covering parse_single_field (|| guard), parse_type_fields, format_type_definition, group_by_module, group_by_module_with_file, group_calls, and convert_to_module_groups.
Comprehensive mutation-killing tests for output.rs (14/14) and commands/mod.rs (2/2). Adds tests for format_entry_details, blank_after_summary/blank_before_module branches, ModuleCollectionResult to_table path, and format(Table) dispatch. Strengthens error message assertion for unknown commands.
Add MockValue/MockRow test infrastructure and 30 targeted tests for extract_bool, extract_f64, extract_call_from_row_trait, escape_string_for_quote, and escape_string_single. All 29 viable mutants caught (6 unviable).
Add tests for Array Value trait impl (as_str/as_i64/as_f64/as_bool return None, as_array returns elements) and into_rows with actual data. All 50 viable mutants caught (12 unviable).
Add 14 tests targeting && vs || mutations in caller/callee matching, >= vs < in row length check, position filter boundary conditions (start_line=0, end_line=0, empty kind), and arity filtering. All 13 viable mutants caught (1 unviable).
Extract dedup_calls as standalone pub(crate) function for direct unit testing. Add tests for header column matching (== vs !=), clause vs function start/end_line field assignments, and dedup depth comparison with controlled input ordering to kill < vs ==/<= mutants. All 15 viable mutants caught (4 unviable).
Add tests for create_schema persistence, import_json_str data insertion, clear_project_data table emptying, create_has_clause_relationships count, and default_complexity value. All 58 mutants caught.
Add edge-case fixture data and 4 tests targeting && vs || mutations in the empty-field filter and > vs >= in duplicate threshold check. All 20 viable mutants caught (1 unviable).
Add tests for Call::format_incoming (same/different module) and TraceResult::empty with non-default values. All 18 viable mutants caught (4 unviable).
…l all 41 mutants Add tests for build_with_regex truth table (supports_regex x use_regex), create_temp_json_file content verification, load_output_fixture content check, and insert_defines/insert_has_clause DB persistence. All 24 viable mutants caught (17 unviable).
Add 16 tests for deduplicate_retain and sort_and_deduplicate covering duplicate removal, order preservation, custom keys, and edge cases. All 2 mutants caught.
Add tests for execute() field values, clear flag reflection, and run() output for both Table and JSON formats. All 9 mutants caught.
Add 7 tests targeting depth-1 dedup conditional mutations (== vs !=, && vs ||) in build_trace_result. All 38 mutants caught.
Add run() integration tests for Table/JSON output, regex flag parsing, regex match/no-match/invalid tests. All 8 mutants caught.
Add field assertions on PathResult metadata and run() integration test for formatted output. All 8 mutants caught.
Rewrite output tests with exact assertions for format_summary, blank_before_module, blank_after_summary. Add run() integration tests for Table format. All 14 viable mutants caught (1 unviable).
[8cd5f3c4] Fix calls_to command tests — kill all 7 mutants Add direction-sensitivity tests exploiting asymmetric call counts between From/To, plus run() integration tests for Table/JSON output. All 4 viable mutants caught (10 unviable).
Add run() integration tests, field-level assertions on DependentCaller, output snapshot tests for empty kind, no-slash file paths, and multiple targets. All 14 viable mutants caught (5 unviable).
Add name filter inclusion/exclusion tests killing the delete-! mutant, and args-only/return-type-only output snapshots killing the || vs && mutant. All 21 viable mutants caught (3 unviable).
Add run() integration tests for Table/JSON/empty output, field-level assertions, and pattern/guard output snapshots. All 7 mutants caught.
Add boundary test for > vs >= when total is 0, plus run() integration tests for Table/JSON/empty output. All 12 mutants caught.
Add direct unit test for sort comparator with synthetic data that distinguishes == vs != in tiebreaker, truncate_module_name boundary tests, and run() integration tests. All 24 viable mutants caught (6 unviable).
Add run() integration tests for Table/JSON/empty output covering the full execute+format pipeline. All 6 viable mutants caught (5 unviable).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Systematic mutation testing fix across the entire code_search codebase. Every file targeted by
cargo mutantsnow reports 0 missed mutants.What changed
37 commits fixing tests across 36 tickets from the mutation testing epic. The work covers:
Shared infrastructure (2 commits)
output.rs,commands/mod.rs)dedup.rs)DB layer (8 commits)
db.rs) — 35 mutantsbackend/surrealdb.rs) — 62 mutantscalls.rs(14),trace.rs(19),import.rs(58),duplicates.rs(21)call.rs,trace.rs(22)query_builders.rs,test_utils.rs) — 41 mutantsCLI commands (27 commits)
run()integration tests (Table/JSON/empty), field-level assertions, direction-sensitivity tests, boundary condition tests, output snapshot testsBy the numbers
Approach
cargo mutants -f <file>before committingTest plan
cargo testpasses (all 650+ tests green)cargo mutants -f <file>reports 0 MISSED for every file changed