--- id: cosmic-ray version: "8.7.0" license: Copyright (c) 2015-2017 Sixty North AS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) license_treatment: permissive maintenance: active --- # cosmic-ray — Mutation testing License: permissive · Maintenance: active · Downloads: 362.5K/mo ## What it is and what it does Cosmic Ray is a mutation testing framework for Python that systematically modifies your source code—changing operators, literals, and control flow—then reruns your test suite to see if the tests catch the mutations. The goal is to measure how well your tests actually validate your code: if a mutation goes undetected, it reveals a gap in test coverage that a passing test count alone would hide. You configure Cosmic Ray with your test runner and target modules, then let it generate and test mutations. It reports which mutations survived (your tests missed them) and which were killed (your tests caught them), giving you a mutation score that reflects test quality. The tool integrates with common Python testing frameworks and can be run from the command line or embedded in CI/CD pipelines. Use it for: - Assess whether your test suite actually validates the code it claims to cover, beyond line coverage metrics. - Identify weak spots in test logic where mutations slip through undetected. - Measure test quality improvements over time as you refine your test suite. - Validate test effectiveness before deploying critical code to production. - Generate mutation scores for quality gates in continuous integration workflows. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Cosmic Ray is a mutation testing tool that modifies your Python source code and runs your test suite against each mutation to measure test effectiveness and code quality. Yes, if you want to move beyond line coverage and understand whether your tests actually catch bugs. Cosmic Ray is actively maintained, has low install friction, and uses a permissive MIT license. It's a specialized tool—not for every project—but essential for teams that need confidence in test quality. No known security vulnerabilities. ## Install pip install cosmic-ray uv add cosmic-ray poetry add cosmic-ray ## Installing cosmic-ray Before you install: Low install friction with a pure Python wheel. Active maintenance with a recent release (5 days old) and steady repository activity. Supports Python 3.9 through 3.13. License in practice: MIT license (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install cosmic-ray from cosmic_ray.cli import main # Then run: cosmic-ray exec --test-runner pytest your_module Requires Python 3.9 or later and a test runner (pytest, unittest, etc.) configured for your project. Verify before relying: - Exact mutation types and transformations applied to source code - Performance characteristics on large codebases or slow test suites - Integration details with different test runners beyond pytest ## Package facts - License: Copyright (c) 2015-2017 Sixty North AS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 362.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags mutation testing python, test quality measurement, code mutation analysis, test suite effectiveness, python mutation tester, verify test coverage, mutation score calculator, test-quality, mutation-testing, code-analysis [View on SkillFed](https://skillfed.io/packages/cosmic-ray) · [View on PyPI](https://pypi.org/project/cosmic-ray/)