test: add mutation testing coverage for survived and untested mutants#76
test: add mutation testing coverage for survived and untested mutants#76
Conversation
Add TestKebabName class to test_models.py for kebab_name() mutants. Add test classes to test_protocol.py for _decode_temperature, _check_length, _encode_temperature, _decode_temp_unit, _decode_flame_effect, and _encode_heat_settings mutants. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add TestTokenAuthCallableMutant, TestBuildAppDirect, and TestSaveCacheDirect test classes that call methods directly (bypassing asyncio.to_thread) to defeat 27 surviving mutation testing mutants in auth.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add comprehensive direct unit tests for _parse_fire_features, get_fire_overview, get_fires, _request, write_parameters, turn_on, turn_off, and __init__/__aenter__/__aexit__ to enable mutmut v3 test selection to associate tests with specific functions. Key additions: - TestParseFireFeaturesDirect: parametrized tests for all 24 features - TestGetFireOverviewFeatureSource: FireDetails vs WifiFireOverview fallback - TestGetFiresFieldMapping: every Fire field mapping verified - TestRequestBoundaryStatus: status 199/200/299/300 boundary checks - TestWriteParametersPayload: exact payload structure verification - TestTurnOnDirect/TestTurnOffDirect: mode and temperature assertions - TestContextManagerDirect: session creation and lifecycle - TestGetFireOverviewFieldDefaults: individual field default tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add 112 new tests targeting survived mutants in cli.py: - build_parser: verify description text, help strings, argument configs, and subparser names (kills ~81 mutants) - _display_* functions: precise output assertions for headers, labels, format strings, and arithmetic operations (kills ~56 mutants) - _masked_input: verify prompt writing, asterisk output, backspace handling, terminal settings save/restore, and flush calls (kills ~23 mutants) - main: verify logging level selection and args forwarding (kills ~2 mutants) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add ~60 new tests targeting survived mutants across all format functions, _expand_flame, _build_fire_art, and _ClickableValue. Tests verify exact label strings, action names, value formatting, item counts, and ASCII art structural elements. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add 12 tests verifying exact subprocess.run arguments, kwargs, branch conditions, strip() application, and fallback paths to kill 58 survived mutants in the TUI app._resolve_version function. Co-authored-by: deviantintegral <255023+deviantintegral@users.noreply.github.com>
|
@copilot compare this PR against PR #78. Report on what the differences are, and suggest which one is the better version, if either. |
Here's my comparison of this PR (#80) vs PR #78: Size: PR #80 is larger (+3,114 lines across 7 files) vs PR #78 (+1,786/-190 across 9 files). Overlapping coverage (both PRs target the same mutants):
Unique to PR #78:
Unique to PR #80:
Quality differences:
CI status: PR #78 passes all CI checks. This PR (#80) also passes. Recommendation: PR #78 is the better version. It's more concise (-1,328 fewer added lines), takes a surgical approach of tightening existing tests rather than duplicating setup, and covers |
Cherry-pick auth tests from Copilot PR #76 that complement our existing mutation testing coverage with direct unit tests for auth internals. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cherry-pick auth tests from Copilot PR #76 that complement our existing mutation testing coverage with direct unit tests for auth internals. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds targeted tests to kill mutants identified by mutation testing reports. All changes are test-only — no source code was modified.
Protocol & Models
_decode_temperature,_check_length,_encode_temperature(mod-2 mutant),_decode_temp_unit,_decode_flame_effect(bitwise AND vs OR),_encode_heat_settings(boost boundary)kebab_nametests verifying lowercase + underscore-to-hyphen conversionAuth
_build_app()verifying each MSAL constructor kwarg individually (CLIENT_ID, AUTHORITY, validate_authority=False, token_cache)_save_cache()verifyingmkdir(parents=True, exist_ok=True)andwrite_textcontentcaplogClient
_parse_fire_featurestests covering all 24 feature fields individually (catches key-name and default-value mutations)get_fire_overviewfeature sourcing tests (FireDetails vs WifiFireOverview fallback)CLI
build_parserdescription/help text assertions_display_*output verification (timer arithmetic// 60/% 60, error hex/binary formatting, feature labels)_masked_inputterminal handling (asterisks, backspace sequences,stdin.read(1)calls)TUI Widgets
_format_*functions (kills XX-prefix/suffix and case mutations)_build_fire_artstructural verification (frame elements, flame chars, LED/media styles, heat wave chars)_expand_flamegap distribution logicTUI App
_resolve_versionsubprocess.run arg verification for all three git commands (describe, rev-parse, status) including kwargs (capture_output=True,text=True,timeout=2) and all branch pathsRemaining mutants
~3,400 mutants remain labeled "no tests" by mutmut due to its test selection algorithm failing to map integration-style tests to specific source functions. The code paths are exercised by existing tests but mutmut cannot associate them. Fixing this requires mutmut configuration changes or source modifications, not additional tests.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.