Supercharge Your Innovation With Domain-Expert AI Agents!

Java unit test case generation method and device

A technology for unit testing and generating devices, which is applied in software testing/debugging, error detection/correction, instruments, etc. It can solve the cumbersome and complicated problems of writing test codes, achieve the effect of releasing development pressure and improving work efficiency

Pending Publication Date: 2021-06-22
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] This application provides a method and device for generating Java unit test cases to at least solve the problem of cumbersome and complicated test code writing in current unit tests

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Java unit test case generation method and device
  • Java unit test case generation method and device
  • Java unit test case generation method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0068] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

[0069] At present, the automatic generation framework of unit test cases on the market only supports the generation of simple unit tests, and cannot be compatible with more scenarios. The architecture of many complex projects is also very complicated, the code organization is intertwined, and it does not support complex project levels such as mock projects. scene.

[0070] In order to solve the above problems, the application provides a Java unit test case gen...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a Java unit test case generation method and device, which can be applied to the financial field. The method comprises the following steps: generating a service AST library and a test AST library according to an obtained service source code and a corresponding test code; matching the service AST in the service AST library with the test AST in the test AST library, and screening the service AST which is not successfully matched; generating a test code for the service AST which is not successfully matched; generating a corresponding test AST, and filling the test AST into a test AST library; and traversing the service AST library and the test AST library to check whether the test coverage rate is met. According to the method, the unit test case meeting the specification can be automatically generated, various index requirements such as the code line coverage rate and the change coverage rate are met, iteration is carried out on the basis of existing test codes, and the original test case is not affected.

Description

technical field [0001] The application belongs to the technical field of system testing, and in particular, relates to a method and device for generating Java unit test cases. Background technique [0002] Unit testing is an important part of the UTDD approach. At present, unit testing has the problem of cumbersome and complicated writing of test codes, and developers often have to write test codes that are several times the amount of business code. Moreover, the structure of many complex projects is also very complicated, the code organization is intertwined, and the commonly used mock tools are difficult to use. It is not easy to write a unit test case that is correct, fully functional and has a coverage rate. [0003] Currently, the automatic generation frameworks for unit test cases on the market only support the generation of simple unit tests, and cannot be compatible with more scenarios, nor do they support complex scenarios at the project level. Contents of the in...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F11/36
CPCG06F11/3684Y02D10/00
Inventor 王鑫冯程嵇海锋倪志华
Owner INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More