{"id":20153279,"url":"https://github.com/thinkinglabs/the-100percent-code-coverage-fallacy","last_synced_at":"2026-02-26T07:06:01.342Z","repository":{"id":145848346,"uuid":"101813933","full_name":"thinkinglabs/the-100percent-code-coverage-fallacy","owner":"thinkinglabs","description":"The fallacy of the 100% code coverage or once a metric becomes a target it looses it value","archived":false,"fork":false,"pushed_at":"2022-03-19T08:23:05.000Z","size":126,"stargazers_count":17,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-28T11:03:59.375Z","etag":null,"topics":["mutation-testing","test-coverage"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thinkinglabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-29T22:52:40.000Z","updated_at":"2024-09-05T00:34:02.000Z","dependencies_parsed_at":"2023-05-21T06:00:34.825Z","dependency_job_id":null,"html_url":"https://github.com/thinkinglabs/the-100percent-code-coverage-fallacy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thinkinglabs/the-100percent-code-coverage-fallacy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkinglabs%2Fthe-100percent-code-coverage-fallacy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkinglabs%2Fthe-100percent-code-coverage-fallacy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkinglabs%2Fthe-100percent-code-coverage-fallacy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkinglabs%2Fthe-100percent-code-coverage-fallacy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thinkinglabs","download_url":"https://codeload.github.com/thinkinglabs/the-100percent-code-coverage-fallacy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinkinglabs%2Fthe-100percent-code-coverage-fallacy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29851221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"online","status_checked_at":"2026-02-26T02:00:06.774Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mutation-testing","test-coverage"],"created_at":"2024-11-13T23:18:25.359Z","updated_at":"2026-02-26T07:06:01.337Z","avatar_url":"https://github.com/thinkinglabs.png","language":"Java","readme":"# the-100percent-code-coverage-fallacy [![Build Status](https://travis-ci.org/thinkinglabs/the-100percent-test-coverage-fallacy.svg?branch=master)](https://travis-ci.org/thinkinglabs/the-100percent-code-coverage-fallacy) [![Coverage Status](https://coveralls.io/repos/github/thinkinglabs/the-100-percent-code-coverage-fallacy/badge.svg?branch=master)](https://coveralls.io/github/thinkinglabs/the-100-percent-code-coverage-fallacy?branch=master)\n\nThis is the companion repo for the article [The Fallacy of the 100% code coverage](https://thinkinglabs.io/articles/2022/03/19/the-fallacy-of-the-100-code-coverage.html).\n\nIt showcases a system having 100% code coverage (as you can see from the coverage badge) using low-quality testing through [Assertion Free Tests](https://martinfowler.com/bliki/AssertionFreeTesting.html).\n\nThe system is an implementation of the [FizzBuzz Kata](http://codingdojo.org/kata/FizzBuzz/). It was grown using TDD. Once fully implemented, I removed all assertions (see [FizzBuzzTest](./src/test/java/io/thinkinglabs/FizzBuzzTest.java)). The system still has 100% code coverage. But when running the mutation tests none of the mutations is killed, resulting in zero useful tests.\n\n| Number of Classes | Line Coverage | Mutation Coverage |\n| ------------------|---------------|-------------------|\n| 1 | 100% 12/12 | 0% 0/14 |\n\n## Prerequisites\n\nThe system requires a JVM 1.8.\n\n(_I'm a bit lazy to upgrade to the latest JVM. Pull requests are welcome :D_)\n\nInstallation on macos:\n\n- Install [`jenv`](https://github.com/jenv/jenv) for managing JVMs.\n\n  ```bash\n  $ brew install jenv\n  $ jenv doctor\n  [OK] No JAVA_HOME set\n  [OK] Java binaries in path are jenv shims\n  [OK] Jenv is correctly loaded\n  jenv enable-plugin export\n  # restart your shell\n  ```\n\n- Install Java8\n\n   ```bash\n   brew install --cask temurin8\n   jenv add /Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home/\n   ```\n\n## Code Coverage report\n\nThe code coverage is measured using [JaCoCo](http://www.eclemma.org/jacoco/).\n\nTo obtain a code coverage report:\n\n```bash\n./gradlew test jacocoTestReport\n```\n\nThe coverage report can be found at `build/reports/jacoco/test/html/index.html`\n\n## Mutation Testing report\n\nThe mutation testing is done using [PIT](http://pitest.org/).\n\nTo obtain a mutation testing report:\n\n```bash\n./gradlew pitest\n```\n\nThe build will fail because not 100% of the mutations were killed. In the report you will see that the code coverage dropped to 0%.\n\nThe mutation testing report can be found at `build/reports/pitest/YYYYMMddhhmm/index.html`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkinglabs%2Fthe-100percent-code-coverage-fallacy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinkinglabs%2Fthe-100percent-code-coverage-fallacy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinkinglabs%2Fthe-100percent-code-coverage-fallacy/lists"}