{"id":25776623,"url":"https://github.com/EvoSuite/evosuite","last_synced_at":"2025-02-27T06:06:51.653Z","repository":{"id":1953163,"uuid":"42201162","full_name":"EvoSuite/evosuite","owner":"EvoSuite","description":"EvoSuite - automated generation of JUnit test suites for Java classes","archived":false,"fork":false,"pushed_at":"2025-02-13T16:29:22.000Z","size":262086,"stargazers_count":853,"open_issues_count":163,"forks_count":348,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-02-13T17:23:44.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.evosuite.org","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EvoSuite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2015-09-09T19:53:09.000Z","updated_at":"2025-02-13T16:29:26.000Z","dependencies_parsed_at":"2023-07-05T19:32:39.873Z","dependency_job_id":"3c6b095f-62bf-4d8a-82c8-11fa71902900","html_url":"https://github.com/EvoSuite/evosuite","commit_stats":{"total_commits":7326,"total_committers":45,"mean_commits":162.8,"dds":0.6066066066066066,"last_synced_commit":"1fac6db67ab6e9dd430cda18ddaac0785206efea"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvoSuite%2Fevosuite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvoSuite%2Fevosuite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvoSuite%2Fevosuite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvoSuite%2Fevosuite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvoSuite","download_url":"https://codeload.github.com/EvoSuite/evosuite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987435,"owners_count":19889334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-02-27T06:01:27.802Z","updated_at":"2025-02-27T06:06:51.647Z","avatar_url":"https://github.com/EvoSuite.png","language":"Java","funding_links":[],"categories":["Test Generation","测试"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/EvoSuite/evosuite.svg?branch=master)](https://travis-ci.org/EvoSuite/evosuite)\n[![CircleCI](https://circleci.com/gh/EvoSuite/evosuite.svg?style=svg\u0026circle-token=f00c8d84b9dcf7dae4a82438441823f3be9df090)](https://circleci.com/gh/EvoSuite/evosuite)\n\n# What is EvoSuite?\n\nEvoSuite automatically generates JUnit test suites for Java classes, targeting code coverage criteria such as branch coverage. It uses an evolutionary approach based on a genetic algorithm to derive test suites. To improve readability, the generated unit tests are minimized, and regression assertions that capture the current behavior of the tested classes are added to the tests.\n\n# Using EvoSuite\n\nThere are different ways to use EvoSuite:\n\n### EvoSuite on the command line\n\nEvoSuite comes as an executable jar file which you can call as follows:\n\n```java -jar evosuite.jar \u003coptions\u003e```\n\nTo generate a test suite using EvoSuite, use the following command:\n\n```java -jar evosuite.jar \u003ctarget\u003e [options]```\n\nThe target can be a class:\n\n```-class \u003cClassName\u003e```\n\nor a package prefix, in which case EvoSuite tries to generate a test\nsuite for each class in the classpath that matches the prefix:\n\n```-prefix \u003cPrefixName\u003e```\n\nor a classpath entry, in which case EvoSuite tries to generate a test\nsuite for each class in the given classpath entry:\n\n```-target \u003cjar file or directory\u003e```\n\nThe most important option is to set the classpath, using standard Java\nclasspath syntax:\n\n```-projectCP \u003cclasspath\u003e```\n\nFor more options, see the\n[Documentation](http://www.evosuite.org/documentation/commandline/)\n\n```java -jar evosuite.jar -help```\n\n### EvoSuite on Docker Hub\n\nEvoSuite has a container image available on [Docker Hub](https://hub.docker.com/r/evosuite/evosuite). You can get the container by either pulling the image:\n\n```docker pull evosuite/evosuite:\u003cversion\u003e```\n\nor by manually building the image locally:\n\n```\ngit clone https://github.com/EvoSuite/evosuite.git\ncd evosuite\ndocker build -f Dockerfile.java8 . --tag evosuite/evosuite:latest-java-8\ndocker build -f Dockerfile.java11 . --tag evosuite/evosuite:latest-java-11\n```\n\nEvoSuite can be called as follows:\n\n```docker run -it -u ${UID} -v ${PWD}:/evosuite evosuite/evosuite:\u003cversion\u003e-java-\u003cjava_version\u003e \u003coptions\u003e```\n\nIt assumes that the project to be tested is located in the current directory the command is called from. The current directory, ```${PWD}```, is mapped to the ```/evosuite``` directory inside the container. This location is also the working directory of EvoSuite. All results will be mapped back to the directory on the host system. The ```-u ${UID}``` makes sure that the results have the same file ownership as the user initiating the command.\n\nWhen EvoSuite needs to be run in the background, you can use ```-d``` instead of ```-it```.\n\nThe ```\u003coptions\u003e``` are the same as they would be when EvoSuite is called from the command line.\n\n\n#### Large-scale experiment runner\n\nThe docker image also provides a tag (```evosuite/evosuite:\u003cversion\u003e-java-\u003cjava_version\u003e-experiment```) to run large-scale experiments easily. You can get this image by pulling it from [Docker Hub](https://hub.docker.com/r/evosuite/evosuite):\n\n```docker pull evosuite/evosuite:\u003cversion\u003e-experiment```\n\nor by manually building the image locally:\n\n```\ngit clone https://github.com/EvoSuite/evosuite.git\ncd evosuite\ngit checkout \u003cversion\u003e # e.g. git checkout v1.1.0\ndocker build -f Dockerfile.java8-experiment . --tag evosuite/evosuite:\u003cversion\u003e-java-8-experiment\ndocker build -f Dockerfile.java11-experiment . --tag evosuite/evosuite:\u003cversion\u003e-java-11-experiment\n```\n\nThe experiment runner can be called as follows:\n\n```docker run -it -u ${UID} -v ${PWD}:/evosuite evosuite/evosuite:\u003cversion\u003e-java-\u003cjava_version\u003e-experiment [\u003coptions\u003e] \u003cconfigurations_file\u003e \u003cprojects_file\u003e```\n\nand has the following options:\n```\n-h                       print help and exit\n-m \u003cmemory\u003e              memory limit (MB) for the EvoSuite client process (default: 2500)\n-p \u003cparallel_instances\u003e  limit for the number of parallel executions (default: 1)\n-r \u003crounds\u003e              number of rounds to execute each experiment (default: 1)\n-s \u003cseeds_file\u003e          file with the seeds for the executions of the experiment (default: SEEDS)\n-t \u003ctimeout\u003e             amount of time before EvoSuite process is killed (default: 10m)\n```\n\nIt assumes that the current working directory has a folder named ```projects```, which contains a sub-directory for each project under test containing all jar files for that project. The current directory should also contain two csv files:\n\n- One for the different configurations of the experiment, with two columns for the ```configuration_name``` and the ```user_configuration```\n- One for the classes per project, with two columns for the ```project_name``` (which should be the same as the folder under ```projects```) and the ```class``` (which should be the full class path)\n\nAn example of the directory structure would be:\n\n```\n./projects/\u003cproject1_name\u003e/\u003cfirst jar file of project 1\u003e\n./projects/\u003cproject1_name\u003e/\u003csecond jar file of project 1\u003e\n./projects/\u003cproject2_name\u003e/\u003cjar file of project 2\u003e\n./configurations.csv\n./projects.csv\n```\n\nconfigurations.csv:\n```\nconfiguration_name,user_configuration\ndefault60,-generateMOSuite -Dalgorithm=DynaMOSA -Dsearch_budget=60 -Dassertion_timeout=120 -Dminimization_timeout=120\ndefault120,-generateMOSuite -Dalgorithm=DynaMOSA -Dsearch_budget=120 -Dassertion_timeout=120 -Dminimization_timeout=120\n```\n\nThe configuration for the projectCP, class, seed, and output locations are already provided by the image.\n\nprojects.csv:\n```\nproject_name,class\n\u003cproject1_name\u003e,com.project1.application\n```\n\nThe image will put the output of the experiment in the following locations (inside the current directory):\n\n- ```./results/\u003cconfiguration_name\u003e/\u003cproject_name\u003e/\u003cclass_name\u003e/logs/\u003cround\u003e```\n- ```./results/\u003cconfiguration_name\u003e/\u003cproject_name\u003e/\u003cclass_name\u003e/reports/\u003cround\u003e/```\n- ```./results/\u003cconfiguration_name\u003e/\u003cproject_name\u003e/\u003cclass_name\u003e/tests/\u003cround\u003e/```\n\nWhen you run the image, it will automatically generate a SEEDS file in the current directory containing the seeds it used for the experiment. When you want to replicate the experiment, you can put that file back in the same place and instead of creating new seeds the image will now use those seeds.\n\nWhen you want to set a manual class path instead of letting the script determine one for you, a file called, 'CLASSPATH' can be put inside the individual project folders where the first line is the class path for that project.\n\nWhen EvoSuite needs to be run in the background, you can use ```-d``` instead of ```-it```.\n\n### EvoSuite plugin for Eclipse\n\nThere is an experimental Eclipse plugin available using the following\nupdate site: \u003chttp://www.evosuite.org/update\u003e\n\nTo see what the plugin does check out the [screencast](http://www.evosuite.org/documentation/eclipse-plugin/).\n\n### EvoSuite plugin for Maven\n\nEvoSuite has a Maven Plugin that can be used to generate new test cases as part of the build. This has at least the following advantages:\n\n1. Can run EvoSuite from Continuous Integration servers (eg Jenkins) with minimal configuration overheads\n2. Generated tests can be put directly on the classpath of the system based on the pom.xml files\n3. No need to install EvoSuite on local machine (Maven will take care of it automatically)\n\nFor more details, check the\n[documentation](http://www.evosuite.org/documentation/maven-plugin/)\n\n### EvoSuite plugin for IntelliJ\n\nCheck out the [documentation](http://www.evosuite.org/documentation/intellij-idea-plugin/).\n\n# Getting EvoSuite\n\nThe current release of EvoSuite (main EvoSuite jar file and plugins) is available for download at \u003chttp://www.evosuite.org/downloads/\u003e.\n\nTo access the source code, use the github repository:\n\n```git clone https://github.com/EvoSuite/evosuite.git```\n\n\n# Building EvoSuite\n\nEvoSuite uses [Maven](https://maven.apache.org/).\n\nTo build EvoSuite on the command line, install maven and then call\n\n```mvn compile```\n\nTo create a binary distribution that includes all dependencies you can\nuse Maven as well:\n\n```mvn package```\n\nTo build EvoSuite in Eclipse, make sure you have the [M2Eclipse](http://www.eclipse.org/m2e/) plugin installed, and import EvoSuite as Maven project. This will ensure that Eclipse uses Maven to build the project.\n\n\n# More Information\n\nUsage documentation can be found at \u003chttp://www.evosuite.org/documentation/\u003e\n\nThe developers' mailing list is hosted at \u003chttps://groups.google.com/forum/#!forum/evosuite\u003e\n\nEvoSuite has resulted in a number of publications, all of which are available at \u003chttp://www.evosuite.org/publications/\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEvoSuite%2Fevosuite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEvoSuite%2Fevosuite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEvoSuite%2Fevosuite/lists"}