edgurgel/mimic
71.3
Strong · 3 October 2026
1.9k
lines of production code
Elixir
primary language
2
measurements over time
What this system is
Mimic is an Elixir library designed for mocking and stubbing modules in tests, enabling developers to replace real implementations with controlled alternatives. It supports both per-test isolation and global mode for multi-process scenarios, while ensuring accurate code coverage reporting by preserving and rewriting cover data during module replacement. The system provides a DSL for defining stubs and expectations, with experimental type checking and detailed call history retrieval to aid in test verification.
Behavioural changes
Major API overhaul and documentation rewrite for Mimic
The library has been significantly refactored to improve usability and performance, introducing a new \\_\using\\_\ macro that automatically imports Mimic functions and sets up verification callbacks. The public API has changed: \stub/3\ now validates that the function is exported by the original module rather than just checking if the module is mocked, and a new \stub/1\ variant allows stubbing all public functions in a module. Documentation has been expanded to explain multi-process collaboration via explicit allows and global mode, and internal architecture has shifted to use a Coordinator and Server alias for better structure.
lib · high confidence
Mimic 2.4.2: Fixes global mode race condition and enforces test-process usage
This release addresses a race condition in global mode where asynchronous release of the global lock could cause subsequent tests to fail with 'Expect cannot be called by the current process'. To prevent this, \set\_mimic\_global/1\ now raises if called outside a test process, ensuring the mode is properly managed via \on\_exit\ callbacks. Additionally, a memory leak caused by an incorrect ETS select clause has been fixed, and ExDoc markdown documentation support has been enabled.
(repo-wide) · high confidence
Mimic refactors internal architecture for performance and coverage accuracy
Mimic splits its internal state management into a Coordinator and partitioned Servers to improve concurrency and reduce serialization bottlenecks. The library now introduces a DSL module for more natural stub and expectation syntax, adds experimental type checking for stubs using the Ham library, and significantly improves coverage data handling by preserving and rewriting coverdata when modules are replaced. Additionally, it adds support for struct default values and enforce\_keys in mocked modules, and introduces a new API to retrieve call history.
lib/mimic · high confidence
Removal of legacy Mix.Config module
The project has removed the \config/config.exs\ file, which previously utilized the \Mix.Config\ module. This change eliminates the legacy configuration loading mechanism, likely as part of a migration to a newer configuration system or to clean up unused build-time configuration files.
config · high confidence
Test coverage
Added test support modules for cover analysis and stubbing scenarios; Expanded test coverage for DSL, type checking, and global mode lifecycle.
Dependencies
Mimic 2.4.2: Major dependency upgrades and Elixir 1.16 support
This release updates the Mimic library to version 2.4.2, raising the minimum supported Elixir version to \~\> 1.16. It significantly upgrades development dependencies, moving ex\_doc from 0.18.4 to 0.40.3 and introducing credo (\~\> 1.0) and ham (\~\> 0.3). The application configuration now includes the :tools application and uses a dedicated Application module, while documentation generation is enhanced with markdown formatters and updated metadata.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 71 → 71 (+0.7)
- Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.
Lenses
- Code Health 100 → 100 (-0.1)
- Architecture 100 → 100 (+0.0)
- Maturity 57 → 57 (+0.0)
- Readiness 67 → 69 (+2.4)
- Security 98 → 99 (+0.3)
Resolved (2)
- Documentation: no installation or build instructions (README.md)
- Off-boarding risk: anonymized user #1
New (2)
- Duplicated block (6 lines × 2) (lib/mimic/server.ex)
- Off-boarding risk: anonymized user #1
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
edgurgel/mimic was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit de4a615946e6ebbd47c43dfec5d9cb0093f4c13d — the exact code this score is about.
- Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-8fe32cd45d00.