Giter Club home page Giter Club logo

merrily01 / auto-unit-test-case-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from traas-stack/auto-unit-test-case-generator

0.0 1.0 0.0 175.52 MB

Auto-Unit-Test-Case-Generator automatically generates high-level code-coverage JUnit test suites for Java, widely used within the ANT Group.

License: GNU Lesser General Public License v3.0

Shell 0.02% JavaScript 0.50% Python 0.07% Java 99.18% R 0.10% CSS 0.11% HTML 0.01% Batchfile 0.01%

auto-unit-test-case-generator's Introduction

中文README传送门

What is Auto-Unit-Test-Case-Generator

Auto-Unit-Test-Case-Generator generates JUnit test suites for Java class just as its name. During test generation, Auto-Unit-Test-Case-Generator aims to generate high code-coverage (e.g., Branch Coverage and Line Coverage) unit test suites with full automation. This tools is widely used in ANT Group, supports automatic generation of unit tests for more than 1000 projects. Advantages of Auto-Unit-Test-Case-Generator:

  • High coverage and assertion level

The average line coverage within Ant Group by using the generator is over 60% The unit test generated by this tool is highly effective assertions during the practice in Ant Group

  • Easy to use

The process of generation of this tool is fully automated.

Main Features

Auto-Unit-Test-Case-Generator is developed based on EvoSuite. In Auto-Unit-Test-Case-Generator, we optimized several algorithms to achieve higher code coverage, more efficiency and effectiveness, better structure of test case. Main Features of Auto-Unit-Test-Case-Generator:

  • Suitable for Spring Framework

In Auto-Unit-Test-Case-Generator, we can generate complete mock statements for autowired fields to form meaningful test case, avoid throwing NullPointerException.

  • More efficiency and effectiveness

Like EvoSuite, Auto-Unit-Test-Case-Generator also use the Search Based Software Testing(SBST) as main algorithm framework. However, random search algorithm will encounter performance problems when class under test uses lots of String which has almost infinite search space. In Auto-Unit-Test-Case-Generator, we proposed and achieved accutare search algorithm to achieve higher efficiency and effectiveness.

  • Better structure of test case

In Auto-Unit-Test-Case-Generator, the optimal call sequence algorithm is used through the initialization, insertion, modification and deletion of test case statements, so that the structure of test case is more readable and logical.

Building Auto-Unit-Test-Case-Generator

To install Auto-Unit-Test-Case-Generator by using Maven, run:

mvn clean install -Dmaven.test.skip=true

Copy smartut.jar to your own Execution path, for example, current path.

cp ${user.home}/.m2/repository/org/smartut/smartut-master/1.1.0/smartut-master-1.1.0.jar smartut.jar

Using Auto-Unit-Test-Case-Generator

Prepare dependencies

Before using smartut.jar to generate cases, You need to execute the following commands to prepare dependencies in project under test.

mvn clean compile
mvn clean install -Dmaven.test.skip=true
mvn dependency:copy-dependencies

Setup

To generate unit test suites, the generator needs to be set up by project classpath first.

java -jar ./smartut.jar -setup example/target/classes/ example/target/dependency/*.jar

Generate for a specific class

You can run this command to generate unit test suites for a specific class

java -jar ./smartut.jar -class com.alipay.test.example

Generate for entire folder

You can run this command to generate unit test suites for all classes in classes folder:

java -jar ./smartut.jar -target example/target/classes/

Contact us

If you encounter any problems during use this generator, please contact us via email: [email protected]

Also, Auto-Unit-Test-Case-Generator is providing Software-as-a-Service (SaaS). It supports the full lifecycle/evolution of unit test cases, including test case generation, execution,iteration and regression analysis . All stages are triggered automatically by simply providing Github or Gitee link. You can visit our SaaS website through https://smartunit.opentrs.com.

auto-unit-test-case-generator's People

Contributors

gofraser avatar arcuri82 avatar jose avatar jmrojas avatar sinaa avatar schweikl avatar jgaleotti avatar baderv avatar prathmesh-halgekar avatar qindanyang avatar hailianzhl avatar minhaogo avatar apanichella avatar x3k6a2 avatar dts-dd avatar bachenbenno avatar nasseralbunian avatar mitchellolsthoorn avatar monperrus avatar voglsebastian avatar fwdekker avatar kifetew avatar wild-fly avatar ap-hunt avatar flx5 avatar agsb2333 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.