{"id":46442869,"url":"https://github.com/unittesting-nonpublic/viscount","last_synced_at":"2026-03-05T22:18:06.106Z","repository":{"id":246045015,"uuid":"818332865","full_name":"unittesting-nonpublic/viscount","owner":"unittesting-nonpublic","description":"A Direct Method Call Coverage Tool for Java","archived":false,"fork":false,"pushed_at":"2025-02-07T19:03:33.000Z","size":30269,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-07T20:20:59.962Z","etag":null,"topics":["coverage-report","unit-testing"],"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/unittesting-nonpublic.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":"2024-06-21T15:59:37.000Z","updated_at":"2025-02-07T19:03:37.000Z","dependencies_parsed_at":"2025-01-19T17:20:36.407Z","dependency_job_id":"88568c83-01b4-4a88-98cd-e0d90bb5491d","html_url":"https://github.com/unittesting-nonpublic/viscount","commit_stats":null,"previous_names":["unittesting-nonpublic/viscount"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/unittesting-nonpublic/viscount","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unittesting-nonpublic%2Fviscount","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unittesting-nonpublic%2Fviscount/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unittesting-nonpublic%2Fviscount/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unittesting-nonpublic%2Fviscount/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unittesting-nonpublic","download_url":"https://codeload.github.com/unittesting-nonpublic/viscount/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unittesting-nonpublic%2Fviscount/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30152507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T21:15:50.531Z","status":"ssl_error","status_checked_at":"2026-03-05T21:15:11.173Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["coverage-report","unit-testing"],"created_at":"2026-03-05T22:18:05.586Z","updated_at":"2026-03-05T22:18:06.098Z","avatar_url":"https://github.com/unittesting-nonpublic.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Viscount \u0026mdash; A Direct Method Call Coverage for Java Project\n[![codecov-python](https://codecov.io/github/unittesting-nonpublic/viscount/branch/main/graph/badge.svg?token=tkq655ROg3)](https://app.codecov.io/github/unittesting-nonpublic/viscount)\n[![DOI](https://zenodo.org/badge/DOI/10.1109/ICSME58944.2024.00101.svg)](https://doi.org/10.1109/ICSME58944.2024.00101)\n[![DOI](https://zenodo.org/badge/DOI/10.1109/ICSME58944.2024.00037.svg)](https://doi.org/10.1109/ICSME58944.2024.00037)\n![GitHub Licens[schematic.tex](images%2Fschematic.tex)e](https://img.shields.io/github/license/unittesting-nonpublic/viscount)\n\nThis repository contains the code for Viscount. It is a tool designed to analyze Java test suites by measuring the extent to which test cases directly invoke methods in the production code, categorized by their visibility levels --- public APIs or non-public methods (protected, package-private, private). This analysis helps identify tests that may be tightly coupled to implementation details, which is generally [discouraged](https://abseil.io/resources/swe-book/html/ch12.html#test_via_public_apis) in unit testing practices. It uses dynamic Java bytecode instrumentation ([Javassist](https://github.com/jboss-javassist/javassist)) to execute and analyze the test code, and static analysis ([Spoon](https://github.com/INRIA/spoon)) to examine production code method visibility.\n\nFull Research Paper - [![DOI 10.1109/ICSME58944.2024.0003](https://img.shields.io/badge/10.1109%2FICSME58944.2024.00037-black?logo=DOI)](https://doi.org/10.1109/ICSME58944.2024.00037) \n(ICSME'24 Research Track)\n\nViscount Demo Paper - [![DOI 10.1109/ICSME58944.2024.00101](https://img.shields.io/badge/10.1109%2FICSME58944.2024.00101-black?logo=DOI)](https://doi.org/10.1109/ICSME58944.2024.00101)\n(ICSME'24 Tool Demo Track)\n\n### Requirements\n- Java 8\n- Maven 3\n- Python3\n- `pip3 install -r requirements.txt`\n- Maven-build project\n\nOptional: Docker\n\n\n### [Demo tutorial](https://www.youtube.com/watch?v=ZUyRtiUnbsU)\n\n## Run\n### Docker\nViscount can be called using [Docker](https://www.docker.com/101-tutorial/) (container image - executable without root privilege, without the need to install any additional dependencies natively) as follows:\n\n```\ndocker build -t viscount-image .\n```\n\n```\ndocker run -v \u003cpath_to_project_folder\u003e:/home/user/\u003cproject_folder\u003e \\\n  -v \u003cpath_to_report_folder\u003e:/home/user/\u003creportfolder\u003e \\\n  viscount-image \u003cproject_name\u003e /home/user/\u003cprojectfolder\u003e /home/user/\u003creportfolder\u003e\n```\n\n#### Requirements - [maven:3-open-jdk-8](https://hub.docker.com/layers/library/maven/3-openjdk-8/images/sha256-29cc4c106af036b3727fad911174511d5af3103710419e1fd3d0718aa217f7ae?context=explore) image\n\n### Execution Without Docker\n\nSetting up the environment variables is required:\n1. `MAVEN_HOME=\"PATH_TO_MVN\"`\n2. `JAVA_HOME=\"PATH_TO_JAVAJDK\"`\n\nThe main entry point of the tool is [viscount.sh](https://github.com/unittesting-nonpublic/viscount/blob/main/viscount.sh).\n\n```\nbash viscount.sh project-name /full/path/to/\u003cproject-name\u003e /full/path/to/\u003creportfolder\u003e\n```\n### Output\n\nThe output is two TSV files and a direct method call coverage (PDF) report in the `\u003creportfolder\u003e`\n\n## Running example\nBy simply running viscount-example,\n\n```\nbash viscount.sh viscount-example /viscount/repo/directory/viscount-example /viscount/repo/directory/result\n```\n\nyou can also clone [square-javapoet](https://github.com/square/javapoet/tree/f27ad04c9e7de4ec7b207979cfd47ec1d878ca03) and run\n```\nbash viscount.sh javapoet /viscount/repo/directory/javapoet /viscount/repo/directory/result\n```\n\nanother way is to follow the steps to run using Docker.\n\n## How to Contribute\nTo contribute to our work at [unittesting-nonpublic/viscount](https://github.com/unittesting-nonpublic/viscount), please follow these steps:\n\n1. Fork and Clone: [Fork](https://help.github.com/articles/fork-a-repo/) the repository to your GitHub account, and [clone](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) it to your local machine.\n2. Create a branch: In your forked repository, [create a new branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository) with a descriptive name. Make your changes and ensure your commit messages clearly describe them.\n3. Push and Resolve Conflicts: [Push your changes](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository) to the new branch in your fork. Compare your branch with the main branch of this repository, and resolve any conflicts.\n4. Submit a draft [pull request](https://docs.github.com/en/get-started/quickstart/hello-world#opening-a-pull-request) from your branch. In the description, [link]((https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls) ) it to any related issues.\n\nWe appreciate any contributions!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funittesting-nonpublic%2Fviscount","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funittesting-nonpublic%2Fviscount","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funittesting-nonpublic%2Fviscount/lists"}