CN116010285A - SDK automatic test method, system, medium and equipment for cloud password service product - Google Patents

SDK automatic test method, system, medium and equipment for cloud password service product Download PDF

Info

Publication number
CN116010285A
CN116010285A CN202310166024.3A CN202310166024A CN116010285A CN 116010285 A CN116010285 A CN 116010285A CN 202310166024 A CN202310166024 A CN 202310166024A CN 116010285 A CN116010285 A CN 116010285A
Authority
CN
China
Prior art keywords
test
module
sdk
communication connection
key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310166024.3A
Other languages
Chinese (zh)
Inventor
童瑶
张大伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Unita Information Technology Co ltd
Original Assignee
Beijing Unita Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Unita Information Technology Co ltd filed Critical Beijing Unita Information Technology Co ltd
Priority to CN202310166024.3A priority Critical patent/CN116010285A/en
Publication of CN116010285A publication Critical patent/CN116010285A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a cloud password service product SDK automatic test method, a system, a medium and equipment, wherein the system comprises an SDK construction module, a test management server, a test analysis module, a test case generation module, a test management module, a test execution module, a test report management module, a key analysis module and a password algorithm module, the SDK construction module is in communication connection with the test management server, the test management server is in communication connection with the test analysis module, the test analysis module is in communication connection with the test case generation module, the test case generation module is in communication connection with the test management module, the test management module is respectively in communication connection with the test execution module and the encryption algorithm verification unit, and the test execution module is in communication connection with the test report management module; the key analysis module is in communication connection with the key algorithm module. The invention simplifies the SDK test management link, improves the test efficiency and saves the test cost.

Description

SDK automatic test method, system, medium and equipment for cloud password service product
Technical Field
The invention relates to the technical field of cloud computing password service, in particular to a method, a system, a medium and equipment for automatically testing a cloud password service product SDK.
Background
With the adoption of the cloud computing technology, services can be provided for tenants efficiently and conveniently, the operation and maintenance cost of the industry is reduced, and cloud computing on the password service is a development trend. In a cloud computing environment, keys of cloud tenants are isolated and encrypted through independent equipment, the tenants cannot take clear keys, so that the algorithm correctness of verification of password service is difficult, application services of the tenants relate to multiple languages such as java, C/C++, GO and the like, and software development kits (Software Development Kit, SDK for short) provided for the tenants can provide adaptation of the multiple languages according to different languages of the application services of the tenants, so that the quality assurance of the multi-language SDK is more and more important, and the importance of testing is self-evident; the conventional SDK test needs to write test scripts according to different development languages, wherein, because the test codes need code writing tools of various languages, the test codes are stored, and the like, the error rate is high, the code version management is disordered, and the efficiency is low.
Disclosure of Invention
Therefore, the technical problem to be solved by the invention is to provide the cloud password service product SDK automatic test method, system, medium and equipment, so that the SDK test management link is simplified, the test efficiency is improved, and the test cost is saved.
In order to solve the technical problems, the invention provides the following technical scheme:
the automatic testing method for the SDK of the cloud password service product comprises the following steps:
s1) compiling an SDK source code and constructing and generating a dynamic link library file;
s2) storing the dynamic link library file successfully constructed in the step S1) to a test management server;
s3) analyzing and judging functions of the dynamic link library file stored in the test management server, analyzing grammar structures of different functions into API interfaces and generating an API description file;
s4) judging the API description file generated in the step S3) and generating a test case;
s5) arranging the test cases generated in the step S4) and completing configuration of a test environment and a test protocol;
s6) executing and completing the test case, and then returning a test result;
s7) analyzing the test result returned in the step S6) and generating a test report.
In the above method for automatically testing the SDK of the cloud password service product, in step S6), the test result includes an execution success log, an execution failure log, an overall execution passing rate and execution times.
In the above automatic testing method for the cloud password service product SDK, in step S5), before the test case is configured with the test environment and the test protocol, the correctness of the test protocol is verified.
In the above automatic testing method for the cloud password service product SDK, in step S3), the file format and the grammar content of the dynamic link library file are analyzed to judge the code language type supported by the SDK, the interface function name, the function type, the function specific parameter name, the parameter type and the annotation information are extracted, and stored in a configuration file in json mode, wherein the configuration file is used for generating and executing the test case.
The system for automatically testing the SDK of the cloud password service product by utilizing the automatic testing method of the SDK of the cloud password service product comprises the following steps:
the SDK construction module is used for compiling the SDK source code and constructing and generating a dynamic link library file;
the test management server is used for storing the dynamic link library file;
the test analysis module is used for analyzing and judging the functions of the dynamic link library file, analyzing the grammar structures of different functions into API interfaces and generating an API description file;
the test case generation module is used for judging the API description file and generating a test case;
the test management module is used for arranging the test cases and completing the configuration of the test environment and the test protocol;
the test execution module is used for executing the test case and returning a test result;
the test report management module is used for analyzing the test result and generating a test report;
the SDK construction module is in communication connection with the test management server, the test management server is in communication connection with the test analysis module, the test analysis module is in communication connection with the test case generation module, the test case generation module is in communication connection with the test management module, the test management module is in communication connection with the test execution module, and the test execution module is in communication connection with the test report management module.
The system also comprises an encryption algorithm verification unit, wherein the encryption algorithm verification unit comprises a key analysis module and a password algorithm module; the key analysis module is respectively in communication connection with the cryptographic algorithm module and the cloud tenant security isolation container; the key analysis module reversely decrypts the key encryption key through the encryption algorithm to obtain a plaintext key, and the cipher algorithm module carries out data encryption and decryption operation on the plaintext key obtained by the key analysis module through the encryption algorithm to obtain an encryption and decryption result to be verified.
The system comprises the test management module, the visual component and the man-machine interaction component.
The system comprises the test execution module, wherein the test execution module comprises a tester and a tested environment.
A computer readable storage medium having stored thereon a computer program which when executed by a processor implements the above method.
Computer device comprising a readable storage medium, a processor and a computer program stored on the readable storage medium and executable on the processor, which computer program, when executed by the processor, implements the method described above.
The technical scheme of the invention has the following beneficial technical effects:
1. the invention automatically identifies the multi-language SDK interface and manages and configures the multi-interface protocol, thereby reducing the use difficulty in test, simultaneously testing the SDKs with different language types and improving the test efficiency.
2. According to the invention, the SDK interface function is analyzed to automatically generate the corresponding test case, so that the effective coverage rate of the test case can be improved and the writing time of the test case can be saved.
3. According to the invention, through the encryption algorithm verification unit, the problem that the correctness of the encryption algorithm is not well verified is solved, and the test points which are not easy to cover in the cloud password product are enhanced.
4. The invention is compatible with the multi-language SDK service through the test platform management, thereby effectively reducing the complexity of test management and improving the test efficiency.
Drawings
FIG. 1 is a schematic diagram of an SDK automated test system for cloud password service products according to the present invention;
FIG. 2 is a flow chart of an automated test of a cloud cryptographic service product SDK;
fig. 3 is a schematic diagram of a computer device capable of performing an SDK automated test of a cloud cryptographic service product.
Detailed Description
The invention is further described below with reference to examples.
As shown in FIG. 1, the automatic test system for the cloud password service product SDK comprises an SDK construction module, a test management server, a test analysis module, a test case generation module, a test management module, a test execution module, a test report management module, a key analysis module and a password algorithm module, wherein the SDK construction module is in communication connection with the test management server, the test management server is in communication connection with the test analysis module, the test analysis module is in communication connection with the test case generation module, the test case generation module is in communication connection with the test management module, the test management module is respectively in communication connection with the test execution module and the encryption algorithm verification unit, and the test execution module is in communication connection with the test report management module; the key analysis module is in communication connection with the key algorithm module.
The system comprises an SDK construction module, a test management module, a test report management module and a test report management module, wherein the SDK construction module is used for compiling an SDK source code and constructing and generating a dynamic link library file, the test management server is used for storing the dynamic link library file, the test analysis module is used for analyzing and judging functions of the dynamic link library file and analyzing grammar structures of different functions into an API interface and generating an API description file, the test case generation module is used for judging the API description file and generating a test case, the test management module is used for arranging the test case and completing configuration of a test environment and a test protocol, the test execution module is used for executing the test case and returning test results, the test execution module comprises a tester and a tested environment, and the test report management module is used for analyzing the test results and generating a test report.
Specifically, in this embodiment, the SDK construction module is responsible for packaging, compiling, and constructing SDK source codes, and generates an SDK executable file and a dynamic link library; the test analysis module judges the code language types supported by the SDK by analyzing the file format and grammar content of the SDK, extracts interface function names, function types, function specific parameter names, parameter types and annotation information, and stores the interface function names, function types, function specific parameter names, parameter types and annotation information in a configuration file in json (JavaScript Object Notation, JS object numbered musical notation) mode, so that the automatic test system of the cloud password service product SDK can realize the test of the SDK of different language types; the test case generation module extracts generated json file reading function information, obtains parameter names and parameter data types through reading interface function information, generates different test items according to different data types, sequentially analyzes keys and values of json data, adds expected results of the keys into the test cases, and generates test case names according to the interface function names; besides the conventional case generation, the test case generation module can also generate a cryptographic algorithm correctness verification case according to the characteristics of the cloud cryptographic product, wherein the cryptographic algorithm correctness is mainly verification of cryptographic algorithms SM2 (256 bits), SM3 and SM4 (128 bits). The test analysis module is used for judging the code language types supported by the SDK by analyzing the file format and the grammar content of the SDK, so that the SDK with different language types can be tested, and the use difficulty in the test can be reduced and the test efficiency can be improved by configuring different test protocols. The corresponding test cases are automatically generated by utilizing the API description file generated by analysis, so that the effective coverage rate of the test cases can be improved, and the writing time of the test cases can be saved.
Because the keys of the cloud password products are all stored in a safe isolation environment, namely, each tenant is allocated with an independent key management container, the whole life cycle management of the tenant keys is carried out in the independent key management container, wherein each tenant is allocated with a key safety isolation module, a key safety storage module and a data storage module, and key management and key isolation are provided for each tenant, so that the cloud tenant cannot directly take the keys. In actual use, the cloud tenant only sends the credential information of the application, encryption and decryption of the data are invisible to the user, and the key of the cloud password service is stored in a safe isolation environment. According to the method, a corresponding plaintext key and a corresponding key type are automatically acquired through a key analysis module, cryptographic algorithm encryption and decryption operation is carried out through a cryptographic algorithm module by using the acquired plaintext key, an encryption algorithm result of a cloud tenant is compared with an encryption algorithm result after the operation of the encryption algorithm module, and the correctness of the algorithm is verified, wherein the key analysis module finds out a security isolation environment corresponding to the cloud tenant through applying key attribute information, and the secret key stored in the security isolation environment is obtained through a specific decryption mode. Specifically, the key analysis module is respectively in communication connection with the cryptographic algorithm module and the cloud tenant security isolation container, the key analysis module reversely decrypts the key encryption key through the encryption algorithm to obtain a plaintext key, and the cryptographic algorithm module performs encryption and decryption operation on the plaintext key obtained by the key analysis module through the encryption algorithm to obtain an encryption and decryption result to be verified.
In this embodiment, the test management module is responsible for arranging the whole test flow. The test management module comprises a visualization component and a man-machine interaction component, and testers can edit test items, such as the arrangement of test cases, through the visualization component and the man-machine interaction component. One test item represents the execution flow of a test case and an aggregate of a plurality of test cases. Operations that may be performed by the test management module include pulling SDK code and execution files, test case orchestration, test environment configuration (executor address, tenant application key and application key), test protocol configuration (national and non-national interfaces), test task trigger settings.
The test report management module is responsible for analyzing the result data returned by the execution environment, and visually represents a test overview of each test task, including an execution success log, an execution failure log, an overall execution passing rate and execution times.
The test execution module receives a task execution command of the test management module, pulls an SDK execution file of a corresponding language to a specified environment path in the execution machine, starts execution, and returns an acquired execution result to the test report management module.
The operation of the cloud password service product SDK automatic test by using the system is shown in fig. 2, and specifically comprises the following steps:
s1) compiling an SDK source code and constructing and generating a dynamic link library file;
s2) storing the dynamic link library file successfully constructed in the step S1) to a test management server;
s3) analyzing and judging functions of the dynamic link library file stored in the test management server, analyzing grammar structures of different functions into API interfaces and generating an API description file;
s4) judging the API description file generated in the step S3) and generating a test case;
s5) arranging the test cases generated in the step S4) and completing configuration of a test environment and a test protocol; before the test case is configured in the test environment and the test protocol, the correctness of the test protocol is verified;
s6) executing and completing the test cases, and then returning test results, wherein the test results comprise an execution success log, an execution failure log, an overall execution passing rate and execution times;
s7) analyzing the test result returned in the step S6) and generating a test report.
In the invention, the test management module controls the whole test flow, when a tester manages each link of the whole test flow through the man-machine interaction component in the test management module, after the configuration of the test environment and the test protocol is completed, the test management module can start the test, and each module carries out corresponding treatment.
Based on the above-mentioned automatic testing method for the cloud cryptographic service product SDK, correspondingly, in this example, a computer readable storage medium storing a computer program is also provided, where the computer program when executed by a processor implements the following steps: compiling SDK source codes, constructing and generating dynamic link library files, storing the dynamic link library files to a test management server, analyzing and judging functions of the dynamic link library files stored in the test management server, analyzing grammar structures of different functions into API interfaces, generating API description files, judging the generated API description files, generating test cases, arranging the test cases, verifying correctness of test protocols, completing configuration of test environments and the test protocols, executing and completing execution of the test cases, returning test results, analyzing the test results and generating test reports.
As shown in fig. 3, based on the above-mentioned automatic testing method for the SDK of the cloud cryptographic service product and the computer readable storage medium, in this embodiment, there is further provided a computer device, which includes a readable storage medium, a processor, and a computer program stored on the readable storage medium and executable on the processor, wherein the readable storage medium and the processor are both disposed on a bus, and when the processor executes the computer program, the processor implements the following steps: compiling SDK source codes, constructing and generating dynamic link library files, storing the dynamic link library files to a test management server, analyzing and judging functions of the dynamic link library files stored in the test management server, analyzing grammar structures of different functions into API interfaces, generating API description files, judging the generated API description files, generating test cases, arranging the test cases, verifying correctness of test protocols, completing configuration of test environments and the test protocols, executing and completing execution of the test cases, returning test results, analyzing the test results and generating test reports.
It is apparent that the above examples are given by way of illustration only and are not limiting of the embodiments. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. It is not necessary here nor is it exhaustive of all embodiments. While the obvious variations or modifications which are extended therefrom remain within the scope of the claims of this patent application.

Claims (10)

1. The automatic testing method for the SDK of the cloud password service product is characterized by comprising the following steps of:
s1) compiling an SDK source code and constructing and generating a dynamic link library file;
s2) storing the dynamic link library file successfully constructed in the step S1) to a test management server;
s3) analyzing and judging functions of the dynamic link library file stored in the test management server, analyzing grammar structures of different functions into API interfaces and generating an API description file;
s4) judging the API description file generated in the step S3) and generating a test case;
s5) arranging the test cases generated in the step S4) and completing configuration of a test environment and a test protocol;
s6) executing and completing the test case, and then returning a test result;
s7) analyzing the test result returned in the step S6) and generating a test report.
2. The method according to claim 1, wherein in step S6), the test result includes an execution success log, an execution failure log, an overall execution passing rate, and an execution number.
3. The method according to claim 2, wherein in step S5), the correctness of the test protocol is verified before the test environment and the test protocol are configured for the test case.
4. The automated testing method of the cloud cryptographic service product SDK according to any one of claims 1 to 3, wherein in step S3), the code language type supported by the SDK is determined by analyzing the file format and the syntax content of the dynamic link library file, and the interface function name, the function type, the function specific parameter name, the parameter type and the annotation information are extracted and stored in the configuration file in json mode.
5. A system for performing cloud cryptographic service SDK automation test using the cloud cryptographic service product SDK automation test method of claim 1, comprising:
the SDK construction module is used for compiling the SDK source code and constructing and generating a dynamic link library file;
the test management server is used for storing the dynamic link library file;
the test analysis module is used for analyzing and judging the functions of the dynamic link library file, analyzing the grammar structures of different functions into API interfaces and generating an API description file;
the test case generation module is used for judging the API description file and generating a test case;
the test management module is used for arranging the test cases and completing the configuration of the test environment and the test protocol;
the test execution module is used for executing the test case and returning a test result;
the test report management module is used for analyzing the test result and generating a test report;
the SDK construction module is in communication connection with the test management server, the test management server is in communication connection with the test analysis module, the test analysis module is in communication connection with the test case generation module, the test case generation module is in communication connection with the test management module, the test management module is in communication connection with the test execution module, and the test execution module is in communication connection with the test report management module.
6. The system of claim 5, further comprising an encryption algorithm verification unit comprising a key resolution module and a cryptographic algorithm module; the key analysis module is respectively in communication connection with the cryptographic algorithm module and the cloud tenant security isolation container; the key analysis module reversely decrypts the key encryption key through the encryption algorithm to obtain a plaintext key, and the cipher algorithm module carries out data encryption and decryption operation on the plaintext key obtained by the key analysis module through the encryption algorithm to obtain an encryption and decryption result to be verified.
7. The system of claim 5, wherein the test management module comprises a visualization component and a human-machine interaction component.
8. The system of claim 5, wherein the test execution module comprises a tester and an environment under test.
9. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program, when executed by a processor, implements the method of any of claims 1-4.
10. Computer device comprising a readable storage medium, a processor and a computer program stored on the readable storage medium and executable on the processor, characterized in that the computer program when executed by the processor implements the method according to any of claims 1-4.
CN202310166024.3A 2023-02-27 2023-02-27 SDK automatic test method, system, medium and equipment for cloud password service product Pending CN116010285A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310166024.3A CN116010285A (en) 2023-02-27 2023-02-27 SDK automatic test method, system, medium and equipment for cloud password service product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310166024.3A CN116010285A (en) 2023-02-27 2023-02-27 SDK automatic test method, system, medium and equipment for cloud password service product

Publications (1)

Publication Number Publication Date
CN116010285A true CN116010285A (en) 2023-04-25

Family

ID=86019517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310166024.3A Pending CN116010285A (en) 2023-02-27 2023-02-27 SDK automatic test method, system, medium and equipment for cloud password service product

Country Status (1)

Country Link
CN (1) CN116010285A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105227312A (en) * 2014-07-04 2016-01-06 上海交通大学深圳研究院 Intelligent code key password authentification extracting method
CN105718251A (en) * 2014-12-03 2016-06-29 苏宁云商集团股份有限公司 Multilanguage SDK (software development kit) automatic implementation method and system
CN112380145A (en) * 2021-01-15 2021-02-19 树根互联技术有限公司 SDK generation method, device, equipment and readable storage medium
CN112600669A (en) * 2020-12-16 2021-04-02 航天恒星科技有限公司 Cipher algorithm and conformity verification system
CN113961178A (en) * 2021-10-08 2022-01-21 招商银行股份有限公司 SDK interface testing method, system and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105227312A (en) * 2014-07-04 2016-01-06 上海交通大学深圳研究院 Intelligent code key password authentification extracting method
CN105718251A (en) * 2014-12-03 2016-06-29 苏宁云商集团股份有限公司 Multilanguage SDK (software development kit) automatic implementation method and system
CN112600669A (en) * 2020-12-16 2021-04-02 航天恒星科技有限公司 Cipher algorithm and conformity verification system
CN112380145A (en) * 2021-01-15 2021-02-19 树根互联技术有限公司 SDK generation method, device, equipment and readable storage medium
CN113961178A (en) * 2021-10-08 2022-01-21 招商银行股份有限公司 SDK interface testing method, system and computer readable storage medium

Similar Documents

Publication Publication Date Title
Lochau et al. Incremental model-based testing of delta-oriented software product lines
CN105279090B (en) Test script generation method and device applied to financial field
CN107291438B (en) Automatic script generation method and device and electronic equipment
Mariani et al. Dynamic detection of cots component incompatibility
Gebizli et al. Automated refinement of models for model-based testing using exploratory testing
CN108182359B (en) Method, device and storage medium for testing API security in trusted environment
EP2976865A1 (en) Firewall testing
Kormann et al. Automated test case generation approach for PLC control software exception handling using fault injection
CN110688313B (en) Fault injection method for software testing under VxWorks operating system
CN103530209B (en) A kind of code keypad automated testing method
CN112367220B (en) Interface testing method and device, storage medium and electronic equipment
Herbold et al. AutoQUEST--automated quality engineering of event-driven software
Jacky PyModel: Model-based testing in Python.
CN107622017A (en) A kind of analytic method of general automation software test
Villalobos-Arias et al. Evaluation of a model‐based testing platform for Java applications
CN114840410A (en) Test analysis method and device, computer equipment and storage medium
CN116010285A (en) SDK automatic test method, system, medium and equipment for cloud password service product
Kranzlmüller et al. NOPE: A nondeterministic program evaluator
CN105446867B (en) A kind of generation method and device of test data
CN115833964A (en) Performance test method and performance test system of dual-mode communication module
KR101843092B1 (en) Method for verifying multiple insurance computer system
CN110795338A (en) Automatic testing method and device based on front-end and back-end interaction and electronic equipment
CN110659215A (en) Open type industrial APP rapid development and test verification method
CN116974569A (en) Method, system and device for acquiring script
KR102307895B1 (en) Apparatus, method and program for opc ua specification compliance verification

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination