Title: test(conversions): test invariant of feetToMeter with 100 bounded cases (R50-T044) by aniruddha-bongale · Pull Request #92 · S-AI-Projects/TheAlgorithms-JavaScript · GitHub
Open Graph Title: test(conversions): test invariant of feetToMeter with 100 bounded cases (R50-T044) by aniruddha-bongale · Pull Request #92 · S-AI-Projects/TheAlgorithms-JavaScript
X Title: test(conversions): test invariant of feetToMeter with 100 bounded cases (R50-T044) by aniruddha-bongale · Pull Request #92 · S-AI-Projects/TheAlgorithms-JavaScript
Description: Description This PR addresses task R50-T044 for feetToMeter. It introduces invariant and property-based regression tests across 100 bounded valid inputs generated with a deterministic seed, verifies the constant scale ratio, round-trip invertibility, linearity, and monotonicity invariants, documents the mathematical contract next to feetToMeter in Conversions/MeterToFeetConversion.js, and adds an automated check runner work/R50-T044/check.py that confirms sensitivity against deliberately broken mutants. Related Issue Fixes: #44 Type of Change Tests Documentation Refactoring / Maintenance Changes Made Documented invariant and property contracts beside feetToMeter in Conversions/MeterToFeetConversion.js citing precondition checks at Line 18. Added comprehensive property-based tests in Conversions/test/MeterToFeetConversion.test.js: Stated fixtures: smallest valid length (0 feet -> 0 meters) and ordinary input (10 feet -> 3.048 meters). 100 bounded valid cases generated with a deterministic fixed-seed LCG in range [0.01, 1000.0]. Invariant checks: ratio invariance (Math.abs(feetToMeter(x)/x - 0.3048) < 1e-12), round-trip invertibility with meterToFeet (< 1e-9), linearity/additivity (feetToMeter(a+b) === feetToMeter(a) + feetToMeter(b)), and strict monotonicity. Smallest failing case detection under an altered scaling mutant. Implemented automated check runner work/R50-T044/check.py with mutant detection verification and saved verifiable results in work/R50-T044/results.json. Screenshots / Recordings N/A (Unit / property test suite) Testing Ran Prettier style checks: npx prettier --check Conversions/MeterToFeetConversion.js Conversions/test/MeterToFeetConversion.test.js work/R50-T044/results.json Ran native Vitest suite: npm test -- Conversions/test/MeterToFeetConversion.test.js (9 tests passed) Ran full repository test suite via pre-commit hook (346 test files, 11,977 tests passed) Ran automated check runner: python3 work/R50-T044/check.py (all checks and tool version captures passed) Checklist I have tested my changes locally. I have added or updated tests, if needed. I have updated documentation, if needed. I have followed the project's coding guidelines. I have run the relevant tests and checks. I have addressed previous review feedback, if applicable. Additional Notes Precondition source line 18 is explicitly cited in code comments, test descriptions, and automated check results. The generator does not rely on undefined behavior, and the checks verify defect sensitivity against broken mutants.
Open Graph Description: Description This PR addresses task R50-T044 for feetToMeter. It introduces invariant and property-based regression tests across 100 bounded valid inputs generated with a deterministic seed, verifie...
X Description: Description This PR addresses task R50-T044 for feetToMeter. It introduces invariant and property-based regression tests across 100 bounded valid inputs generated with a deterministic seed, verifie...
Opengraph URL: https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/92
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7e217927-68bb-0047-792c-30f3895a815f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E21C:29C715:30C0CC4:4119B96:6B06DACA |
| html-safe-nonce | f213f5820f4b9977b748487186bbf149beefd86a1364d667db23e06482a9f442 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjFDOjI5QzcxNTozMEMwQ0M0OjQxMTlCOTY6NkIwNkRBQ0EiLCJ2aXNpdG9yX2lkIjoiNzY2MDM5MjIyMDgzNDg0NzQzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1c9644e54b4fa89811bb420dfdb08940f9a4497d2a7847043afa17eaa1ffced5 |
| hovercard-subject-tag | pull_request:5436523753 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/S-AI-Projects/TheAlgorithms-JavaScript/pull/92/files |
| twitter:image | https://avatars.githubusercontent.com/u/322111215?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/322111215?s=400&v=4 |
| og:image:alt | Description This PR addresses task R50-T044 for feetToMeter. It introduces invariant and property-based regression tests across 100 bounded valid inputs generated with a deterministic seed, verifie... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06cadd0061c549662a50be90eb5baba7608f00f521574931eec01db0deb9e636 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/S-AI-Projects/TheAlgorithms-JavaScript git https://github.com/S-AI-Projects/TheAlgorithms-JavaScript.git |
| octolytics-dimension-user_id | 351892385 |
| octolytics-dimension-user_login | S-AI-Projects |
| octolytics-dimension-repository_id | 1444142713 |
| octolytics-dimension-repository_nwo | S-AI-Projects/TheAlgorithms-JavaScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 97086543 |
| octolytics-dimension-repository_parent_nwo | TheAlgorithms/JavaScript |
| octolytics-dimension-repository_network_root_id | 97086543 |
| octolytics-dimension-repository_network_root_nwo | TheAlgorithms/JavaScript |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6953c712585a8d7406b7695e48fffcb670fd241d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width