Generating test Cases using Randoop automation

Source: Internet
Author: User
Tags gc overhead limit exceeded

Generating test Cases using Randoop automation

1. Overview

Generating test Cases using Randoop automation

2. Operation

    • Download the Randoop jar package;
    • Put the jar package and the class you want to test (such as Calculate.class) in the same folder;
    • Open a command-line prompt in this folder and enter the following command:
    Java-ea-classpath.; randoop-2.1. 4. jar; Calculate randoop.main.Main gentests--testclass=calculate--timelimit=

The results are as follows:

Generated a lot of test case within that folder

3. Using Randoop's Eclipse plugin

    • Download the plugin. I saw a randoop eclipse plugin on CSDN, and others said it would work, but I couldn't use it, and I knew why.
    • Put the Randoop_0.1.0.201107281327.jar into the Plugins folder in Eclipse.
    • Restart Eclipse, write a class, and run as---Create a new randoop configuration to find the class that will generate the test case

After running a lot of files, such as Randooptest***.java, running Randooptest.java in Java application, the Randoop automatically generated test cases are run successfully.

(the error in the figure is that the GC overhead limit exceeded error occurred after running Randooptest.java)

Generating test Cases using Randoop automation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.