[go: up one dir, main page]

CN113282499A - Method, system, device and medium for creating test data - Google Patents

Method, system, device and medium for creating test data Download PDF

Info

Publication number
CN113282499A
CN113282499A CN202110606332.4A CN202110606332A CN113282499A CN 113282499 A CN113282499 A CN 113282499A CN 202110606332 A CN202110606332 A CN 202110606332A CN 113282499 A CN113282499 A CN 113282499A
Authority
CN
China
Prior art keywords
interface
parameters
message body
function
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.)
Granted
Application number
CN202110606332.4A
Other languages
Chinese (zh)
Other versions
CN113282499B (en
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.)
Changsha Daojia Youxiang Home Economics Service Co ltd
Original Assignee
Changsha Daojia Youxiang Home Economics Service 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 Changsha Daojia Youxiang Home Economics Service Co ltd filed Critical Changsha Daojia Youxiang Home Economics Service Co ltd
Priority to CN202110606332.4A priority Critical patent/CN113282499B/en
Publication of CN113282499A publication Critical patent/CN113282499A/en
Application granted granted Critical
Publication of CN113282499B publication Critical patent/CN113282499B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention belongs to the field of testing, and is particularly suitable for system interface testing. Aiming at the defects that the existing testing general function module needs upstream and downstream data as a test, a newly added interface needs to obtain data or a flow of the other party and then is created by the other party, the business is unfamiliar with the defects of influence on data creation, low efficiency and the like, the method, the system, the equipment and the medium for creating the testing data are provided, the method, the system, the equipment and the medium aim to determine key parameters and non-key parameters through parameters transmitted by an internal function adding interface, provide preset default values for the non-key parameters and provide modified specific values for the key parameters, further generate the testing data, monitor an external function by adding a message subscription function, namely, a message body, provide the modified specific values for the message body, and regularly monitor and determine that a third party node triggers and then generate the testing data by using the specific values. Therefore, the technical problem of how to realize the generalized and efficient test data creation is solved.

Description

Method, system, device and medium for creating test data
Technical Field
The present invention belongs to the field of test technology, and is especially suitable for interface test, and is especially method, system, equipment and medium for creating test data.
Background
In the prior art, when testing a general function module, data of an upstream or associated service is required to be used as test data, the test data is generally test data given by an opposite party which needs to be tested and is provided with a new interface or a service function flow document provided by the opposite party, and then test data is created by the own party.
Therefore, it is necessary to improve the existing interface test data creation mode, implement generalized test data creation, adapt to more interface change tests, improve test efficiency, avoid excessive familiarity requirements on the service itself, and be convenient and efficient.
Disclosure of Invention
Technical problem to be solved
The invention aims to solve the technical problem of how to realize the generalized and efficient test data creation; furthermore, the technical problem of how to conveniently and efficiently create test data based on message subscription so as to improve the service test efficiency is solved.
(II) technical scheme
To solve the above technical problem, an aspect of the present invention provides a method for creating test data, including: determining key parameters and non-key parameters of parameters transmitted by an interface of a system to be tested; uniformly presetting default values for the non-key parameters and correcting specific values for the key parameters; and creating test data for testing the system to be tested according to the specific value of the parameter corresponding to the interface, the default value of the non-key parameter and/or the monitored node triggered by the reissued message body.
According to the preferred embodiment of the present invention, before determining the key parameters and the non-key parameters of the parameters transmitted from the interface of the system under test, the method further includes: analyzing a flow link of the system to be tested to distinguish an internal function and an external function of the system to be tested; if the function is an internal function, establishing an initialization interface through interface template library and/or interface interaction according to a default function; and if the external function is the external function, based on the message subscription, establishing an initialization message body corresponding to the external system which is indicated by the external function and depended on by the system to be tested.
According to a preferred embodiment of the present invention, the creating an initialization message body includes: and corresponding to the added service of the external system, constructing a corresponding message subject number through interface interaction selection, selecting a corresponding message body according to a default value and a message body library, and reissuing the message body.
According to the preferred embodiment of the present invention, corresponding to the added service of the external system, the corresponding message subject number is selected and constructed through interface interaction, and the corresponding message body is selected according to the default value and the message body library and is reissued, which specifically includes: modifying the selected corresponding message body through a random function to obtain a specific value; and monitoring the reissued message body at regular time or in real time to determine the node trigger corresponding to the external function of the third-party system.
According to the preferred embodiment of the present invention, determining the key parameters and the non-key parameters of the parameters transmitted from the interface of the system under test specifically includes: acquiring parameters in a code scanning mode based on internal services corresponding to internal functions in the system to be tested and external services of an external system which corresponds to the external functions and is depended on by the system to be tested; and combining the obtained parameters with the service analysis of the system to be tested, and determining that the parameters which can substantially influence the response result of the service rule are key parameters and the parameters which cannot substantially influence the service rule are non-key parameters in one or more parameters transmitted by the interface.
According to the preferred embodiment of the present invention, uniformly presetting a default value for the non-critical parameter and correcting a specific value for the critical parameter specifically includes: generating a preset default value of a non-key parameter when the interface is created based on an interface template and a random generator according to a default value function; and based on the preset default value, modifying the preset default provided by the key parameter when the interface is created according to a random function and interface interaction to obtain a modified specific value.
According to the preferred embodiment of the present invention, creating test data for testing a system under test according to a specific value of the parameter corresponding to an interface and a default value of the non-critical parameter, and/or according to a node triggered by a monitored reissued message body, specifically includes: generating test data according to the specific value of the corresponding key parameter and the default value of the non-key parameter in the interface of the system to be tested, and sending an interface request; and/or according to the message body, obtaining a specific value of the message body corresponding to a node on a flow link of the system to be tested, which is triggered by an external system on which the system to be tested depends, and generating test data.
In order to solve the above technical problem, a second aspect of the present invention provides a system for creating test data, including: the distinguishing module is used for determining key parameters and non-key parameters of parameters transmitted by an interface of the system to be tested; the setting module is used for uniformly presetting default values for the non-key parameters and correcting specific values for the key parameters; and the creating module is used for creating test data for testing the system to be tested according to the specific value of the parameter corresponding to the interface, the default value of the non-key parameter and/or the monitored node triggered by the reissued message body.
A third aspect of the invention proposes an electronic device comprising a processor and a memory for storing a computer executable program, which when executed by the processor performs the method of the first aspect.
The fourth aspect of the present invention also provides a computer-readable storage medium storing a computer-executable program, which when executed, implements the method of the first aspect.
(III) advantageous effects
The invention determines that the transmission value of the parameter which must be transmitted in the interface has no substantial influence on the service by combing the service interface, can realize the function of increasing the interface, and can preset default values for non-key parameters when establishing the initial interface, and correct the key parameters to obtain specific values (such as key parameters like unique values) through random functions, so that valuable and effective upstream test data can be established only by adjusting and keying the values of the key parameters without specific familiarity with the service. High efficiency, rapidness, simplicity and convenience.
Further, the invention establishes the function/message subscription function supporting the message sending body, does not need real familiarity and operation flow for the related business of the third party, only needs to establish the initial message body (default value), revises the specific value and reissues the message body, monitors the agreement of the two parties on the message body, and establishes the test data according to the message body when triggering the node logic. And the method is efficient, quick, simple and convenient.
Drawings
FIG. 1 is a primary flow diagram for one embodiment of a method of creating test data in accordance with the present invention;
FIG. 2 is a block diagram of the main structure of one embodiment of a system for creating test data according to the present invention;
fig. 3 is a schematic diagram of the implementation of the functional principle according to an embodiment of the technical solution of the invention;
FIG. 4 is a block diagram illustrating the primary structure of one embodiment of an electronic device in accordance with the present invention;
FIG. 5 is a schematic diagram of the principal architecture of one embodiment of an electronic device in accordance with the present invention;
fig. 6 is a main structural diagram of one embodiment of a computer-readable storage medium according to the present invention.
Detailed Description
In order that the objects, technical solutions and advantages of the present invention will become more apparent, the present invention will be further described in detail with reference to the accompanying drawings in conjunction with the following specific embodiments.
In describing particular embodiments, specific details of structures, properties, effects, or other features are set forth in order to provide a thorough understanding of the embodiments by one skilled in the art. However, it is not excluded that a person skilled in the art may implement the invention in a specific case without the above-described structures, performances, effects or other features.
The flow chart in the drawings is only an exemplary flow demonstration, and does not represent that all the contents, operations and steps in the flow chart are necessarily included in the scheme of the invention, nor does it represent that the execution is necessarily performed in the order shown in the drawings. For example, some operations/steps in the flowcharts may be divided, some operations/steps may be combined or partially combined, and the like, and the execution order shown in the flowcharts may be changed according to actual situations without departing from the gist of the present invention.
The block diagrams in the figures generally represent functional entities and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different network and/or processing unit devices and/or microcontroller devices.
The same reference numerals denote the same or similar elements, components, or parts throughout the drawings, and thus, a repetitive description thereof may be omitted hereinafter. It will be further understood that, although the terms first, second, third, etc. may be used herein to describe various elements, components, or sections, these elements, components, or sections should not be limited by these terms. That is, these phrases are used only to distinguish one from another. For example, a first device may also be referred to as a second device without departing from the spirit of the present invention. Furthermore, the term "and/or", "and/or" is intended to include all combinations of any one or more of the listed items.
In order to solve the above technical problem, the present invention provides a scheme for creating test data. The scheme is mainly a scheme for creating test data based on generalization of message subscription. In a specific embodiment, the method for creating test data mainly includes: s1, determining key parameters and non-key parameters for the parameters transmitted by the added interface, selecting a message body for the added service and reissuing the message body; s2, presetting default values (such as a default function of a created interface or a message body) for non-key parameters, and correcting specific values (such as a random function) for key parameters; and S3, creating test data required by the whole process of the system to be tested based on the specific value of the key parameter corresponding to the interface and the default value of the non-key parameter, and/or based on the data acquired by monitoring the message body.
Based on the interface and the message subscription, the interface or the message body is preset with a default value and then a specific value is corrected, so that the interface can be quickly constructed, and the message body can be sent to obtain the parameter value of the corresponding node. The default value can be preset through a default value function, and the correction of the specific value can be realized through a random function; the function can be packaged with a construction function of a specific parameter, and secondary development is supported.
The following explains and/or explains terms that may be referred to in one embodiment of the present invention:
"message subscription based": during testing, the actual service process of a dependent party (a third party is not a system to be tested) is not needed, and only a message body is needed to reach the service node, so that parameters of the service node (upstream and downstream) needing the dependent party are provided for the system to be tested.
"generalization": in the test, different business party (third party) access can be supported through the registration and consumption mode of the message body; the message body supports typing, and also supports selection of a default message body, selection of a default value for each key, one-key typing of multiple default values, and the like.
"message": the message subject number + the message body can be constructed according to actual needs.
[ example 1 ]
The following description is made with reference to the flow chart of the main steps of one embodiment of the method of the present invention shown in fig. 1.
In step S110, key parameters and non-key parameters are determined for parameters transmitted from an interface of the system under test, and an external service depending on the system under test is selected to reissue a message body and monitor a message arrival condition to trigger a functional service flow linking up the system under test.
In one embodiment, the tool for creating test data is actually an application APP or software, platform. Taking software as an example, it may be a developed program that can be used to build an interface quickly. Further, it may at least include an internal functional interface construction part of the system under test and a message monitoring function part (external) of a third-party service, or an upstream node and a downstream node, on which the system under test depends, to quickly complete the functional verification of the system under test.
In one embodiment, the method of the present invention may first comb the interfaces that may be involved in the system under test that needs to create test data.
Carding interfaces such as: after the corresponding interface document is obtained, the system scope determination (for example, whether the system internal/internal function is, or the system external/dependent external function or external system, etc.) is performed on the interface based on the familiarity (experience) of the service, and here, the manual service experience is mainly combined with the manual determination mode to perform the differentiation. Further, the main process interface link may be separated from the functional process of the system under test, where the internal function (e.g., internal traffic) and the external function (e.g., external traffic on which the system under test depends) of the system under test may be involved.
In one embodiment, if the internal function of the system under test related to the system under test is targeted, the function verification can be quickly realized by adding the interface mode, and the interface template developed in the application program APP for creating the test data is called to create the initialization interface, so that the interface is increased.
Further, a visual web page can be provided during program development, and a tester can visually obtain a preliminary (initialization/default) interface.
In one embodiment, if the external function of the system under test, that is, the external function that the system under test depends on, is targeted, a corresponding message topic number may be constructed, and a preset message body template is selected, so that a preliminary (initialization/default) message body may be obtained. Thus, the node logic and the monitoring message body can be triggered by sending the message body to obtain the incoming parameters.
In one embodiment, based on the service flow and the service data of the system to be tested, the influence surface of the transmitted parameters (hereinafter, referred to as parameters) in the service may be determined to determine whether the function of the parameter-transmitting system to be tested has substantial influence. And the influence surface of the parameter is mainly judged by a manual mode and a code scanning mode. Specifically, based on the specific scenario, the specific business process, and the specific business data related to the system under test, the parameter may be obtained manually and/or in a code scanning manner, for example, the parameter may be obtained in a manner of combining manually and in a code scanning manner, so as to obtain the parameter and obtain the parameter transmission value. An example is as follows: the code scanning can scan the code interface by means of the existing code scanning tool, so that the transmitted parameter is obtained, a detailed interface analysis result report is generated by combining the mandatory filling attribute, the parameter uniqueness and the degree (parameter reference degree) of the output parameter (called parameter for short) used for other interfaces of the transmitted parameter, and then parameters are manually analyzed to be key parameters and parameters can be preset to be non-key parameters. The key measurement indexes are that specific service implementation needs to be seen, services are different, and the key of parameters is different, so that judgment is more accurate and effective by combining manual analysis.
Examples of determining critical parameters are:
for an interface that submits a thread, the incoming parameters are: activity id, recommender name, recommended person id, city, creation time, and update time. By analyzing the business and constructing the interface, the influence surfaces of the names of the recommenders, the cities, the creation time and the update time are small, but the activity id, the recommenders id and the recommenders id are very critical to the subsequent process. Thus, the key parameters of the interface are activity id, recommended person id and recommended person id, and the non-key parameters are recommended person name, city, creation time and update time.
For message body interception via message subscription, such as sending an external system service function message body, a professional training system (third party/external, upstream/downstream node) is required to walk to an authenticated node to trigger the system under test to internally reach the authenticated revenue node, creating a test scenario in which a hiring order is generated. Analytically, the certified process superlength of the vocational training system takes a long time if the process is really operated, and if the vocational training system performs function iteration, familiarity and actual implementation of the iterative function are required to be added, so that unnecessary testing cost is increased. In one embodiment of the present invention, the authenticated status can be monitored by setting a message topic number for an external system on which the system under test depends. For example: the message body is created from a template/message body library and the reissued message body quickly reaches an authenticated state (i.e., the parameters of the node needed for acquisition can be intercepted based on the message subscription).
An example of an application: assuming that more than 30 parameters need to be transmitted into an interface, which transmitted parameters are decisive for response result by analyzing, such as a submission interface of a live commission rule (business rule) including rule name, rule description, rule effective time, rule failure time, recommended business type name, recommended person type, rule effective period, rule city, rule time, rule node, new and old rule identifier, submission state of rule, node description of rule, amount configuration of rule node, applicable group of rule node, commission returning type of rule sub-item, commission returning type, commission returning configuration, recommended business type of non-commission returning, recommended person type of non-commission returning, effective time of rule node, failure time, whether rule node is settled according to period, rule node is settled according to month, settlement according to natural day, whether secondary settlement is performed, and the like, The secondary settlement does not return commission identity, the secondary settlement amount, the secondary node effective time and ineffective time and the like. In such a large number of parameters, it can be determined that the critical parameters are actually only the recommended service type, the recommended person type, the effective time, and the ineffective time, based on the service analysis. Therefore, it can be determined that the parameters transmitted through the interface really affect the use of the rule, and the rest are non-critical parameters, and do not have excessive influence on the subsequent process, just to ensure the integrity of the rule.
In one embodiment, the created test data is test data of the overall business process involved in the system under test. The present invention may include a process related to the internal function of the system and a process related to the external function of the system, such as: the state of the thread needs to be verified to be accurate, the thread needs to be submitted, and thus the interface for submitting the thread needs to be called to create the thread data, so that the state of the thread can be acquired, and the thread submitting belongs to the process of creating the test data. For another example: at present, an authenticated income node of professional training needs to be reached, but a professional training system is not a testing system, but an external system of a system to be tested or a dependent third party, although the authenticated procedure can be actually taken to reach, the time, the cost and the resources are too long, a message body is submitted through a message subject number to be subsidized, for example, a corresponding message body (a default value) is provided from a message body library according to the message subject number, a specific value is modified, and the message body is subsidized to reach, so that the goal of quick arrival can be achieved, and the efficiency is improved.
By constructing interface data and a reissued message body, namely based on interface creation and message subscription, the interface data and the reissued message body can effectively assist a testing means for testing the functions of the system to be tested.
It can be seen that, in this embodiment of the present invention, for the internal service of the system under test, a required interface is created or added according to a corresponding service scenario through an existing template, a message body is created for the external service (a dependent third-party system, etc.) of the system under test, and whether one or more incoming parameters are critical parameters is determined in a combination manner of code scanning and manual judgment. Thereby narrowing the scope for creating test data for testing critical parameters.
In step S120, a unified default value is preset for the non-critical parameters, and a value related to a service test is entered for the critical parameters.
In one embodiment, presetting the non-critical parameters to a uniform default value, such as calling a default function, may generate a random value based on the interface template and the random generator. Such as: non-critical parameters for a submission cue are the name of the recommender, the name of the person to be referred, the city, the time of creation, and the time of update. The names of the recommenders and the names of the recommenders are in a character string form, can be task characters, do not support idempotent, and can be directly fixed, for example, the names can be set to be preset fixed characters, such as Zhang three, Liquan and the like, and the names have no influence on the system to be tested; the city belongs to a table base code, and the service process can be set to have no influence on which city, for example, the city can be set to be a preset fixed city; creation time and update time, the time may be directly taken, and so on.
An example of the application may be that there is a setting in the interface template, and on the interface interacting with the person who creates the test data, the selection type provided by the pull-down box, various menus, etc. may be used to set default values for the parameters that do not affect the whole system to be tested. Such as the name of the recommender and the name of the person to be recommended, the character type is selected, and then the default value program of the character type of the program can be called to directly display a default character. For example, if a city is selected, the city default program is invoked, and the city has a default city code. And so on.
In one embodiment, the critical parameter is an important parameter affecting the interface, and thus, it may be modified herein, and the modification may include but is not limited to: manually modifying, calling one or more preset functions to assist generation, and the like. For example, recommending a month-sister as a merchant, wherein the identity card is a key parameter and supports idempotent and real-name authentication, a character cannot be typed at will, the identity card type needs to be selected, and then an identity card random generator (random function) of a corresponding program can be called, so that a key parameter (meta parameter) can be obtained quickly.
Further, the relevance of the parameter includes part of specific logic of the parameter, is not easy to generate, can be some specific parameters in life, such as an identity number, such as openid of WeChat, such as an operation license and the like, or specific values of a system per se, some ids appointed in the system can not be hit by keying errors, and these also need to be processed, a connection database is supported in a random function, and corresponding data can be found out as the parameter by keying in an sql query statement. This ensures the accuracy of the incoming parameters.
Furthermore, some identification parameters, such as unique values, such critical parameters are not supported to be idempotent and do not need to be repeated, for example, a registration interface in an interface needs to be transmitted with a non-repeated mobile phone number, that is, the mobile phone number must be unique and cannot be repeated. The random function is introduced, and specific values can be quickly de-duplicated and quickly constructed in the data generating and querying processes.
In addition, the critical parameters must be unique, while the non-critical parameters do not have to be unique. Such as creation time, which may be unique but is a non-critical parameter in the internal traffic of many systems under test.
It can be seen that, in this embodiment of the present invention, after distinguishing the key parameter and the non-key parameter, a preset default value (for example, a value may be given through a default function) is given when an interface or a message body is created, and then a specific value of the key parameter is corrected (for example, the specific value may be corrected through a random function), so that a uniform default value is randomly preset for the non-key parameter, and a corrected specific value (for example, a unique value that can be used for testing a system to be tested) is obtained for the key parameter through random function generation and/or interactive interface typing, and it is not necessary for a tester to spend a large amount of time constructing too much service data.
In step S130, test data is created according to the values of the critical parameters and the default values of the non-critical parameters, and/or according to monitoring values in a preset message body.
In one embodiment, the tool for creating test data is actually a developed application APP or software, platform, which can be used to build the interface quickly. Further, it may at least include an internal functional interface construction part of the system under test and a message monitoring function part (external) of a third-party service on which the system under test depends, so as to quickly complete the functional verification of the system under test.
In one embodiment, the main process interface link is analyzed from the functional process of the system under test, and the internal function (such as internal service) and the external function (such as external service) of the system under test are determined/distinguished.
Further, as described above, in the process of distinguishing the key parameters from the non-key parameters, if the internal functions of the system to be tested are aimed at, the interfaces can be added, the interface template developed by the system itself is called, and the initialization interface is created, so that the interfaces are increased, and a visual web page can be provided during program development, so that a tester can visually obtain a preliminary (initialization/default) interface.
Further, as in the foregoing process of distinguishing the key and non-key parameters, if the external function of the system under test is targeted, a message topic number may be constructed, a preset message body template may be selected, and a preliminary (initialization/default) message body may be created.
In one embodiment, based on the service and the service data of the system to be tested, the influence surface of the transmitted parameter (called parameter for short) in the service can be used for judging, and whether the parameter value has substantial influence or not is determined. And the influence surface of the parameter is mainly determined by manual + code scanning. Specifically, based on the system under test specifically related to the scene, the service and the service data, the parameter may be obtained in a manual and/or code scanning manner, for example, the parameter may be obtained in a manner of combining manual and code scanning, and a parameter value is obtained, see the foregoing process for determining the key parameter. The key measurement indexes are that specific service implementation needs to be seen, services are different, and the key of parameters is different, so that judgment is more effective by combining manual analysis. Here, the interfaces to the system under test include the added interfaces, and it is determined whether the parameters passed through them are critical parameters or non-critical parameters, as described above.
An example of an internal interface that takes into account the aforementioned distinction as system internal functions and submission hints: in the input parameters, the key parameters which are determined to be input by the interface are activity id, recommended person id and recommended person id, and the non-key parameters are recommended person name, city, creation time and update time.
The method is divided into external functions of the system, a test scene that a professional training system (an external system non-to-be-tested system) business process needs to go to an authenticated node to trigger the interior of the to-be-tested system to reach an authenticated income node is created, and a hired order is generated.
In an embodiment, according to the creating of the interface and the message body and the determining of the key or non-key nature of the transmission parameter, a default value may be uniformly preset for the non-key parameter, and a specific value may be modified for the key parameter through an interaction and/or random function, such as generating a value related to a service test, and creating required test data for an entire service flow related to the system under test according to a node logic status.
Further, the created test data includes data of parameters related to interfaces created by some related processes of internal functions, and also includes data of some related processes of external/external functions of the system.
Specific examples thereof are: to verify the state of a thread is accurate, the thread (internal) needs to be submitted, and the interface that submitted the thread, which creates test data, needs to be called to create thread data (i.e., interface parameters) to obtain the state of the thread.
Another example is as follows: at present, certified revenue nodes of professional training need to be reached, but a professional training system is not a testing system, belongs to an external system with a large system to be tested, or is a third party, and although the professional training system can actually go through a certified process to reach, the time and the resources are consumed, and the cost and the resources are consumed, so that the professional training system can quickly reach by creating or submitting message subject numbers to reissue message bodies to reach, and the efficiency is improved.
Therefore, for the inside of the system, the interface data can be constructed, and for the outside of the system, the data can be obtained by monitoring (intercepting) the message body of the third-party system, so that the more complete test data for verifying the function of the system to be tested can be obtained, and the function of the system to be tested can be tested by effectively providing the data in an auxiliary manner between the interface data and the message body of the third-party system. The process of creating the test data does not influence the creation of the test data by setting and modifying parameters which are not critical or have no influence on system change, and the whole process including the involved external processes all require data and the like.
In one embodiment, during testing, external test data is obtained, such as a certified revenue node status monitoring MQ for professional training: selecting to send MQ messages in a program, keying in message subject number names, storing, adding a consumer in the service of a message body, and then selecting a preset message body, wherein the preset message body is as the same as a receiving address and can be preset in advance, for example, in a key-value Json character string form, keys can be keyed in the preset message body, and the types of the values needing to be selected obtain a default value; then, the specific value needs to be modified, the setting of the specific value and the setting of the specific value of the interface are the same random function library to be called, the corresponding function can be selected through an interactive interface to quickly generate the specific value, then a reissue button is clicked to send a message body, after the message body is sent, the message body can be stored, and the calling can be continued next time; then, after the message body is successfully sent, whether the revenue node is reached can be inquired by monitoring the message body. Thus, the process is more efficient than the process of actually taking away the business party.
It can be seen that, in the embodiment of the present invention, the inside and outside of the system under test are distinguished, and the data of the position of the associated node is obtained by distinguishing the setting and construction data of the interface parameters and by combining the external message body monitoring mode, so that the test data can be efficiently and accurately created, the service environment and the service data of the system under test do not need to be studied and familiar excessively, the test data can be created and verified for any changed or unchanged function of the system under test based on the message subscription and the interface creation, and the creation of the generalized test data based on the message subscription is realized.
Therefore, the technical scheme for creating the test data provided by the invention can be applied to more service scenes and fields in an expanded way, does not need to have excessive service experience requirements on test data creating personnel, is a generalized, simple and efficient data creating scheme, and particularly for a third party outside a system, only a message body (based on message subscription) of the third party needs to be monitored to obtain the test data of an upstream node or a downstream node, so that the test data obtaining mode is further simplified, the third party does not need to execute the process completely to obtain the data related to the external functions of the system, namely, the data are directly utilized, and the creating efficiency of the system test data is further improved.
Furthermore, the invention can quickly construct the interface and send the message body by presetting a default value for the interface or the message body and then correcting the specific value through a random function. The default function and the random function are cores, and some construction functions with specific parameters are packaged in the cores, and meanwhile secondary development is supported.
[ example 2 ]
In order to make the objects, technical solutions and advantages of the present invention more apparent, a system implementation of the present invention is described in further detail below with reference to specific embodiments and with reference to the accompanying drawings.
In one embodiment of the invention, the user behavior monitoring system based on the bastion machine mainly comprises a rule module, a rule module and a judgment module, wherein the rule module is used for presetting a judgment rule; the analysis module is used for carrying out data analysis according to a judgment rule on the current user behavior in the real-time data stream based on the bastion machine log so as to predict whether the current user behavior is abnormal or not; and the processing module is used for alarming when the user behavior is abnormal.
The main block diagram of one embodiment of the system of the present invention shown in fig. 2 will be described. In this embodiment, the system includes at least a distinguishing module 110, a setting module 120, and a creating module 130.
The distinguishing module 110 is configured to determine a key parameter and a non-key parameter for a parameter transmitted by an interface of the system under test.
The setting module 120 is configured to preset a unified default value for the non-critical parameter, and enter a value related to a service test for the critical parameter.
A creating module 130, configured to create test data according to the value of the key parameter and the default value of the non-key parameter, and/or according to a value in a preset message body.
The distinguishing module 110 specifically determines a key parameter and a non-key parameter for a parameter transmitted from an interface of the system under test, and selects an external service on which the system under test depends to reissue a message body and monitor a message arrival condition to trigger a functional service process for linking up the system under test.
In one embodiment, the tool for creating test data is actually an application APP or software, platform. Taking software as an example, it may be a developed program that can be used to build an interface quickly. Further, it may at least include an internal functional interface construction part of the system under test and a message monitoring function part (external) of a third-party service, or an upstream node and a downstream node, on which the system under test depends, to quickly complete the functional verification of the system under test.
In one embodiment, the method of the present invention may first comb the interfaces that may be involved in the system under test that needs to create test data.
Carding interfaces such as: after the corresponding interface document is obtained, the system scope determination (for example, whether the system internal/internal function is, or the system external/dependent external function or external system, etc.) is performed on the interface based on the familiarity (experience) of the service, and here, the manual service experience is mainly combined with the manual determination mode to perform the differentiation. Further, the main process interface link may be separated from the functional process of the system under test, where the internal function (e.g., internal traffic) and the external function (e.g., external traffic on which the system under test depends) of the system under test may be involved.
In one embodiment, if the internal function of the system under test related to the system under test is targeted, the function verification can be quickly realized by adding the interface mode, and the interface template developed in the application program APP for creating the test data is called to create the initialization interface, so that the interface is increased.
Further, a visual web page can be provided during program development, and a tester can visually obtain a preliminary (initialization/default) interface.
In one embodiment, if the external function of the system under test, that is, the external function that the system under test depends on, is targeted, a corresponding message topic number may be constructed, and a preset message body template is selected, so that a preliminary (initialization/default) message body may be obtained. Thus, the node logic and the monitoring message body can be triggered by sending the message body to obtain the incoming parameters.
In one embodiment, based on the service flow and the service data of the system to be tested, the influence surface of the transmitted parameters (hereinafter, referred to as parameters) in the service may be determined to determine whether the function of the parameter-transmitting system to be tested has substantial influence. And the influence surface of the parameter is mainly judged by a manual mode and a code scanning mode. Specifically, based on the specific scenario, the specific business process, and the specific business data related to the system under test, the parameter may be obtained manually and/or in a code scanning manner, for example, the parameter may be obtained in a manner of combining manually and in a code scanning manner, so as to obtain the parameter and obtain the parameter transmission value. An example is as follows: the code scanning can scan the code interface by means of the existing code scanning tool, so that the transmitted parameter is obtained, a detailed interface analysis result report is generated by combining the mandatory filling attribute, the parameter uniqueness and the degree (parameter reference degree) of the output parameter (called parameter for short) used for other interfaces of the transmitted parameter, and then parameters are manually analyzed to be key parameters and parameters can be preset to be non-key parameters. The key measurement indexes are that specific service implementation needs to be seen, services are different, and the key of parameters is different, so that judgment is more accurate and effective by combining manual analysis.
Examples of determining critical parameters are:
for an interface that submits a thread, the incoming parameters are: activity id, recommender name, recommended person id, city, creation time, and update time. By analyzing the business and constructing the interface, the influence surfaces of the names of the recommenders, the cities, the creation time and the update time are small, but the activity id, the recommenders id and the recommenders id are very critical to the subsequent process. Thus, the key parameters of the interface are activity id, recommended person id and recommended person id, and the non-key parameters are recommended person name, city, creation time and update time.
For message body interception via message subscription, such as sending an external system service function message body, a professional training system (third party/external, upstream/downstream node) is required to walk to an authenticated node to trigger the system under test to internally reach the authenticated revenue node, creating a test scenario in which a hiring order is generated. Analytically, the certified process superlength of the vocational training system takes a long time if the process is really operated, and if the vocational training system performs function iteration, familiarity and actual implementation of the iterative function are required to be added, so that unnecessary testing cost is increased. In one embodiment of the present invention, the authenticated status can be monitored by setting a message topic number for an external system on which the system under test depends. For example: the message body is created from a template/message body library and the reissued message body quickly reaches an authenticated state (i.e., the parameters of the node needed for acquisition can be intercepted based on the message subscription).
An example of an application: assuming that more than 30 parameters need to be transmitted into an interface, analyzing which transmitted parameters are decisive for the response result, such as a commission-rule-generating transmission interface, including rule name, rule description, rule effective time, rule failure time, recommended service type name, recommended person type, rule effective period, rule city, rule time, rule node, rule old-new identifier, rule transmission state, rule node description, rule node amount configuration, applicable group of rule node, commission-returning type of rule sub-item, commission-returning type, commission-returning old configuration, recommended service type of commission-returning, commission-returning type of commission-returning, rule node effective time, failure time, whether rule node is accounting by period, rule node is accounting by month, accounting by natural day, whether secondary accounting is performed, secondary accounting is performed without commission returning identity, the amount of secondary settlement, the effective time and the ineffective time of the secondary node and the like. In such a large number of parameters, it can be determined that the critical parameters are actually only the recommended service type, the recommended person type, the effective time, and the ineffective time, based on the service analysis. Therefore, it can be determined that the parameters transmitted through the interface really affect the use of the rule, and the rest are non-critical parameters, and do not have excessive influence on the subsequent process, just to ensure the integrity of the rule.
In one embodiment, the created test data is test data of the overall business process involved in the system under test. The present invention may include a process related to the internal function of the system and a process related to the external function of the system, such as: the state of the thread needs to be verified to be accurate, the thread needs to be submitted, and thus the interface for submitting the thread needs to be called to create the thread data, so that the state of the thread can be acquired, and the thread submitting belongs to the process of creating the test data. For another example: at present, an authenticated income node of professional training needs to be reached, but a professional training system is not a testing system, but an external system of a system to be tested or a dependent third party, although the authenticated procedure can be actually taken to reach, the time, the cost and the resources are too long, a message body is submitted through a message subject number to be subsidized, for example, a corresponding message body (a default value) is provided from a message body library according to the message subject number, a specific value is modified, and the message body is subsidized to reach, so that the goal of quick arrival can be achieved, and the efficiency is improved.
By constructing interface data and a reissued message body, namely based on interface creation and message subscription, the interface data and the reissued message body can effectively assist a testing means for testing the functions of the system to be tested.
It can be seen that, in this embodiment of the present invention, for the internal service of the system under test, a required interface is created or added according to a corresponding service scenario through an existing template, a message body is created for the external service (a dependent third-party system, etc.) of the system under test, and whether one or more incoming parameters are critical parameters is determined in a combination manner of code scanning and manual judgment. Thereby narrowing the scope for creating test data for testing critical parameters.
The setting module 120, in particular, in one embodiment, presets the non-critical parameters to a uniform default value, for example, calls a default function, and may generate a random value based on the interface template and the random generator. Such as: non-critical parameters for a submission cue are the name of the recommender, the name of the person to be referred, the city, the time of creation, and the time of update. The names of the recommenders and the names of the recommenders are in a character string form, can be task characters, do not support idempotent, and can be directly fixed, for example, the names can be set to be preset fixed characters, such as Zhang three, Liquan and the like, and the names have no influence on the system to be tested; the city belongs to a table base code, and the service process can be set to have no influence on which city, for example, the city can be set to be a preset fixed city; creation time and update time, the time may be directly taken, and so on.
An example of the application may be that there is a setting in the interface template, and on the interface interacting with the person who creates the test data, the selection type provided by the pull-down box, various menus, etc. may be used to set default values for the parameters that do not affect the whole system to be tested. Such as the name of the recommender and the name of the person to be recommended, the character type is selected, and then the default value program of the character type of the program can be called to directly display a default character. For example, if a city is selected, the city default program is invoked, and the city has a default city code. And so on.
In one embodiment, the critical parameter is an important parameter affecting the interface, and thus, it may be modified herein, and the modification may include but is not limited to: manually modifying, calling one or more preset functions to assist generation, and the like. For example, recommending a month-sister as a merchant, wherein the identity card is a key parameter and supports idempotent and real-name authentication, a character cannot be typed at will, the identity card type needs to be selected, and then an identity card random generator (random function) of a corresponding program can be called, so that a key parameter (meta parameter) can be obtained quickly.
Further, the relevance of the parameter includes part of specific logic of the parameter, is not easy to generate, can be some specific parameters in life, such as an identity number, such as openid of WeChat, such as an operation license and the like, or specific values of a system per se, some ids appointed in the system can not be hit by keying errors, and these also need to be processed, a connection database is supported in a random function, and corresponding data can be found out as the parameter by keying in an sql query statement. This ensures the accuracy of the incoming parameters.
Furthermore, some identification parameters, such as unique values, such critical parameters are not supported to be idempotent and do not need to be repeated, for example, a registration interface in an interface needs to be transmitted with a non-repeated mobile phone number, that is, the mobile phone number must be unique and cannot be repeated. The random function is introduced, and specific values can be quickly de-duplicated and quickly constructed in the data generating and querying processes.
In addition, the critical parameters must be unique, while the non-critical parameters do not have to be unique. Such as creation time, which may be unique but is a non-critical parameter in the internal traffic of many systems under test.
It can be seen that, in this embodiment of the present invention, after distinguishing the key parameter and the non-key parameter, a preset default value (for example, a value may be given through a default function) is given when an interface or a message body is created, and then a specific value of the key parameter is corrected (for example, the specific value may be corrected through a random function), so that a uniform default value is randomly preset for the non-key parameter, and a corrected specific value (for example, a unique value that can be used for testing a system to be tested) is obtained for the key parameter through random function generation and/or interactive interface typing, and it is not necessary for a tester to spend a large amount of time constructing too much service data.
The creating module 130, specifically, in an embodiment, the tool for creating the test data is actually a developed application program APP or software, platform, which can be used for quickly constructing the interface. Further, it may at least include an internal functional interface construction part of the system under test and a message monitoring function part (external) of a third-party service on which the system under test depends, so as to quickly complete the functional verification of the system under test.
In one embodiment, the main process interface link is analyzed from the functional process of the system under test, and the internal function (such as internal service) and the external function (such as external service) of the system under test are determined/distinguished.
Further, as described above, in the process of distinguishing the key parameters from the non-key parameters, if the internal functions of the system to be tested are aimed at, the interfaces can be added, the interface template developed by the system itself is called, and the initialization interface is created, so that the interfaces are increased, and a visual web page can be provided during program development, so that a tester can visually obtain a preliminary (initialization/default) interface.
Further, as in the foregoing process of distinguishing the key and non-key parameters, if the external function of the system under test is targeted, a message topic number may be constructed, a preset message body template may be selected, and a preliminary (initialization/default) message body may be created.
In one embodiment, based on the service and the service data of the system to be tested, the influence surface of the transmitted parameter (called parameter for short) in the service can be used for judging, and whether the parameter value has substantial influence or not is determined. And the influence surface of the parameter is mainly determined by manual + code scanning. Specifically, based on the system under test specifically related to the scene, the service and the service data, the parameter may be obtained in a manual and/or code scanning manner, for example, the parameter may be obtained in a manner of combining manual and code scanning, and a parameter value is obtained, see the foregoing process for determining the key parameter. The key measurement indexes are that specific service implementation needs to be seen, services are different, and the key of parameters is different, so that judgment is more effective by combining manual analysis. Here, the interfaces to the system under test include the added interfaces, and it is determined whether the parameters passed through them are critical parameters or non-critical parameters, as described above.
An example of an internal interface that takes into account the aforementioned distinction as system internal functions and submission hints: in the input parameters, the key parameters which are determined to be input by the interface are activity id, recommended person id and recommended person id, and the non-key parameters are recommended person name, city, creation time and update time.
The method is divided into external functions of the system, a test scene that a professional training system (an external system non-to-be-tested system) business process needs to go to an authenticated node to trigger the interior of the to-be-tested system to reach an authenticated income node is created, and a hired order is generated.
In an embodiment, according to the creating of the interface and the message body and the determining of the key or non-key nature of the transmission parameter, a default value may be uniformly preset for the non-key parameter, and a specific value may be modified for the key parameter through an interaction and/or random function, such as generating a value related to a service test, and creating required test data for an entire service flow related to the system under test according to a node logic status.
Further, the created test data includes data of parameters related to interfaces created by some related processes of internal functions, and also includes data of some related processes of external/external functions of the system.
Specific examples thereof are: to verify the state of a thread is accurate, the thread (internal) needs to be submitted, and the interface that submitted the thread, which creates test data, needs to be called to create thread data (i.e., interface parameters) to obtain the state of the thread.
Another example is as follows: at present, certified revenue nodes of professional training need to be reached, but a professional training system is not a testing system, belongs to an external system with a large system to be tested, or is a third party, and although the professional training system can actually go through a certified process to reach, the time and the resources are consumed, and the cost and the resources are consumed, so that the professional training system can quickly reach by creating or submitting message subject numbers to reissue message bodies to reach, and the efficiency is improved.
Therefore, for the inside of the system, the interface data can be constructed, and for the outside of the system, the data can be obtained by monitoring (intercepting) the message body of the third-party system, so that the more complete test data for verifying the function of the system to be tested can be obtained, and the function of the system to be tested can be tested by effectively providing the data in an auxiliary manner between the interface data and the message body of the third-party system. The process of creating the test data does not influence the creation of the test data by setting and modifying parameters which are not critical or have no influence on system change, and the whole process including the involved external processes all require data and the like.
In one embodiment, during testing, external test data is obtained, such as a certified revenue node status monitoring MQ for professional training: selecting to send MQ messages in a program, keying in message subject number names, storing, adding a consumer in the service of a message body, and then selecting a preset message body, wherein the preset message body is as the same as a receiving address and can be preset in advance, for example, in a key-value Json character string form, keys can be keyed in the preset message body, and the types of the values needing to be selected obtain a default value; then, the specific value needs to be modified, the setting of the specific value and the setting of the specific value of the interface are the same random function library to be called, the corresponding function can be selected through an interactive interface to quickly generate the specific value, then a reissue button is clicked to send a message body, after the message body is sent, the message body can be stored, and the calling can be continued next time; then, after the message body is successfully sent, whether the revenue node is reached can be inquired by monitoring the message body. Thus, the process is more efficient than the process of actually taking away the business party. Therefore, the function of sending the message body can be supported, the relevant service does not need to actually go away the service flow to create the test data, and the test data can be created by monitoring the message body appointed by both parties.
This embodiment of the invention can be seen. The upstream service test data is quickly created by presetting a default value for the interface, and the test data is created by monitoring the message body of the related service party, so that the method is efficient and quick. The method distinguishes the inside and the outside of the system to be tested, obtains the data of the position of the associated node by distinguishing, setting and constructing data of the interface transmission parameters and combining with the mode of monitoring the external message body, thereby efficiently and accurately establishing the test data, needing not to study and familiarize the service environment and the service data of the system to be tested, establishing the interface based on the message subscription, and verifying the test data established by any changed or unchanged function of the system to be tested, namely realizing the establishment of the generalized test data based on the message subscription.
Therefore, the technical scheme for creating the test data provided by the invention can be applied to more service scenes and fields in an expanded way, does not need to have excessive service experience requirements on test data creating personnel, is a generalized, simple and efficient data creating scheme, and particularly for a third party outside a system, only a message body (based on message subscription) of the third party needs to be monitored to obtain the test data of an upstream node or a downstream node, so that the test data obtaining mode is further simplified, the third party does not need to execute the process completely to obtain the data related to the external functions of the system, namely, the data are directly utilized, and the creating efficiency of the system test data is further improved.
Furthermore, the invention can quickly construct the interface and send the message body by presetting a default value for the interface or the message body and then correcting the specific value through a random function. The default function and the random function are cores, and some construction functions with specific parameters are packaged in the cores, and meanwhile secondary development is supported.
[ example 3 ]
One partner is mainly a method for creating test data by a person who creates the test data, and the method is applied to the example of a specific scene of creating the test data by an interface:
for functions within the system under test: adding 10 new interfaces, and having more than 30 incoming parameters; finding key parameters of the incoming parameters, such as one or more key parameters, and entering values related to the service for the key parameters; performing default value presetting processing on other non-key parameters, namely presetting the parameters as uniform default values; and for unique values, a random function is introduced. Thus, the person creating the test data can create the partner test data, namely the data of the upstream or associated business required by the test, by only typing in the key parameters and then clicking the submission form.
For functions outside the system under test: the function of sending the message body can be added, the test data can be created by monitoring the message body agreed by both parties without actually going to the service flow to create the test data for the related service.
Therefore, the upstream service test data can be quickly created by presetting the default value for the interface, and/or the message body is preset with the default value and the message body monitoring node logic of the related service party is monitored, so that the node can be quickly reached, the test data can be quickly created, and the method is efficient and convenient.
The specific application of the implementation of the aforementioned embodiments 1, 2 of the solution of the invention is further described below with reference to a functional schematic of an application shown in fig. 3.
Throughout the operation of the system under test, there are internal functional components 310 and external functional components 320. According to the service logic of the actual application scene of the system to be tested, for internal functions, particularly newly added internal functions, internal test data need to be obtained during testing, a corresponding initialization interface (a unified default value is preset) can be created according to an interface template library, and based on the actual application service scene of the system to be tested, which interface parameters belong to key parameters and which interface parameters belong to non-key parameters are distinguished, and specific value modification is carried out on the key parameters through random function generator and/or interface interaction, so that interface test data are constructed, an interface request is sent for testing, and the next interface test is carried out after an interface result is successfully returned; for the external function, the external test data is obtained by sending the message body, the message body can be selected to be sent first, the name of the message subject number is keyed in and stored, so that a consumer is newly added in the service of the message body, then a preset message body is selected from a message body library, namely an initialization message body is obtained, default values (such as default values of added key and value) are also preset, the preset default values are modified through a random function generator and/or interface interaction, the specific values are required to be modified, then the message body is reissued, the message body is stored for subsequent calling after the message body is sent, the message body is monitored after the message body is sent successfully, and the node triggering logic is used for inquiring whether the income node is reached or not to obtain the test data.
In the specific scheme of the embodiment of the invention, the efficient tool (software/program/platform) for creating the test data based on the generalization of the message subscription is provided, and when the data of the upstream or associated service is required to be used as the test data in the process of testing the universal function module, the opposite party (third party) does not need to give the test data, or the opposite party provides a service function flow document and the like, and does not need to be very unfamiliar with the service. The scheme of the invention mainly combs the service interface, and the transmission value of a plurality of necessary parameters has no substantial influence on the service and can be set as a default value. And, through adding the interface function, the interface is introduced into the parameter and can preset the default value, for example, a partner newly-increased interface, there are more than 30 introduced parameters, except several key parameters, other parameters can preset the uniform default value), for the unique value, introduce the random function, therefore only need to type key parameter. Then click on the submit form, a partner test data is easily created. Furthermore, the function of sending the message body is supported, the related service does not need to actually go away the service flow to create the test data, and the test data can be created by monitoring the message body appointed by both parties. In general, the invention can quickly create the upstream service test data by presetting the default value for the interface, and meanwhile, creates the test data by monitoring the message body of the related service party, thereby being efficient and quick. Therefore, effective test data of internal functions and external functions can be obtained simply, quickly and rapidly for any system to be tested which is not familiar with the service.
[ example 4 ]
Fig. 4 is a schematic block diagram of the structure of an electronic device according to an embodiment of the present invention, which includes a processor and a memory, the memory storing a computer-executable program, and the processor executing the title identifying method as in the foregoing embodiment 1 when the computer program is executed by the processor.
As shown in fig. 4, the electronic device is in the form of a general purpose computing device. The processor can be one or more and can work together. The invention also does not exclude that distributed processing is performed, i.e. the processors may be distributed over different physical devices. The electronic device of the present invention is not limited to a single entity, and may be a sum of a plurality of entity devices.
The memory stores a computer executable program, typically machine readable code. The computer readable program may be executed by the processor to enable an electronic device to perform the method of the invention, or at least some of the steps of the method.
The memory may include volatile memory, such as Random Access Memory (RAM) and/or cache memory, and may also be non-volatile memory, such as read-only memory (ROM).
Optionally, in this embodiment, the electronic device further includes an I/O interface, which is used for data exchange between the electronic device and an external device. The I/O interface may be a local bus representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, and/or a memory storage device using any of a variety of bus architectures.
More specifically, refer to a block diagram of a more specific example of the electronic device according to the embodiment shown in fig. 5. The electronic device 200 of the exemplary embodiment is represented in the form of a general purpose data processing device. The components of the electronic device 200 may include, but are not limited to: at least one processing unit 210, at least one memory unit 220, a bus 230 connecting different system components (including the memory unit 220 and the processing unit 210), a display unit 240, and the like.
The storage unit 220 stores a computer readable program, which may be a code of a source program or a read-only program. The program may be executed by the processing unit 210 such that the processing unit 210 performs the steps of various embodiments of the present invention. For example, the processing unit 210 may perform the steps of the methods of the foregoing embodiments 2 to 5.
The memory unit 220 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)2201 and/or a cache memory unit 2202, and may further include a read only memory unit (ROM) 2203. The storage unit 220 may also include a program/utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 230 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 200 may also communicate with one or more external devices 300 (e.g., keyboard, display, network device, bluetooth device, etc.), enable a user to interact with the electronic device 200 via the external devices 300, and/or enable the electronic device 200 to communicate with one or more other data processing devices (e.g., router, modem, etc.). Such communication may occur via input/output (I/O) interfaces 250, and may also occur via network adapter 260 with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network such as the Internet). The network adapter 260 may communicate with other modules of the electronic device 200 via the bus 230. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
It should be understood that the electronic device shown in fig. 4 and 5 is only one example of the present invention, and elements or components not shown in the above examples may be further included in the electronic device of the present invention. For example, some electronic devices further include a display unit such as a display screen, and some electronic devices further include a human-computer interaction element such as a button, a keyboard, and the like. Electronic devices are considered to be covered by the present invention as long as the electronic devices are capable of executing a computer-readable program in a memory to implement the method of the present invention or at least a part of the steps of the method.
[ example 5 ]
Fig. 6 is a schematic diagram of a computer-readable recording medium of an embodiment of the present invention. As shown in fig. 6, a computer-readable recording medium stores therein a computer-executable program that, when executed, implements the title identifying method of the present invention described above. The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
From the above description of the embodiments, those skilled in the art will readily appreciate that the present invention can be implemented by hardware capable of executing a specific computer program, such as the system of the present invention, and electronic processing units, servers, clients, mobile phones, control units, processors, etc. included in the system, and the present invention can also be implemented by a vehicle including at least a part of the above system or components. The invention can also be implemented by computer software for performing the method of the invention, for example, by control software executed by a microprocessor, an electronic control unit, a client, a server, etc. of the locomotive side. It should be noted that the computer software for executing the method of the present invention is not limited to be executed by one or a specific hardware entity, but may also be implemented in a distributed manner by hardware entities without specific details, for example, some method steps executed by the computer program may be executed at the locomotive end, and another part may be executed in the mobile terminal or the smart helmet, etc. For computer software, the software product may be stored in a computer readable storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or may be distributed over a network, as long as it enables the electronic device to perform the method according to the present invention.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments of the present invention described herein can be implemented by software, and can also be implemented by software in combination with necessary hardware.
While the foregoing embodiments have described the objects, aspects and advantages of the present invention in further detail, it should be understood that the present invention is not inherently related to any particular computer, virtual machine or electronic device, and various general-purpose machines may be used to implement the present invention. The invention is not to be considered as limited to the specific embodiments thereof, but is to be understood as being modified in all respects, all changes and equivalents that come within the spirit and scope of the invention.

Claims (10)

1. A method of creating test data, comprising:
determining key parameters and non-key parameters of parameters transmitted by an interface of a system to be tested;
uniformly presetting default values for the non-key parameters and correcting specific values for the key parameters;
and creating test data for testing the system to be tested according to the specific value of the parameter corresponding to the interface, the default value of the non-key parameter and/or the monitored node triggered by the reissued message body.
2. The method of claim 1, wherein before determining the critical parameters and the non-critical parameters for the parameters transmitted from the interface of the system under test, further comprising:
analyzing a flow link of the system to be tested to distinguish an internal function and an external function of the system to be tested;
if the function is an internal function, establishing an initialization interface through interface template library and/or interface interaction according to a default function;
and if the external function is the external function, based on the message subscription, establishing an initialization message body corresponding to the external system which is indicated by the external function and depended on by the system to be tested.
3. The method of claim 2, wherein the creating an initialization message body comprises:
and corresponding to the added service of the external system, constructing a corresponding message subject number through interface interaction selection, selecting a corresponding message body according to a default value and a message body library, and reissuing the message body.
4. The method according to claim 2, wherein corresponding to the added service of the external system, the corresponding message subject number is selected and constructed through interface interaction, and the corresponding message body is selected according to a default value and a message body library and is reissued to the message body, specifically comprising:
modifying the selected corresponding message body through a random function to obtain a specific value;
and monitoring the reissued message body at regular time or in real time to determine the node trigger corresponding to the external function of the third-party system.
5. The method according to any one of claims 1 to 4, wherein determining the critical parameters and the non-critical parameters for the parameters transmitted from the interface of the system under test specifically comprises:
acquiring parameters in a code scanning mode based on internal services corresponding to internal functions in the system to be tested and external services of an external system which corresponds to the external functions and is depended on by the system to be tested;
and combining the obtained parameters with the service analysis of the system to be tested, and determining that the parameters which can substantially influence the response result of the service rule are key parameters and the parameters which cannot substantially influence the service rule are non-key parameters in one or more parameters transmitted by the interface.
6. The method according to any one of claims 1 to 5, wherein uniformly presetting default values for the non-critical parameters and correcting specific values for the critical parameters specifically comprises:
generating a preset default value of a non-key parameter when the interface is created based on an interface template and a random generator according to a default value function;
and based on the preset default value, modifying the preset default provided by the key parameter when the interface is created according to a random function and interface interaction to obtain a modified specific value.
7. The method according to any one of claims 1 to 6, wherein creating test data for testing a system under test according to a specific value of the parameter corresponding to an interface and a default value of the non-critical parameter, and/or according to a node triggered by a monitored reissued message body specifically comprises:
generating test data according to the specific value of the corresponding key parameter and the default value of the non-key parameter in the interface of the system to be tested, and sending an interface request;
and/or the presence of a gas in the gas,
and according to the monitored message body, obtaining a specific value of the message body corresponding to a node on a flow link of the system to be tested, which is triggered by an external system on which the system to be tested depends, and generating test data.
8. A system for creating test data, comprising:
the distinguishing module is used for determining key parameters and non-key parameters of parameters transmitted by an interface of the system to be tested;
the setting module is used for uniformly presetting default values for the non-key parameters and correcting specific values for the key parameters;
and the creating module is used for creating test data for testing the system to be tested according to the specific value of the parameter corresponding to the interface, the default value of the non-key parameter and/or the monitored node triggered by the reissued message body.
9. An electronic device comprising a processor and a memory, the memory for storing a computer-executable program, characterized in that:
the computer program, when executed by the processor, performs the method of any of claims 1 to 7.
10. A computer-readable storage medium storing a computer-executable program, wherein the computer-executable program, when executed, implements the method of any of claims 1 to 7.
CN202110606332.4A 2021-05-31 2021-05-31 Method, system, equipment and medium for creating test data Active CN113282499B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110606332.4A CN113282499B (en) 2021-05-31 2021-05-31 Method, system, equipment and medium for creating test data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110606332.4A CN113282499B (en) 2021-05-31 2021-05-31 Method, system, equipment and medium for creating test data

Publications (2)

Publication Number Publication Date
CN113282499A true CN113282499A (en) 2021-08-20
CN113282499B CN113282499B (en) 2024-02-09

Family

ID=77282889

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110606332.4A Active CN113282499B (en) 2021-05-31 2021-05-31 Method, system, equipment and medium for creating test data

Country Status (1)

Country Link
CN (1) CN113282499B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114691517A (en) * 2022-04-11 2022-07-01 北京百度网讯科技有限公司 Test method, device, equipment and storage medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090319832A1 (en) * 2008-06-23 2009-12-24 International Business Machines Corporation Method and apparatus of effective functional test data generation for web service testing
CN107122297A (en) * 2017-04-18 2017-09-01 上海雷腾软件股份有限公司 The method and apparatus that request message for test interface is generated
US20180089072A1 (en) * 2016-09-23 2018-03-29 International Business Machines Corporation Automated testing of application program interface
CN108563569A (en) * 2018-04-11 2018-09-21 中国电子科技集团公司第十四研究所 A kind of warnlng surveillance system automation interface test method
CN109558525A (en) * 2018-12-12 2019-04-02 北京锐安科技有限公司 A kind of generation method of test data set, device, equipment and storage medium
CN109918300A (en) * 2019-02-27 2019-06-21 苏州浪潮智能科技有限公司 A test data preparation method, device, terminal and storage medium
CN110347590A (en) * 2019-06-18 2019-10-18 平安普惠企业管理有限公司 The interface testing control method and device of operation system
CN110597714A (en) * 2019-08-28 2019-12-20 深圳市彬讯科技有限公司 Kafka message testing method, device, computer equipment and storage medium
US20200065228A1 (en) * 2018-08-23 2020-02-27 International Business Machines Corporation Function-message oriented test case generation for supporting continuous globalization verification testing
CN110888797A (en) * 2019-10-11 2020-03-17 平安信托有限责任公司 Test data generation method, device, computer equipment and storage medium
CN111221735A (en) * 2020-01-08 2020-06-02 福建博思软件股份有限公司 System for automatically generating service interaction test script
CN112162915A (en) * 2020-08-27 2021-01-01 杭州大搜车汽车服务有限公司 Test data generation method, device, equipment and storage medium
CN112579446A (en) * 2020-12-10 2021-03-30 北京软通智慧城市科技有限公司 Interface testing method and device, electronic equipment and storage medium
CN112817853A (en) * 2021-01-30 2021-05-18 北京奇保信安科技有限公司 Automatic test method, system and electronic equipment

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090319832A1 (en) * 2008-06-23 2009-12-24 International Business Machines Corporation Method and apparatus of effective functional test data generation for web service testing
US20180089072A1 (en) * 2016-09-23 2018-03-29 International Business Machines Corporation Automated testing of application program interface
CN107122297A (en) * 2017-04-18 2017-09-01 上海雷腾软件股份有限公司 The method and apparatus that request message for test interface is generated
CN108563569A (en) * 2018-04-11 2018-09-21 中国电子科技集团公司第十四研究所 A kind of warnlng surveillance system automation interface test method
US20200065228A1 (en) * 2018-08-23 2020-02-27 International Business Machines Corporation Function-message oriented test case generation for supporting continuous globalization verification testing
CN109558525A (en) * 2018-12-12 2019-04-02 北京锐安科技有限公司 A kind of generation method of test data set, device, equipment and storage medium
CN109918300A (en) * 2019-02-27 2019-06-21 苏州浪潮智能科技有限公司 A test data preparation method, device, terminal and storage medium
CN110347590A (en) * 2019-06-18 2019-10-18 平安普惠企业管理有限公司 The interface testing control method and device of operation system
CN110597714A (en) * 2019-08-28 2019-12-20 深圳市彬讯科技有限公司 Kafka message testing method, device, computer equipment and storage medium
CN110888797A (en) * 2019-10-11 2020-03-17 平安信托有限责任公司 Test data generation method, device, computer equipment and storage medium
CN111221735A (en) * 2020-01-08 2020-06-02 福建博思软件股份有限公司 System for automatically generating service interaction test script
CN112162915A (en) * 2020-08-27 2021-01-01 杭州大搜车汽车服务有限公司 Test data generation method, device, equipment and storage medium
CN112579446A (en) * 2020-12-10 2021-03-30 北京软通智慧城市科技有限公司 Interface testing method and device, electronic equipment and storage medium
CN112817853A (en) * 2021-01-30 2021-05-18 北京奇保信安科技有限公司 Automatic test method, system and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114691517A (en) * 2022-04-11 2022-07-01 北京百度网讯科技有限公司 Test method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113282499B (en) 2024-02-09

Similar Documents

Publication Publication Date Title
US11099973B2 (en) Automated test case management systems and methods
US11362912B2 (en) Support ticket platform for improving network infrastructures
US8745590B2 (en) Testing an application
KR100945282B1 (en) Authentication method for management software implementation
JP2005501325A (en) A method for remotely inquiring configuration information of a networked computer device, measuring it safely and communicating it safely
CN107977308A (en) interface test method and device
US20080133739A1 (en) Response time benchmarking
CN110011875A (en) Dial-testing method, apparatus, device and computer-readable storage medium
US20190138433A1 (en) Evaluation of library test suites using mutation testing
CN113360376A (en) Buried point testing method and device
CN113742408B (en) Data interaction method based on dynamic analysis of Protobuf protocol
US20210073676A1 (en) Model improvement support system
CN112540924A (en) Interface automation test method, device, equipment and storage medium
CN112015715A (en) Industrial Internet data management service testing method and system
CN110888816A (en) Program testing method, program testing device and storage medium
CN105955838A (en) System halt reason check method and device
CN113282499A (en) Method, system, device and medium for creating test data
US12147292B1 (en) Systems and methods for determining errors during execution of multiple applications
CN111367867B (en) Log information processing method and device, electronic equipment and storage medium
CN111190824A (en) Monitoring method, monitoring device, terminal equipment and storage medium
CN113872919B (en) A vulnerability scanning method and device
CN114842568A (en) Intelligent inspection method, device, equipment and storage medium
CN107872493A (en) A kind of information processing method, terminal and server
CN111159988A (en) Model processing method and device, computer equipment and storage medium
CN105681410B (en) A method and device for tracking and recording debugging information

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
GR01 Patent grant
GR01 Patent grant