一种代码的测试方法和装置

An automated testing method that parses the code syntax tree and replaces it with proxy functions for aspect configuration logic solves the problem of high overhead for manual testing after server-side code updates, achieving efficient and accurate vulnerability detection.

CN113553250BActive Publication Date: 2026-07-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2020-04-23
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

In existing technologies, server-side code updates require manual testing, which is costly and inefficient.

Method used

By parsing the syntax tree of the code, the nodes that require aspect configuration are identified and replaced with proxy functions. The aspect configuration logic is then executed to simulate the running of the code, generate test results, and automatically detect vulnerabilities in the code.

Benefits of technology

It enables fast and accurate code testing without human intervention, reducing testing overhead and improving testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113553250B_ABST
    Figure CN113553250B_ABST
Patent Text Reader

Abstract

本发明提供了一种代码的测试方法、装置、电子设备及计算机可读存储介质;方法包括:解析代码,确定所述代码的语法树中需要进行切面配置的节点;生成代理函数,其中,所述代理函数包括所述代码的切面配置逻辑;将位于所述需要进行切面配置的节点处的原函数替换为所述代理函数;执行所述代理函数包括的切面配置逻辑以模拟运行所述代码,接收所述代理函数输出的模拟执行结果;将所述模拟执行结果与期望执行结果进行匹配,生成所述代码的测试结果。通过本发明,能够高效且准确的对代码进行测试。
Need to check novelty before this filing date? Find Prior Art