Code positioning method and device for test case, storage medium and electronic device

By performing semantic analysis on code files and test cases and using semantic feature information matching, the problem of low accuracy and efficiency in locating code using traditional test cases is solved, achieving fast and accurate code location and improving testing efficiency.

CN116795666BActive Publication Date: 2026-06-05GUANGZHOU SHIZHEN INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU SHIZHEN INFORMATION TECH CO LTD
Filing Date
2022-03-14
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In traditional software testing, test cases suffer from low accuracy and efficiency when locating code, especially since exceptions may occur during test case execution, leading to difficulties in code association and long processing times.

Method used

By performing semantic analysis on code files and test cases, and using semantic feature information matching, similarity is calculated to locate the target code. This includes performing semantic analysis on the annotation information of the code files to obtain the first semantic feature information, and calculating the similarity with the second semantic feature information of the test cases to determine the location of the target code.

Benefits of technology

It improves the accuracy and efficiency of code location through test cases, allowing for quick code location without executing test cases, reducing labor costs and increasing testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116795666B_ABST
    Figure CN116795666B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a code positioning method and device of a test case, a storage medium and an electronic device, the method comprises the following steps: obtaining a code file and a test case; the code file comprises a plurality of lines of code and a plurality of pieces of annotation information corresponding to the plurality of lines of code; performing semantic analysis on the plurality of pieces of annotation information in the code file to obtain a plurality of pieces of semantic information; wherein the semantic information comprises first semantic feature information and corresponding code location information; performing semantic analysis on the test case to obtain second semantic feature information; calculating the similarity of the plurality of pieces of first semantic feature information and the second semantic feature information respectively, and taking the code location information corresponding to the first semantic feature information with a preset threshold as target code location information; obtaining corresponding target code according to the target code location information; and displaying the test case and the target code, thereby improving the accuracy of positioning the code of the test case.
Need to check novelty before this filing date? Find Prior Art