Nothing Special   »   [go: up one dir, main page]

CN113900955A - Automatic testing method, device, equipment and storage medium - Google Patents

Automatic testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN113900955A
CN113900955A CN202111266454.XA CN202111266454A CN113900955A CN 113900955 A CN113900955 A CN 113900955A CN 202111266454 A CN202111266454 A CN 202111266454A CN 113900955 A CN113900955 A CN 113900955A
Authority
CN
China
Prior art keywords
test
function
scene
tested
log
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
CN202111266454.XA
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202111266454.XA priority Critical patent/CN113900955A/en
Publication of CN113900955A publication Critical patent/CN113900955A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to artificial intelligence and provides an automatic testing method, device, equipment and storage medium. The method can receive a test request, and identify a function to be tested and a scene to be tested of a test system according to the test request; acquiring a historical test log; analyzing the test parameters in the historical test log to obtain a multidimensional array; traversing the multi-dimensional array according to the function to be tested to obtain a plurality of user lists, wherein the user lists comprise historical test account numbers; extracting list indexes of the plurality of user lists according to preset index positions; screening out a target account matched with the scene to be tested from the historical test accounts according to the list index; and testing the test system based on the target account to obtain a test result. The invention can improve the automatic testing efficiency. In addition, the invention also relates to a block chain technology, and the test result can be stored in the block chain.

Description

Automatic testing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of test technologies, and in particular, to an automated test method, an automated test apparatus, an automated test device, and a storage medium.
Background
With the development of artificial intelligence, an autonomous testing scheme of the system is also generated. However, in the current autonomous test scheme, since the logged test account cannot be located according to the test function and cannot be perceived in a specific scene to which the test account is applicable, the logged test account cannot be repeatedly utilized, so that a corresponding test account needs to be generated according to the test function and the test scene in the autonomous test scheme, and the test efficiency of the autonomous test is reduced.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an automated testing method, apparatus, device and storage medium, which can improve the efficiency of automated testing.
In one aspect, the present invention provides an automated testing method, including:
receiving a test request, and identifying a function to be tested and a scene to be tested of a test system according to the test request;
acquiring a historical test log;
analyzing the test parameters in the historical test log to obtain a multidimensional array;
traversing the multi-dimensional array according to the function to be tested to obtain a plurality of user lists, wherein the user lists comprise historical test account numbers;
extracting list indexes of the plurality of user lists according to preset index positions;
screening out a target account matched with the scene to be tested from the historical test accounts according to the list index;
and testing the test system based on the target account to obtain a test result.
According to a preferred embodiment of the present invention, the identifying the function to be tested and the scene to be tested of the test system according to the test request includes:
acquiring a system identification code of the test system and request generation time of the test request from the test request;
determining the function to be tested from a function demand table according to the system identification code and the request generation time;
acquiring a function field of the function to be tested, and acquiring a preset scene in a preset list;
matching the function field with scene fields in the preset scene, and determining at least one scene field successfully matched with the function field in the preset scene as a target field;
counting the field number of each target field;
and determining the preset scene with the maximum field number as the scene to be detected.
According to a preferred embodiment of the present invention, the determining the function to be tested from the function requirement table according to the system identification code and the request generation time includes:
acquiring information corresponding to the system identification code from the function requirement table as information to be screened, wherein the information to be screened comprises the mapping relation between the test system and the system function at a plurality of times;
acquiring all time information from the information to be screened as initial selection time;
acquiring the time closest to the request generation time from the initial time as a first time, and acquiring the time closest to the first time from the initial time as a second time;
calling a system function corresponding to the first time from the information to be screened as a first function, and calling a system function corresponding to the second time from the function requirement table as a second function;
and comparing the first function with the second function, and determining the first function different from the second function as the function to be tested.
According to a preferred embodiment of the present invention, the obtaining the historical test log comprises:
acquiring a label indicating a test as a test label;
and acquiring a log containing the test label from a preset log library as the historical test log.
According to a preferred embodiment of the present invention, the analyzing the test parameters in the historical test log to obtain the multidimensional array includes:
identifying a log object of the historical test log;
parsing the test parameters from the historical test log based on the log object;
identifying a log hierarchy of the test parameters in the historical test log;
and writing the test parameters into a preset array according to the log level to obtain the multidimensional array.
According to a preferred embodiment of the present invention, the multidimensional array includes a plurality of array menus, and the traversing the multidimensional array according to the function to be tested to obtain a plurality of user lists includes:
acquiring a function identification code of the function to be tested;
writing the function identification code into a preset statement to generate a query statement;
traversing the multidimensional array based on the query statement to obtain an array menu matched with the function identification code as a function menu;
and screening all users associated with the function menu from the multi-dimensional array to obtain the plurality of user lists.
According to a preferred embodiment of the present invention, the screening out, from the historical test account numbers according to the list index, a target account number that matches the scene to be tested includes:
acquiring a label corresponding to the list index from a preset label library as a list scene;
comparing the scene to be detected with the list scene;
if the scene to be detected is different from the list scene, acquiring a fine-grained scene of the list scene, and comparing the scene to be detected with the fine-grained scene;
and if the scene to be tested is the same as the fine-grained scene, determining the historical test account in the user list where the list index is located as the target account.
In another aspect, the present invention further provides an automatic testing apparatus, including:
the identification unit is used for receiving the test request and identifying the function to be tested and the scene to be tested of the test system according to the test request;
an acquisition unit configured to acquire a history test log;
the analysis unit is used for analyzing the test parameters in the historical test log to obtain a multidimensional array;
the traversal unit is used for traversing the multi-dimensional array according to the function to be tested to obtain a plurality of user lists, and the user lists comprise historical test account numbers;
an extracting unit, configured to extract list indexes of the plurality of user lists according to preset index positions;
the screening unit is used for screening a target account matched with the scene to be tested from the historical test accounts according to the list index;
and the test unit is used for testing the test system based on the target account to obtain a test result.
In another aspect, the present invention further provides an electronic device, including:
a memory storing computer readable instructions; and
a processor executing computer readable instructions stored in the memory to implement the automated testing method.
In another aspect, the present invention further provides a computer-readable storage medium, in which computer-readable instructions are stored, and the computer-readable instructions are executed by a processor in an electronic device to implement the automated testing method.
According to the technical scheme, the multi-dimensional array is constructed, label information is not stored in the multi-dimensional array, so that the occupied memory of the multi-dimensional array can be saved, the multi-dimensional array is traversed through the function to be tested, corresponding function information can be obtained based on the storage position of the function information in the multi-dimensional array and is compared with the function to be tested, the function information is not required to be obtained through further analyzing the label information, the obtaining efficiency of a plurality of user lists can be improved, the historical test account numbers are screened through the scene to be tested, the historical test account numbers corresponding to the function to be tested and the scene to be tested at the same time can be obtained, the target account numbers are used for testing the function to be tested, and the account numbers corresponding to the function to be tested and the scene to be tested are not required to be generated in a customized mode, therefore, the test efficiency of the test system can be improved.
Drawings
FIG. 1 is a flow chart of the automated testing method of the present invention.
FIG. 2 is a functional block diagram of the preferred embodiment of the automated test equipment of the present invention.
FIG. 3 is a schematic structural diagram of an electronic device implementing an automated testing method according to a preferred embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of the automated testing method according to the preferred embodiment of the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
The automated testing method can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The automated testing method is applied to one or more electronic devices, which are devices capable of automatically performing numerical calculation and/or information processing according to computer readable instructions set or stored in advance, and the hardware thereof includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The electronic device may be any electronic product capable of performing human-computer interaction with a user, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), a game machine, an interactive Internet Protocol Television (IPTV), a smart wearable device, and the like.
The electronic device may include a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network electronic device, an electronic device group consisting of a plurality of network electronic devices, or a Cloud Computing (Cloud Computing) based Cloud consisting of a large number of hosts or network electronic devices.
The network in which the electronic device is located includes, but is not limited to: the internet, a wide area Network, a metropolitan area Network, a local area Network, a Virtual Private Network (VPN), and the like.
And S10, receiving the test request, and identifying the function to be tested and the scene to be tested of the test system according to the test request.
In at least one embodiment of the invention, the test request may be automatically triggered to be generated when a new function in the test system completes development. The information carried in the test request includes, but is not limited to: and indicating the identification code of the test system and generating the time of the test request.
The test system refers to a system which needs to perform functional test.
The function to be tested refers to a function to be tested in the test system. The scene to be tested refers to a scene needing to be tested in the test system.
In at least one embodiment of the present invention, the identifying, by the electronic device, the function to be tested and the scene to be tested of the test system according to the test request includes:
acquiring a system identification code of the test system and request generation time of the test request from the test request;
determining the function to be tested from a function demand table according to the system identification code and the request generation time;
acquiring a function field of the function to be tested, and acquiring a preset scene in a preset list;
matching the function field with scene fields in the preset scene, and determining at least one scene field successfully matched with the function field in the preset scene as a target field;
counting the field number of each target field;
and determining the preset scene with the maximum field number as the scene to be detected.
Wherein, the function to be tested refers to a system function newly added in the test system.
The function field refers to a field related to the function to be tested, for example, the function field includes: time, payment, etc.
The preset list comprises a plurality of mapping relations between preset scenes and fields.
By matching the function field and the scene field on the function to be tested, the specific scene applied by the test system can be accurately determined.
Specifically, the determining, by the electronic device, the function to be tested from a function requirement table according to the system identification code and the request generation time includes:
acquiring information corresponding to the system identification code from the function requirement table as information to be screened, wherein the information to be screened comprises the mapping relation between the test system and the system function at a plurality of times;
acquiring all time information from the information to be screened as initial selection time;
acquiring the time closest to the request generation time from the initial time as a first time, and acquiring the time closest to the first time from the initial time as a second time;
calling a system function corresponding to the first time from the information to be screened as a first function, and calling a system function corresponding to the second time from the function requirement table as a second function;
and comparing the first function with the second function, and determining the first function different from the second function as the function to be tested.
The function requirement table stores a plurality of mapping relations between systems, time and system functions.
The function to be tested in the test system can be accurately determined through the system identification code and the request generation time.
And S11, acquiring a history test log.
In at least one embodiment of the invention, specific information related to the test event is recorded in the historical test log.
In at least one embodiment of the present invention, the electronic device obtaining the historical test log includes:
acquiring a label indicating a test as a test label;
and acquiring a log containing the test label from a preset log library as the historical test log.
The preset log library stores log information of a plurality of events, for example, the preset log library stores log information of test events.
Through the test label can be comprehensive follow acquire in presetting the log storehouse historical test log avoids the omission analysis to test log to improve the generating comprehensiveness of multidimension array, simultaneously, through acquireing earlier test label, again according to test label acquires historical test log, because need not to detect whether every character in the log of presetting storage in the log storehouse indicates the test, and only need detect whether exist in the log of presetting storage in the log storehouse with the label that test label is the same can, consequently, can improve historical test log's acquisition efficiency.
And S12, analyzing the test parameters in the historical test log to obtain a multi-dimensional array.
In at least one embodiment of the invention, the multi-dimensional array includes element information for a plurality of dimensions. For example: the multi-dimensional array may be [ transfer, [ cell phone number transfer function, [ user 1, user 2], cross-border remittance function, [ user 2, user 3] ] ]. Namely: the first level menu "transfer accounts", the second level menu "cell-phone number transfer function" and "cross-border remittance function", wherein: there are two users (user 1, user 2) under the mobile phone number transfer function, and there are two users (user 2, user 3) in the cross-border remittance function.
In at least one embodiment of the present invention, the analyzing, by the electronic device, the test parameters in the historical test log to obtain the multidimensional array includes:
identifying a log object of the historical test log;
parsing the test parameters from the historical test log based on the log object;
identifying a log hierarchy of the test parameters in the historical test log;
and writing the test parameters into a preset array according to the log level to obtain the multidimensional array.
The log object may refer to field information included in the history test log. Correspondingly, the test parameter refers to a specific parameter corresponding to the field information, for example, the log object is: transferring accounts, wherein the test parameters are as follows: and transferring accounts for the mobile phone number.
The log level refers to the level number of the test parameters in the historical test log, for example, the historical test log is { transfer, a { mobile phone number transfer function, and a { user 1, user 2} } }. The log level of "transfer" in the history test log is 1, and the log level of "cell phone number transfer function" in the history test log is 2.
The expression form of the preset array is as follows: [ primary directory name 1, [ secondary directory name 1, … ], [ test account list ], primary directory name 2, … ].
The test parameters can be accurately acquired through the log object, and then the test parameters can be accurately input to corresponding positions in the preset array by identifying the hierarchy of the test parameters in the historical log, so that the generation accuracy of the multidimensional array is improved.
And S13, traversing the multi-dimensional array according to the function to be tested to obtain a plurality of user lists, wherein the user lists comprise historical test account numbers.
In at least one embodiment of the invention, the plurality of user lists are represented in the form of a pure array. For example, the user list C is [ user 3, [ index 001, [ time A ] ] ].
In at least one embodiment of the present invention, the multidimensional array includes a plurality of array menus, and the traversing, by the electronic device, the multidimensional array according to the function to be tested to obtain a plurality of user lists includes:
acquiring a function identification code of the function to be tested;
writing the function identification code into a preset statement to generate a query statement;
traversing the multidimensional array based on the query statement to obtain an array menu matched with the function identification code as a function menu;
and screening all users associated with the function menu from the multi-dimensional array to obtain the plurality of user lists.
The function identification code is used for indicating the function to be tested.
The preset statement refers to an SQL statement which does not contain a query object.
The query statement is an SQL statement containing the function identification code.
The function menu refers to function information corresponding to the function to be tested in the multi-dimensional array.
The multidimensional array is traversed through the query statement, so that the extraction efficiency of the function menu can be improved, and the plurality of user lists can be accurately acquired from the multidimensional array according to the function menu.
S14, extracting the list index of the user lists according to the preset index position.
In at least one embodiment of the present invention, the preset index position refers to a specific position in the plurality of user lists where the tag index is stored.
In at least one embodiment of the present invention, the electronic device locates information corresponding to the preset index position from the plurality of user lists as the list index.
And S15, screening out the target account matched with the scene to be tested from the historical test accounts according to the list index.
In at least one embodiment of the present invention, the target account is a historical test account corresponding to the function to be tested and the scene to be tested at the same time.
In at least one embodiment of the present invention, the screening, by the electronic device, a target account matched with the scene to be tested from the historical test accounts according to the list index includes:
acquiring a label corresponding to the list index from a preset label library as a list scene;
comparing the scene to be detected with the list scene;
if the scene to be detected is different from the list scene, acquiring a fine-grained scene of the list scene, and comparing the scene to be detected with the fine-grained scene;
and if the scene to be tested is the same as the fine-grained scene, determining the historical test account in the user list where the list index is located as the target account.
The preset label library stores mapping relations between a plurality of indexes and scenes.
The fine-grained scene refers to a specific scene in the list scene, for example, the list scene is: artificial intelligence, the fine-grained scene comprising: image recognition, text recognition, etc.
By the above embodiment, when the scene to be tested is different from the list scene, the scene to be tested is compared with the fine-grained scene, so that the situation that the scene to be tested cannot be compared with the fine-grained scene in the list scene due to the fact that the scene to be tested is different from the list scene, and further the list scene needing to be extracted cannot be accurately distinguished can be avoided.
For example, a scene a to be tested and a list scene K, where the list scene K includes a fine-grained scene a, a fine-grained scene B, and a fine-grained scene C, and if the scene a to be tested and the list scene K are only compared, the scene a to be tested and the list scene K are obviously different from each other, a target account is not obtained from the list scene K, and actually, the list scene K includes the fine-grained scene a, so the account in the list scene K is suitable for testing.
And S16, testing the test system based on the target account to obtain a test result.
In at least one embodiment of the present invention, the test result refers to a result obtained after the target account tests the function to be tested and the scene to be tested in the test system.
It is emphasized that the test results may also be stored in nodes of a blockchain in order to further ensure privacy and security of the test results.
In at least one embodiment of the invention, the method further comprises:
counting the number of the account numbers of the target account numbers with failed test according to the test result;
counting the number of the target account as a total test amount;
calculating the ratio of the number of the accounts in the total test amount to obtain a target ratio;
and if the target ratio is larger than a configuration value, generating prompt information of the test system.
Wherein the configuration value is set according to fault tolerance information of the test system. For example, the configuration value may be set to 0.2.
Through the embodiment, the prompt information can be generated in time when the test system fails to test, and the adjustment of a developer on the test system is facilitated.
According to the technical scheme, the multi-dimensional array is constructed, label information is not stored in the multi-dimensional array, so that the occupied memory of the multi-dimensional array can be saved, the multi-dimensional array is traversed through the function to be tested, corresponding function information can be obtained based on the storage position of the function information in the multi-dimensional array and is compared with the function to be tested, the function information is not required to be obtained through further analyzing the label information, the obtaining efficiency of a plurality of user lists can be improved, the historical test account numbers are screened through the scene to be tested, the historical test account numbers corresponding to the function to be tested and the scene to be tested at the same time can be obtained, the target account numbers are used for testing the function to be tested, and the account numbers corresponding to the function to be tested and the scene to be tested are not required to be generated in a customized mode, therefore, the test efficiency of the test system can be improved.
FIG. 2 is a functional block diagram of an automatic test device according to a preferred embodiment of the present invention. The automatic testing device 11 includes an identification unit 110, an acquisition unit 111, an analysis unit 112, a traversal unit 113, an extraction unit 114, a screening unit 115, a testing unit 116, a calculation unit 117, and a generation unit 118. The module/unit referred to herein is a series of computer readable instruction segments that can be accessed by the processor 13 and perform a fixed function and that are stored in the memory 12. In the present embodiment, the functions of the modules/units will be described in detail in the following embodiments.
The identification unit 110 receives the test request, and identifies the function to be tested and the scene to be tested of the test system according to the test request.
In at least one embodiment of the invention, the test request may be automatically triggered to be generated when a new function in the test system completes development. The information carried in the test request includes, but is not limited to: and indicating the identification code of the test system and generating the time of the test request.
The test system refers to a system which needs to perform functional test.
The function to be tested refers to a function to be tested in the test system. The scene to be tested refers to a scene needing to be tested in the test system.
In at least one embodiment of the present invention, the identifying unit 110 identifies the function to be tested and the scenario to be tested of the test system according to the test request includes:
acquiring a system identification code of the test system and request generation time of the test request from the test request;
determining the function to be tested from a function demand table according to the system identification code and the request generation time;
acquiring a function field of the function to be tested, and acquiring a preset scene in a preset list;
matching the function field with scene fields in the preset scene, and determining at least one scene field successfully matched with the function field in the preset scene as a target field;
counting the field number of each target field;
and determining the preset scene with the maximum field number as the scene to be detected.
Wherein, the function to be tested refers to a system function newly added in the test system.
The function field refers to a field related to the function to be tested, for example, the function field includes: time, payment, etc.
The preset list comprises a plurality of mapping relations between preset scenes and fields.
By matching the function field and the scene field on the function to be tested, the specific scene applied by the test system can be accurately determined.
Specifically, the determining, by the identification unit 110, the function to be tested from the function requirement table according to the system identification code and the request generation time includes:
acquiring information corresponding to the system identification code from the function requirement table as information to be screened, wherein the information to be screened comprises the mapping relation between the test system and the system function at a plurality of times;
acquiring all time information from the information to be screened as initial selection time;
acquiring the time closest to the request generation time from the initial time as a first time, and acquiring the time closest to the first time from the initial time as a second time;
calling a system function corresponding to the first time from the information to be screened as a first function, and calling a system function corresponding to the second time from the function requirement table as a second function;
and comparing the first function with the second function, and determining the first function different from the second function as the function to be tested.
The function requirement table stores a plurality of mapping relations between systems, time and system functions.
The function to be tested in the test system can be accurately determined through the system identification code and the request generation time.
The acquisition unit 111 acquires a history test log.
In at least one embodiment of the invention, specific information related to the test event is recorded in the historical test log.
In at least one embodiment of the present invention, the acquiring unit 111 acquires the history test log, including:
acquiring a label indicating a test as a test label;
and acquiring a log containing the test label from a preset log library as the historical test log.
The preset log library stores log information of a plurality of events, for example, the preset log library stores log information of test events.
Through the test label can be comprehensive follow acquire in presetting the log storehouse historical test log avoids the omission analysis to test log to improve the generating comprehensiveness of multidimension array, simultaneously, through acquireing earlier test label, again according to test label acquires historical test log, because need not to detect whether every character in the log of presetting storage in the log storehouse indicates the test, and only need detect whether exist in the log of presetting storage in the log storehouse with the label that test label is the same can, consequently, can improve historical test log's acquisition efficiency.
The analysis unit 112 analyzes the test parameters in the history test log to obtain a multidimensional array.
In at least one embodiment of the invention, the multi-dimensional array includes element information for a plurality of dimensions. For example: the multi-dimensional array may be [ transfer, [ cell phone number transfer function, [ user 1, user 2], cross-border remittance function, [ user 2, user 3] ] ]. Namely: the first level menu "transfer accounts", the second level menu "cell-phone number transfer function" and "cross-border remittance function", wherein: there are two users (user 1, user 2) under the mobile phone number transfer function, and there are two users (user 2, user 3) in the cross-border remittance function.
In at least one embodiment of the present invention, the parsing unit 112 parses the test parameters in the historical test log to obtain a multidimensional array, including:
identifying a log object of the historical test log;
parsing the test parameters from the historical test log based on the log object;
identifying a log hierarchy of the test parameters in the historical test log;
and writing the test parameters into a preset array according to the log level to obtain the multidimensional array.
The log object may refer to field information included in the history test log. Correspondingly, the test parameter refers to a specific parameter corresponding to the field information, for example, the log object is: transferring accounts, wherein the test parameters are as follows: and transferring accounts for the mobile phone number.
The log level refers to the level number of the test parameters in the historical test log, for example, the historical test log is { transfer, a { mobile phone number transfer function, and a { user 1, user 2} } }. The log level of "transfer" in the history test log is 1, and the log level of "cell phone number transfer function" in the history test log is 2.
The expression form of the preset array is as follows: [ primary directory name 1, [ secondary directory name 1, … ], [ test account list ], primary directory name 2, … ].
The test parameters can be accurately acquired through the log object, and then the test parameters can be accurately input to corresponding positions in the preset array by identifying the hierarchy of the test parameters in the historical log, so that the generation accuracy of the multidimensional array is improved.
The traversing unit 113 traverses the multidimensional array according to the function to be tested to obtain a plurality of user lists, wherein the user lists comprise historical test accounts.
In at least one embodiment of the invention, the plurality of user lists are represented in the form of a pure array. For example, the user list C is [ user 3, [ index 001, [ time A ] ] ].
In at least one embodiment of the present invention, the multidimensional array includes a plurality of array menus, and the traversing unit 113 traverses the multidimensional array according to the function to be tested to obtain a plurality of user lists, including:
acquiring a function identification code of the function to be tested;
writing the function identification code into a preset statement to generate a query statement;
traversing the multidimensional array based on the query statement to obtain an array menu matched with the function identification code as a function menu;
and screening all users associated with the function menu from the multi-dimensional array to obtain the plurality of user lists.
The function identification code is used for indicating the function to be tested.
The preset statement refers to an SQL statement which does not contain a query object.
The query statement is an SQL statement containing the function identification code.
The function menu refers to function information corresponding to the function to be tested in the multi-dimensional array.
The multidimensional array is traversed through the query statement, so that the extraction efficiency of the function menu can be improved, and the plurality of user lists can be accurately acquired from the multidimensional array according to the function menu.
The extracting unit 114 extracts a list index of the plurality of user lists according to a preset index position.
In at least one embodiment of the present invention, the preset index position refers to a specific position in the plurality of user lists where the tag index is stored.
In at least one embodiment of the present invention, the extracting unit 114 locates information corresponding to the preset index position from the plurality of user lists as the list index.
The screening unit 115 screens out a target account matched with the scene to be tested from the historical test accounts according to the list index.
In at least one embodiment of the present invention, the target account is a historical test account corresponding to the function to be tested and the scene to be tested at the same time.
In at least one embodiment of the present invention, the screening unit 115 screens out, from the historical test account numbers according to the list index, a target account number that matches the scene to be tested, including:
acquiring a label corresponding to the list index from a preset label library as a list scene;
comparing the scene to be detected with the list scene;
if the scene to be detected is different from the list scene, acquiring a fine-grained scene of the list scene, and comparing the scene to be detected with the fine-grained scene;
and if the scene to be tested is the same as the fine-grained scene, determining the historical test account in the user list where the list index is located as the target account.
The preset label library stores mapping relations between a plurality of indexes and scenes.
The fine-grained scene refers to a specific scene in the list scene, for example, the list scene is: artificial intelligence, the fine-grained scene comprising: image recognition, text recognition, etc.
By the above embodiment, when the scene to be tested is different from the list scene, the scene to be tested is compared with the fine-grained scene, so that the situation that the scene to be tested cannot be compared with the fine-grained scene in the list scene due to the fact that the scene to be tested is different from the list scene, and further the list scene needing to be extracted cannot be accurately distinguished can be avoided.
For example, a scene a to be tested and a list scene K, where the list scene K includes a fine-grained scene a, a fine-grained scene B, and a fine-grained scene C, and if the scene a to be tested and the list scene K are only compared, the scene a to be tested and the list scene K are obviously different from each other, a target account is not obtained from the list scene K, and actually, the list scene K includes the fine-grained scene a, so the account in the list scene K is suitable for testing.
The test unit 116 tests the test system based on the target account to obtain a test result.
In at least one embodiment of the present invention, the test result refers to a result obtained after the target account tests the function to be tested and the scene to be tested in the test system.
It is emphasized that the test results may also be stored in nodes of a blockchain in order to further ensure privacy and security of the test results.
In at least one embodiment of the invention, the method further comprises:
the calculating unit 117 counts the number of the account numbers of the target account numbers with failed test;
the calculating unit 117 counts the number of the target account numbers as a total test amount;
the calculating unit 117 calculates a ratio of the number of the accounts in the total test amount to obtain a target ratio;
if the target ratio is greater than the configuration value, the generating unit 118 generates a prompt message of the test system.
Wherein the configuration value is set according to fault tolerance information of the test system. For example, the configuration value may be set to 0.2.
Through the embodiment, the prompt information can be generated in time when the test system fails to test, and the adjustment of a developer on the test system is facilitated.
According to the technical scheme, the multi-dimensional array is constructed, label information is not stored in the multi-dimensional array, so that the occupied memory of the multi-dimensional array can be saved, the multi-dimensional array is traversed through the function to be tested, corresponding function information can be obtained based on the storage position of the function information in the multi-dimensional array and is compared with the function to be tested, the function information is not required to be obtained through further analyzing the label information, the obtaining efficiency of a plurality of user lists can be improved, the historical test account numbers are screened through the scene to be tested, the historical test account numbers corresponding to the function to be tested and the scene to be tested at the same time can be obtained, the target account numbers are used for testing the function to be tested, and the account numbers corresponding to the function to be tested and the scene to be tested are not required to be generated in a customized mode, therefore, the test efficiency of the test system can be improved.
Fig. 3 is a schematic structural diagram of an electronic device according to a preferred embodiment of the present invention, which implements an automated testing method.
In one embodiment of the present invention, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and computer readable instructions, such as an automated test program, stored in the memory 12 and executable on the processor 13.
It will be appreciated by a person skilled in the art that the schematic diagram is only an example of the electronic device 1 and does not constitute a limitation of the electronic device 1, and that it may comprise more or less components than shown, or some components may be combined, or different components, e.g. the electronic device 1 may further comprise an input output device, a network access device, a bus, etc.
The Processor 13 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The processor 13 is an operation core and a control center of the electronic device 1, and is connected to each part of the whole electronic device 1 by various interfaces and lines, and executes an operating system of the electronic device 1 and various installed application programs, program codes, and the like.
Illustratively, the computer readable instructions may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to implement the present invention. The one or more modules/units may be a series of computer readable instruction segments capable of performing specific functions, which are used for describing the execution process of the computer readable instructions in the electronic device 1. For example, the computer readable instructions may be partitioned into a recognition unit 110, an acquisition unit 111, a parsing unit 112, a traversal unit 113, an extraction unit 114, a screening unit 115, a testing unit 116, a calculation unit 117, and a generation unit 118.
The memory 12 may be used for storing the computer readable instructions and/or modules, and the processor 13 implements various functions of the electronic device 1 by executing or executing the computer readable instructions and/or modules stored in the memory 12 and invoking data stored in the memory 12. The memory 12 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. The memory 12 may include non-volatile and volatile memories, such as: a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other storage device.
The memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a memory having a physical form, such as a memory stick, a TF Card (Trans-flash Card), or the like.
The integrated modules/units of the electronic device 1 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the above embodiments may be implemented by hardware that is configured to be instructed by computer readable instructions, which may be stored in a computer readable storage medium, and when the computer readable instructions are executed by a processor, the steps of the method embodiments may be implemented.
Wherein the computer readable instructions comprise computer readable instruction code which may be in source code form, object code form, an executable file or some intermediate form, and the like. The computer-readable medium may include: any entity or device capable of carrying said computer readable instruction code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM).
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
With reference to fig. 1, the memory 12 of the electronic device 1 stores computer-readable instructions to implement an automated testing method, and the processor 13 executes the computer-readable instructions to implement:
receiving a test request, and identifying a function to be tested and a scene to be tested of a test system according to the test request;
acquiring a historical test log;
analyzing the test parameters in the historical test log to obtain a multidimensional array;
traversing the multi-dimensional array according to the function to be tested to obtain a plurality of user lists, wherein the user lists comprise historical test account numbers;
extracting list indexes of the plurality of user lists according to preset index positions;
screening out a target account matched with the scene to be tested from the historical test accounts according to the list index;
and testing the test system based on the target account to obtain a test result.
Specifically, the processor 13 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer readable instructions, which is not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The computer readable storage medium has computer readable instructions stored thereon, wherein the computer readable instructions when executed by the processor 13 are configured to implement the steps of:
receiving a test request, and identifying a function to be tested and a scene to be tested of a test system according to the test request;
acquiring a historical test log;
analyzing the test parameters in the historical test log to obtain a multidimensional array;
traversing the multi-dimensional array according to the function to be tested to obtain a plurality of user lists, wherein the user lists comprise historical test account numbers;
extracting list indexes of the plurality of user lists according to preset index positions;
screening out a target account matched with the scene to be tested from the historical test accounts according to the list index;
and testing the test system based on the target account to obtain a test result.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. The plurality of units or devices may also be implemented by one unit or device through software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. An automated testing method, comprising:
receiving a test request, and identifying a function to be tested and a scene to be tested of a test system according to the test request;
acquiring a historical test log;
analyzing the test parameters in the historical test log to obtain a multidimensional array;
traversing the multi-dimensional array according to the function to be tested to obtain a plurality of user lists, wherein the user lists comprise historical test account numbers;
extracting list indexes of the plurality of user lists according to preset index positions;
screening out a target account matched with the scene to be tested from the historical test accounts according to the list index;
and testing the test system based on the target account to obtain a test result.
2. The automated testing method of claim 1, wherein the identifying the function under test and the scenario under test of the test system according to the test request comprises:
acquiring a system identification code of the test system and request generation time of the test request from the test request;
determining the function to be tested from a function demand table according to the system identification code and the request generation time;
acquiring a function field of the function to be tested, and acquiring a preset scene in a preset list;
matching the function field with scene fields in the preset scene, and determining at least one scene field successfully matched with the function field in the preset scene as a target field;
counting the field number of each target field;
and determining the preset scene with the maximum field number as the scene to be detected.
3. The automated testing method of claim 2, wherein said determining the function to be tested from a function requirement table based on the system identification code and the request generation time comprises:
acquiring information corresponding to the system identification code from the function requirement table as information to be screened, wherein the information to be screened comprises the mapping relation between the test system and the system function at a plurality of times;
acquiring all time information from the information to be screened as initial selection time;
acquiring the time closest to the request generation time from the initial time as a first time, and acquiring the time closest to the first time from the initial time as a second time;
calling a system function corresponding to the first time from the information to be screened as a first function, and calling a system function corresponding to the second time from the function requirement table as a second function;
and comparing the first function with the second function, and determining the first function different from the second function as the function to be tested.
4. The automated testing method of claim 1, wherein the obtaining a historical test log comprises:
acquiring a label indicating a test as a test label;
and acquiring a log containing the test label from a preset log library as the historical test log.
5. The automated testing method of claim 1, wherein the parsing the test parameters in the historical test log to obtain a multidimensional array comprises:
identifying a log object of the historical test log;
parsing the test parameters from the historical test log based on the log object;
identifying a log hierarchy of the test parameters in the historical test log;
and writing the test parameters into a preset array according to the log level to obtain the multidimensional array.
6. The automated testing method of claim 1, wherein the multi-dimensional array includes a plurality of array menus, and wherein traversing the multi-dimensional array according to the function to be tested to obtain a plurality of user lists comprises:
acquiring a function identification code of the function to be tested;
writing the function identification code into a preset statement to generate a query statement;
traversing the multidimensional array based on the query statement to obtain an array menu matched with the function identification code as a function menu;
and screening all users associated with the function menu from the multi-dimensional array to obtain the plurality of user lists.
7. The automated testing method of claim 1, wherein the screening out target account numbers matching the scene to be tested from the historical test account numbers according to the list index comprises:
acquiring a label corresponding to the list index from a preset label library as a list scene;
comparing the scene to be detected with the list scene;
if the scene to be detected is different from the list scene, acquiring a fine-grained scene of the list scene, and comparing the scene to be detected with the fine-grained scene;
and if the scene to be tested is the same as the fine-grained scene, determining the historical test account in the user list where the list index is located as the target account.
8. An automated testing apparatus, comprising:
the identification unit is used for receiving the test request and identifying the function to be tested and the scene to be tested of the test system according to the test request;
an acquisition unit configured to acquire a history test log;
the analysis unit is used for analyzing the test parameters in the historical test log to obtain a multidimensional array;
the traversal unit is used for traversing the multi-dimensional array according to the function to be tested to obtain a plurality of user lists, and the user lists comprise historical test account numbers;
an extracting unit, configured to extract list indexes of the plurality of user lists according to preset index positions;
the screening unit is used for screening a target account matched with the scene to be tested from the historical test accounts according to the list index;
and the test unit is used for testing the test system based on the target account to obtain a test result.
9. An electronic device, characterized in that the electronic device comprises:
a memory storing computer readable instructions; and
a processor executing computer readable instructions stored in the memory to implement the automated testing method of any of claims 1-7.
10. A computer-readable storage medium characterized by: the computer-readable storage medium has stored therein computer-readable instructions that are executed by a processor in an electronic device to implement the automated testing method of any of claims 1-7.
CN202111266454.XA 2021-10-28 2021-10-28 Automatic testing method, device, equipment and storage medium Pending CN113900955A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111266454.XA CN113900955A (en) 2021-10-28 2021-10-28 Automatic testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111266454.XA CN113900955A (en) 2021-10-28 2021-10-28 Automatic testing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113900955A true CN113900955A (en) 2022-01-07

Family

ID=79027642

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111266454.XA Pending CN113900955A (en) 2021-10-28 2021-10-28 Automatic testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113900955A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116067618A (en) * 2023-01-12 2023-05-05 深圳市光为光通信科技有限公司 Automatic production and adjustment method for 800G high-speed optical module
CN116204441A (en) * 2023-03-17 2023-06-02 百度时代网络技术(北京)有限公司 Performance test method, device, equipment and storage medium of index data structure

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116067618A (en) * 2023-01-12 2023-05-05 深圳市光为光通信科技有限公司 Automatic production and adjustment method for 800G high-speed optical module
CN116067618B (en) * 2023-01-12 2024-02-02 深圳市光为光通信科技有限公司 Automatic production and adjustment method for 800G high-speed optical module
CN116204441A (en) * 2023-03-17 2023-06-02 百度时代网络技术(北京)有限公司 Performance test method, device, equipment and storage medium of index data structure

Similar Documents

Publication Publication Date Title
CN111985241A (en) Medical information query method, device, electronic equipment and medium
CN111797351A (en) Page data management method and device, electronic equipment and medium
CN113900955A (en) Automatic testing method, device, equipment and storage medium
CN112433705A (en) Script generation method and device, electronic equipment and storage medium
CN114490692A (en) Data checking method, device, equipment and storage medium
CN112363923B (en) Testing method and device based on questionnaire system, computer equipment and medium
CN111858600B (en) Data wide table construction method, device, equipment and storage medium
CN114510487B (en) Data table merging method, device, equipment and storage medium
CN112711398A (en) Method, device and equipment for generating buried point file and storage medium
CN114329095A (en) System logic diagram generation method, device, equipment and storage medium
CN113434542B (en) Data relationship identification method and device, electronic equipment and storage medium
CN114116108A (en) Dynamic rendering method, device, equipment and storage medium
CN114372060A (en) Data storage method, device, equipment and storage medium
CN113470775A (en) Information acquisition method, device, equipment and storage medium
CN112181485A (en) Script execution method and device, electronic equipment and storage medium
CN112947911A (en) Interface script generation method, device, equipment and storage medium
CN114003784A (en) Request recording method, device, equipment and storage medium
CN115952201A (en) Data query method, device, system and storage medium
CN113886263A (en) System testing method, device, equipment and storage medium
CN114238296A (en) Product index data display method, device, equipment and storage medium
CN114692204A (en) Data query method, device, equipment and storage medium
CN113282218A (en) Multi-dimensional report generation method, device, equipment and storage medium
CN114943474A (en) Research and development workload detection method, device, equipment and storage medium
CN111859985A (en) AI customer service model testing method, device, electronic equipment and storage medium
CN114327377B (en) Method and device for generating demand tracking matrix, computer equipment and storage medium

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