Supercharge Your Innovation With Domain-Expert AI Agents!

A method for generating unit test cases based on method similarity

A technology of unit testing and test cases, which is applied to the generation of unit test cases in software testing, software testing and program analysis, and can solve the problems of low quality and slow generation of unit test cases

Active Publication Date: 2022-05-17
NANJING MUCE INFORMATION TECH
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] The present invention effectively solves the problems of low quality and slow generation speed of automatically generated unit test cases by providing a method for generating unit test cases based on method similarity, thereby helping software developers to improve software testing efficiency and ensure software quality

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
  • A method for generating unit test cases based on method similarity
  • A method for generating unit test cases based on method similarity
  • A method for generating unit test cases based on method similarity

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0115] In order to better understand the technical content of the present invention, specific embodiments are given and described below in conjunction with the accompanying drawings.

[0116] figure 1 It is a flow chart of a method for generating unit test cases based on method similarity implemented by the present invention.

[0117] A method for generating unit test cases based on method similarity is characterized by comprising the following steps.

[0118] S1 test cluster analysis, build the class hierarchy graph CHG of the source program based on the interface, the implementation between classes, and the generalization relationship. On this basis, analyze the access rights of members and methods of each class, and select non-private ones Members and methods build sets of accessible members and sets of accessible methods, which provide basic elements for subsequent building of unit test cases.

[0119] S2 distance matrix construction, extracting the return value type and...

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 relates to a method for generating unit test cases based on method similarity. This method analyzes the access rights of the members and methods of each class in the source program, and generates a test cluster that can be automatically generated by the test case, including the set of accessible members and the set of accessible methods; on this basis, through a variety of distance analysis methods Measuring the distance between return value types and parameters of accessible method centralized methods to construct return value type distance matrix and parameter distance matrix; finally, combined with genetic algorithm, unit test case generation work is carried out under the guidance of each distance matrix, and finally automatically generated A set of high-quality unit test cases to help software developers carry out unit tests. The purpose of the invention is to solve the existing problems of low quality and slow generation speed of automatically generated unit test cases, so as to help software developers improve software testing efficiency and ensure software quality.

Description

technical field [0001] The invention belongs to the field of software testing and program analysis, and is especially suitable for the field of unit test case generation in software testing. Methods of Assuring Software Quality. Background technique [0002] Software testing is one of the necessary steps in developing high-quality software. During the research and development process, the software needs to go through the stages of unit testing, integration testing, system testing, regression testing, etc. to ensure the quality of each basic unit and interface of the software, verify the correctness of software functions and interfaces, and repair the errors found. . Among them, unit testing is a very important stage in the software testing process: on the one hand, because the later the error is found, the higher the repair cost of the software, the unit testing in the early stage of testing has an important impact on the overall cost of software testing and software devel...

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
Patent Type & Authority Patents(China)
IPC IPC(8): G06F11/36
CPCG06F11/3684
Inventor 陈振宇王兴亚孙伟松赵源房春荣
Owner NANJING MUCE INFORMATION TECH
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