Skip to content

test(sudoku_validate_outputs): add 46 mutation-killing tests (See #2149) - #2386

Merged
jsboige merged 1 commit into
mainfrom
test/sudoku-validate-mutation
Jun 4, 2026
Merged

jsboige merged 1 commit into
mainfrom
test/sudoku-validate-mutation

Conversation

@jsboige

@jsboige jsboige commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

Add comprehensive mutation-killing tests for sudoku_validate_outputs.py (190 lines, previously 0 tests).

Coverage (0% -> tested)

validate_notebook (L12-84)

Zone Tests Mutations killed
JSON error handling 3 Invalid JSON returns error, preserves path, valid JSON no error
Metadata extraction 3 kernel name/lang extracted, missing kernelspec defaults
null_exec_count 4 Detected, non-null OK, empty source skip, whitespace skip
empty_outputs 3 Detected, non-empty OK, empty source skip
error_outputs 5 Detected, stream OK, truncation 80 char, first-only break, execute_result OK
forbidden_patterns 9 NotImplementedError, assert False, 1/0, multiple, safe 1/10, comment behavior, empty skip, variable name a1/0, whitespace 1 / 0
Cell counting 4 Code cells counted, md skipped, exec counter, all-exec
Cell index tracking 2 Issue records index, multiple cells
Source format 2 List join, list with forbidden
Clean notebook 2 No issues, empty notebook

classify_kernel (L87-95)

Zone Tests Mutations killed
.NET detection 3 .net-csharp, csharp, fsharp
Python detection 2 python3, python2
Other/default 2 julia, missing key
Case insensitivity 2 PYTHON3, .NET-CSHARP

Metrics

  • Tests: 0 -> 46 (all passing)
  • Full suite: 1552 passed (was 1506)
  • Mutation score: 0% -> ~85% (all pure logic functions covered)

Survivors (low-value, not tested)

  • main() (L98-186): CLI filesystem-dependent entry point
  • print_group() (L116-159): Print formatting only

Cumul #2149 mutation testing (6 PRs, 288 tests)

Script PR +Tests Score
notebook_tools.py R1 #2333 MERGED +28 ~65%
generate_catalog.py #2338 MERGED +69 ~65%
expand_catalog_markers.py #2346 MERGED +24 ~60%
notebook_tools.py R3 #2370 pending +56 ~78%
notebook_helpers.py #2377 pending +65 ~80%
sudoku_validate_outputs.py This PR +46 ~85%

See #2149

Cover validate_notebook (JSON errors, metadata extraction,
null_exec_count, empty_outputs, error_outputs, forbidden_patterns,
cell counting, index tracking, source format) and classify_kernel
(dotnet/python/other classification, case insensitivity, missing keys).

0 -> 46 tests, full suite 1552 passed.

@clusterManager-Myia clusterManager-Myia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[NanoClaw] LGTM.

46 mutation-killing tests across 11 classes. Coverage is thorough: JSON errors, metadata extraction, null_exec_count, empty_outputs, error_outputs (truncation, first-only), forbidden_patterns (word-boundary edge cases, commented code behavior documented), cell counting, classify_kernel, source format. No security concerns. Clean structure.

@jsboige
jsboige merged commit 4d3facd into main Jun 4, 2026
2 checks passed
@jsboige
jsboige deleted the test/sudoku-validate-mutation branch June 4, 2026 18:39
jsboige added a commit that referenced this pull request Jun 4, 2026
…) (#2386)

Cover validate_notebook (JSON errors, metadata extraction,
null_exec_count, empty_outputs, error_outputs, forbidden_patterns,
cell counting, index tracking, source format) and classify_kernel
(dotnet/python/other classification, case insensitivity, missing keys).

0 -> 46 tests, full suite 1552 passed.
jsboige added a commit that referenced this pull request Jun 5, 2026
…) (#2386)

Cover validate_notebook (JSON errors, metadata extraction,
null_exec_count, empty_outputs, error_outputs, forbidden_patterns,
cell counting, index tracking, source format) and classify_kernel
(dotnet/python/other classification, case insensitivity, missing keys).

0 -> 46 tests, full suite 1552 passed.
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