Repository navigation
Conversation
…ssed_files.py) [Recently Accessed Files] - Add contract docstring naming plausible mutant: getmtime-for-getatime - 8 pytest tests: smallest/ordinary fixture, path forwarding, 3 mutation-resistant tests - Mutation-resistant: mock getatime=1000.0 and getmtime=2000.0 simultaneously; assert 1000.0 - Original passes, getmtime mutant returns 2000.0 and fails - work/R35-T010/: check.py, evidence.md, results.json - FORCE_WRONG=1 exits code 1 (verified)
4 tasks
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.
This PR strengthens the tests of
get_file_access_timeinRecently Accessed Files/recently_accessed_files.pywith mutation-resistant regression tests. The plausible one-line mutant (swappingos.path.getmtimeforos.path.getatime) is detected by simultaneously mocking both functions with different values and asserting the return equals the access-time value.Related Issue
Fixes: #10
Type of Change
Changes Made
get_file_access_timenaming the protected condition, plausible mutant, and distinguishing strategy.Recently Accessed Files/test_recently_accessed_files.py:file_path="") → returns getatime 1000.0, is float, no mutation.file_path="/home/user/document.txt") → returns getatime 5000.0, path forwarded exactly.test_returns_atime_not_mtime— mocks getatime=1000.0 and getmtime=2000.0; original passes (1000.0), getmtime mutant fails (2000.0).test_returns_atime_not_ctime— same strategy for getctime mutant.work/R35-T010/check.py,work/R35-T010/results.json, andwork/R35-T010/evidence.md.Screenshots / Recordings
There is no UI change.
Testing
python3 work/R35-T010/check.py: PASS (8/8 tests, 3 native checks).FORCE_WRONG=1 python3 work/R35-T010/check.py: FAIL with non-zero exit code 1 (mutant detected).python3 -m pytest "Recently Accessed Files/test_recently_accessed_files.py" -v: PASS (8 tests in 0.02s, 0 failures, 0 errors).Checklist
Additional Notes
All verification runner scripts, mutation analysis, and evidence are located under
work/R35-T010/.