CN113297087A - Test method and device - Google Patents

Test method and device Download PDF

Info

Publication number
CN113297087A
CN113297087A CN202110639307.6A CN202110639307A CN113297087A CN 113297087 A CN113297087 A CN 113297087A CN 202110639307 A CN202110639307 A CN 202110639307A CN 113297087 A CN113297087 A CN 113297087A
Authority
CN
China
Prior art keywords
access request
access
data
specific
initiator
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110639307.6A
Other languages
Chinese (zh)
Inventor
安宁
袁立超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110639307.6A priority Critical patent/CN113297087A/en
Publication of CN113297087A publication Critical patent/CN113297087A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a testing method and a testing device, and relates to the technical field of computers. One embodiment of the method comprises: receiving an access request, and analyzing the access request to determine user identification information of an initiator initiating the access request; determining whether the initiator belongs to a specific visitor or not according to the user identification information; if so, performing enhancement processing on the access request to enable the initiator to access the specific first data; after the access request is subjected to enhancement processing, responding to the access request, and enabling the access request to access specific first data to obtain a specific first access result; if not, directly responding to the access request, and enabling the access request to access the second data to obtain a second access result. The embodiment distinguishes the common user and the specific user through the user identification information, enables the specific user to access the specific data under the condition that the user does not sense, and enables the normal user or the user without the user state not to be influenced, thereby being simple, convenient and easy to realize.

Description

Test method and device
Technical Field
The invention relates to the technical field of computers, in particular to a testing method and a testing device.
Background
Regression testing is a software test that is used to verify that code changes in the software do not affect the existing functionality of the product. Regression testing can ensure that the product will work properly with new functions, error recovery, or any change to existing functions. For example, for an e-commerce system, test data like "test goods, do not make a bill" and the like may occur because of the need to perform regression testing on an online environment or a grayscale environment. The test data is displayed to the foreground without the user state, so that the test data can be browsed by the user. Similar problems often occur in news, blogs. To avoid this problem, regression is usually performed when the user traffic is low, and the test data is deleted after the regression is completed. However, this approach does not essentially solve the problem, and the test data may still be accessible to the user, thereby causing adverse effects.
Disclosure of Invention
In view of this, embodiments of the present invention provide a testing method and apparatus, so that a specific user accesses specific data without sensing the user, and a normal user or a user without a user status is not affected, even if a tester accesses test data, a general user accesses general data. The embodiment of the invention distinguishes the common user and the specific user through the user identification information, and distinguishes the common data and the test data through the environment identification field, thereby being simple and convenient and easy to realize.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a test method including:
receiving an access request, and analyzing the access request to determine user identification information of an initiator initiating the access request;
determining whether the initiator belongs to a specific visitor or not according to the user identification information;
if so, performing enhancement processing on the access request to enable the initiator to access specific first data; after the access request is subjected to enhancement processing, responding to the access request, and enabling the access request to access the specific first data to obtain a specific first access result;
if not, directly responding to the access request to enable the access request to access the second data and obtain a second access result.
Optionally, before receiving the access request, the method further comprises: adding an environment identification field in a data table, and setting the value of the environment identification field of each data in the data table so as to determine the attribute of the data through the value of the environment identification field.
Optionally, determining whether the initiator belongs to a specific visitor according to the user identification information includes: determining whether the user identification information exists in a preset identification set; and if so, determining that the initiator belongs to a specific visitor.
Optionally, performing enhanced processing on the access request to enable the initiator to access specific first data includes: analyzing the access request, and determining an enhancement rule corresponding to the access request; according to the enhancement rule, enhancing the access request to enable the value of the access request access environment identification field to be first data of a first target value;
directly responding to the access request, causing the access request to access second data comprises: and directly responding to the access request, and enabling the access request to access second data with the value of the environment identification field as a second target value.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided a test apparatus including:
the request analysis module is used for receiving an access request and analyzing the access request so as to determine user identification information of an initiator initiating the access request;
the judging module is used for determining whether the initiator belongs to a specific visitor or not according to the user identification information;
the response module is used for performing enhancement processing on the access request under the condition that the initiator belongs to a specific visitor so as to enable the initiator to access specific first data; after the access request is subjected to enhancement processing, responding to the access request, and enabling the access request to access the specific first data to obtain a specific first access result; and under the condition that the initiator does not belong to a specific visitor, directly responding to the access request, and enabling the access request to access second data to obtain a second access result.
Optionally, the apparatus further includes a setting module, configured to add an environment identification field in the data table, and set a value of the environment identification field of each data in the data table, so as to determine the attribute of the data according to the value of the environment identification field.
Optionally, the determining module is further configured to: determining whether the user identification information exists in a preset identification set; and if so, determining that the initiator belongs to a specific visitor.
Optionally, the response module is further configured to: under the condition that the initiator belongs to a specific visitor, analyzing the access request and determining an enhancement rule corresponding to the access request; according to the enhancement rule, enhancing the access request to enable the value of the access request access environment identification field to be first data of a first target value;
and under the condition that the initiator does not belong to a specific visitor, directly responding to the access request, and enabling the access request to access second data with the value of the environment identification field as a second target value.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus including: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the testing method of the embodiment of the present invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored, the program implementing a test method of an embodiment of the present invention when executed by a processor.
One embodiment of the above invention has the following advantages or benefits: determining user identification information of an initiator initiating an access request by receiving the access request and analyzing the access request; determining whether the initiator belongs to a specific visitor or not according to the user identification information; if so, performing enhancement processing on the access request to enable the initiator to access specific first data; after the access request is subjected to enhancement processing, responding to the access request, and enabling the access request to access the specific first data to obtain a specific first access result; if not, the access request is directly responded, the access request is made to access the second data, the technical means of the second access result is obtained, under the condition that the user does not sense, the specific user is made to access the specific data, the normal user or the user without the user state is not influenced, and even if the tester accesses the test data, the common user accesses the common data. The embodiment of the invention distinguishes the common user and the specific user through the user identification information, and distinguishes the common data and the test data through the environment identification field, thereby being simple and convenient and easy to realize.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main flow of a test method of an embodiment of the present invention;
FIG. 2 is a schematic diagram of the main flow of a testing method according to another embodiment of the present invention;
FIG. 3 is a schematic diagram of the main modules of a test apparatus according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic view of a main flow of a test method of an embodiment of the present invention. The method can be used for regression testing of online environments. As shown in fig. 1, the method includes:
step S101: receiving an access request, and analyzing the access request to determine user identification information of an initiator initiating the access request.
The user identification information may include login information of the initiator, and more specifically, may include a user name or an ID. In this embodiment, the user identification information is used to determine the identity of the initiator, i.e. to distinguish whether the initiator is a specific user or a general user, and to distinguish whether the access request is a test request initiated by the specific user or an access request initiated by the general user.
Step S102: and determining whether the initiator belongs to a specific visitor or not according to the user identification information.
In this embodiment, an identification set may be preset to record user identification information of a specific user. After receiving the access request, determining whether the user identification information in the access request is in a preset identification set, and if so, determining that an initiator initiating the access request is a specific visitor. Otherwise, it may be determined that the initiator initiating the access request is not a particular visitor. For a user without a user state, the corresponding user identification information in the access request initiated by the user may be null or a preset fixed identification, and the fixed identification does not exist in the identification set. Here, a user without a user status refers to a user who is not logged in.
Step S103: and if so, performing enhancement processing on the access request to enable the initiator to access specific first data.
Step S104: and after the access request is subjected to enhancement processing, responding to the access request, enabling the access request to access the specific first data to obtain a specific first access result, and returning the first access result to the sender.
The enhancement processing is to inject some programs into the original program to enhance the functions of the original program. In this step, if it is determined that the initiator belongs to a specific visitor, the access request is enhanced so that the access request can access specific data. In this embodiment, if the access request is an SQL statement, the access request is dynamically enhanced by parsing an SQL syntax tree of the access request, so that the access request accesses specific data. In the present embodiment, the specific data may be test data. Sql (structured Query language) is a special purpose programming language, a database Query and programming language, used to access data and Query, update, and manage relational database systems.
Step S105: if not, directly responding to the access request to enable the access request to access the second data and obtain a second access result.
In this step, if it is determined that the initiator does not belong to the specific visitor, the access request is directly processed, so that the request accesses the general production data, obtains a second access result, and returns the second access result to the initiator.
In this embodiment, the specific first data may be test data for testing, and the test data is only accessible by a tester or a specific person, so that, after receiving the access request, the embodiment determines, according to the access request, user identification information of an initiator initiating the access request, and if it is determined that the initiator is a specific visitor (e.g., a tester) according to the user identification information, performs enhancement processing on the access request so that the access request accesses the specific first data in the database. In contrast, the second data is general production data, which is data that is accessed by general users (i.e., non-test persons or specific persons). And under the condition that the initiator is determined not to be a specific visitor according to the user identification information, enabling the access request to access the second data to obtain a second access result.
The test method of the embodiment of the invention determines the user identification information of an initiator initiating the access request by receiving the access request and analyzing the access request; determining whether the initiator belongs to a specific visitor or not according to the user identification information; if so, performing enhancement processing on the access request to enable the initiator to access specific first data; after the access request is subjected to enhancement processing, responding to the access request, and enabling the access request to access the specific first data to obtain a specific first access result; if not, the access request is directly responded, the access request is made to access the second data, the technical means of the second access result is obtained, under the condition that the user does not sense, the specific user is made to access the specific data, the normal user or the user without the user state is not influenced, and even if the tester accesses the test data, the common user accesses the common data. The embodiment of the invention distinguishes the common user and the specific user through the user identification information, and distinguishes the common data and the test data through the environment identification field, thereby being simple and convenient and easy to realize.
Fig. 2 is a schematic diagram of a main flow of a testing method according to another embodiment of the present invention, as shown in fig. 2, the method includes:
step S201: and setting an identification set. The user identification information in the identification set may be user identification information of a particular user, such as a tester.
Step 202: adding an environment identification field in a data table, and setting the value of the environment identification field of each data in the data table so as to determine the attribute of the data through the value of the environment identification field. Wherein the attributes of the data include test attributes and common attributes. When the attribute of the data is the test attribute, the data is indicated to be the test data. When the attribute of the data is a normal attribute, it is described that the data is normal production data. As a specific example, the value of the environment identification field may be 0 or 1. When the value of the environment identification field is 1, the attribute of the piece of data is a test attribute, and the data is test data. When the value of the environment identification field is 0, the attribute of the piece of data is a common attribute, and the piece of data is not test data and is normal production data.
In the embodiment, the test data and the production data are isolated through the environment identification field, so that a specific user can access a specific number under the condition that the user does not sense the environment identification field, and an ordinary user or a user without a user state is not influenced.
Step S203: receiving an access request, and analyzing the access request to determine user identification information of an initiator initiating the access request.
Step S204: determining whether the user identification information exists in a preset identification set.
Step S205: and if the user identification information exists in a preset identification set, determining that the initiator belongs to a specific visitor.
Step S206: and analyzing the access request, and determining an enhancement rule corresponding to the access request. In the present embodiment, different enhancement rules are set for different syntax types, for example, different enhancement rules are set for syntax types such as query, update, filter, table join, and the like. As a specific example, different boosters may be provided for different grammar types, such as query boosters, update boosters, filter boosters, and table join boosters. In this example, when initializing the test device, the corresponding booster may be initially loaded through the SPI mechanism. When the enhancer is initialized through an spi (service Provider interface) mechanism, all implementations under a specific interface are acquired through a ServiceLoader. That is, the SPI mechanism is used to load and then identify the SQL statement type corresponding to the enhancer through the annotation on the implementation.
Step S207: and according to the enhancement rule, enhancing the access request to enable the access request to access the first data with the value of the environment identification field as a first target value to obtain a first access result, and returning the access result to the initiator. In the present embodiment, the first target value may be 1. That is, after the access request is enhanced, the access request is made to access the data with the environment identification field value of 1.
Step S208: and if the user identification information is not in a preset identification set, determining that the initiator does not belong to a specific visitor.
Step S209: and directly processing the access request, enabling the access request to access second data with the value of the environment identification field as a second target value, obtaining a second access result, and returning the second access result to the initiator. In the present embodiment, the second target value may be 0.
The test method of the embodiment of the invention determines whether the initiator is a specific access user or not through the user identification information of the initiator carried in the access request, if so, the access request is responded after being enhanced, so that the access request accesses specific first data to obtain a specific first access result; if not, the access request is directly responded, the access request is made to access the second data, a second access result is obtained, so that a specific user can access the specific data under the condition that the user does not sense, a normal user or a user without a user state is not influenced, and even if a tester accesses the test data, a common user accesses the common data. The embodiment of the invention distinguishes the common user and the specific user through the user identification information, and distinguishes the common data and the test data through the environment identification field, thereby being simple and convenient and easy to realize.
In an alternative embodiment, when adding the environment identification field to the data table, a white list of tables that need to be enhanced may also be set. After determining that the initiator belongs to a specific visitor, it may be determined whether the data table to be accessed in the access request is in the white list of the table that needs to be enhanced, and if the data table to be accessed is in the white list of the table that needs to be enhanced, the access request is enhanced.
In other alternative embodiments, a blacklist of tables that need to be enhanced may also be set when adding the environment identification field to the data table. After determining that the initiator belongs to a particular visitor, it may first be determined whether the data table to be accessed in the access request is in a blacklist of tables that need to be enhanced. And if the data table to be accessed is not in the blacklist of the table needing to be enhanced, enhancing the access request.
Fig. 3 is a schematic diagram of main modules of a testing apparatus 300 according to an embodiment of the present invention, as shown in fig. 3, the testing apparatus includes:
a request parsing module 301, configured to receive an access request and parse the access request to determine user identification information of an initiator that initiates the access request;
a determining module 302, configured to determine whether the initiator belongs to a specific visitor according to the user identification information;
a response module 303, configured to perform enhancement processing on the access request to enable the initiator to access specific first data when the initiator belongs to a specific visitor; after the access request is subjected to enhancement processing, responding to the access request, and enabling the access request to access the specific first data to obtain a specific first access result; and under the condition that the initiator does not belong to a specific visitor, directly responding to the access request, and enabling the access request to access second data to obtain a second access result.
Optionally, the apparatus further includes a setting module, configured to add an environment identification field in the data table, and set a value of the environment identification field of each data in the data table, so as to determine the attribute of the data according to the value of the environment identification field.
Optionally, the determining module is further configured to: determining whether the user identification information exists in a preset identification set; and if so, determining that the initiator belongs to a specific visitor.
Optionally, the response module is further configured to: under the condition that the initiator belongs to a specific visitor, analyzing the access request and determining an enhancement rule corresponding to the access request; according to the enhancement rule, enhancing the access request to enable the value of the access request access environment identification field to be first data of a first target value; and under the condition that the initiator does not belong to a specific visitor, directly responding to the access request, and enabling the access request to access second data with the value of the environment identification field as a second target value.
The testing device of the embodiment of the invention determines whether the initiator is a specific access user or not through the user identification information of the initiator carried in the access request, if so, the testing device responds to the access request after performing enhancement processing on the access request so that the access request accesses specific first data to obtain a specific first access result; if not, the access request is directly responded, the access request is made to access the second data, a second access result is obtained, so that a specific user can access the specific data under the condition that the user does not sense, a normal user or a user without a user state is not influenced, and even if a tester accesses the test data, a common user accesses the common data. The embodiment of the invention distinguishes the common user and the specific user through the user identification information, and distinguishes the common data and the test data through the environment identification field, thereby being simple and convenient and easy to realize.
The device can execute the method provided by the embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by the embodiment of the present invention.
Fig. 4 shows an exemplary system architecture 400 to which the test method or test apparatus of an embodiment of the invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have various communication client applications installed thereon, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like.
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server that provides various services, such as a background management server that supports shopping websites browsed by users using the terminal devices 401, 402, and 403. The background management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (e.g., target push information and product information) to the terminal device.
It should be noted that the testing method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the testing apparatus is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer 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 computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a sending module, an obtaining module, a determining module, and a first processing module. The names of these modules do not in some cases constitute a limitation on the unit itself, and for example, the sending module may also be described as a "module that sends a picture acquisition request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
receiving an access request, and analyzing the access request to determine user identification information of an initiator initiating the access request;
determining whether the initiator belongs to a specific visitor or not according to the user identification information;
if so, performing enhancement processing on the access request to enable the initiator to access specific first data; after the access request is subjected to enhancement processing, responding to the access request, and enabling the access request to access the specific first data to obtain a specific first access result;
if not, directly responding to the access request to enable the access request to access the second data and obtain a second access result.
According to the technical scheme of the embodiment of the invention, whether the initiator is a specific access user is determined through the user identification information of the initiator carried in the access request, if so, the access request is responded after being enhanced, so that the access request accesses specific first data to obtain a specific first access result; if not, the access request is directly responded, the access request is made to access the second data, a second access result is obtained, a specific user is made to access the specific data, a normal user or a user without a user state is not affected, and even if a tester accesses the test data, a common user accesses the common data. The embodiment of the invention distinguishes the common user and the specific user through the user identification information, and distinguishes the common data and the test data through the environment identification field, thereby being simple and convenient and easy to realize.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of testing, comprising:
receiving an access request, and analyzing the access request to determine user identification information of an initiator initiating the access request;
determining whether the initiator belongs to a specific visitor or not according to the user identification information;
if so, performing enhancement processing on the access request to enable the initiator to access specific first data; after the access request is subjected to enhancement processing, responding to the access request, and enabling the access request to access the specific first data to obtain a specific first access result;
if not, directly responding to the access request to enable the access request to access the second data and obtain a second access result.
2. The method of claim 1, wherein prior to receiving the access request, the method further comprises:
adding an environment identification field in a data table, and setting the value of the environment identification field of each data in the data table so as to determine the attribute of the data through the value of the environment identification field.
3. The method of claim 1 or 2, wherein determining whether the initiator belongs to a particular visitor based on the user identification information comprises:
determining whether the user identification information exists in a preset identification set;
and if so, determining that the initiator belongs to a specific visitor.
4. The method of claim 2, wherein enhancing the access request to cause the initiator to access specific first data comprises:
analyzing the access request, and determining an enhancement rule corresponding to the access request;
according to the enhancement rule, enhancing the access request to enable the value of the access request access environment identification field to be first data of a first target value;
directly responding to the access request, causing the access request to access second data comprises: and directly responding to the access request, and enabling the access request to access second data with the value of the environment identification field as a second target value.
5. A test apparatus, comprising:
the request analysis module is used for receiving an access request and analyzing the access request so as to determine user identification information of an initiator initiating the access request;
the judging module is used for determining whether the initiator belongs to a specific visitor or not according to the user identification information;
the response module is used for performing enhancement processing on the access request under the condition that the initiator belongs to a specific visitor so as to enable the initiator to access specific first data; after the access request is subjected to enhancement processing, responding to the access request, and enabling the access request to access the specific first data to obtain a specific first access result; and under the condition that the initiator does not belong to a specific visitor, directly responding to the access request, and enabling the access request to access second data to obtain a second access result.
6. The apparatus of claim 5, further comprising a setting module configured to add an environment identification field to the data table and set a value of the environment identification field of each data in the data table, so as to determine the attribute of the data according to the value of the environment identification field.
7. The apparatus of claim 5 or 6, wherein the determining module is further configured to:
determining whether the user identification information exists in a preset identification set;
and if so, determining that the initiator belongs to a specific visitor.
8. The apparatus of claim 6, wherein the response module is further configured to:
under the condition that the initiator belongs to a specific visitor, analyzing the access request and determining an enhancement rule corresponding to the access request; according to the enhancement rule, enhancing the access request to enable the value of the access request access environment identification field to be first data of a first target value;
and under the condition that the initiator does not belong to a specific visitor, directly responding to the access request, and enabling the access request to access second data with the value of the environment identification field as a second target value.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN202110639307.6A 2021-06-08 2021-06-08 Test method and device Pending CN113297087A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110639307.6A CN113297087A (en) 2021-06-08 2021-06-08 Test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110639307.6A CN113297087A (en) 2021-06-08 2021-06-08 Test method and device

Publications (1)

Publication Number Publication Date
CN113297087A true CN113297087A (en) 2021-08-24

Family

ID=77327729

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110639307.6A Pending CN113297087A (en) 2021-06-08 2021-06-08 Test method and device

Country Status (1)

Country Link
CN (1) CN113297087A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114356934A (en) * 2022-01-04 2022-04-15 京东科技控股股份有限公司 Pressure measurement method and device for data processing

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080140765A1 (en) * 2006-12-07 2008-06-12 Yahoo! Inc. Efficient and reproducible visitor targeting based on propagation of cookie information
CN111104675A (en) * 2019-11-15 2020-05-05 泰康保险集团股份有限公司 Method and device for detecting system security vulnerability

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080140765A1 (en) * 2006-12-07 2008-06-12 Yahoo! Inc. Efficient and reproducible visitor targeting based on propagation of cookie information
CN111104675A (en) * 2019-11-15 2020-05-05 泰康保险集团股份有限公司 Method and device for detecting system security vulnerability

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHANG XIAOYI等: "Microblog bot-user identification method based on analytic hierarchy process and support vector machine", 《COMPUTER ENGINEERING》, 30 April 2017 (2017-04-30) *
唐建;徐罡;许舒人;: "一种数据级安全访问控制方案", 计算机系统应用, no. 09, 15 September 2013 (2013-09-15) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114356934A (en) * 2022-01-04 2022-04-15 京东科技控股股份有限公司 Pressure measurement method and device for data processing

Similar Documents

Publication Publication Date Title
CN109683998B (en) Internationalization realization method, device and system
CN110019263B (en) Information storage method and device
CN112527649A (en) Test case generation method and device
CN110689268B (en) Method and device for extracting indexes
CN115587575A (en) Data table creation method, target data query method, device and equipment
CN112445868A (en) Service message processing method and device
CN116611411A (en) Business system report generation method, device, equipment and storage medium
CN108959294B (en) Method and device for accessing search engine
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN110795135A (en) Method and device for realizing injection-resolution configuration
CN112579428B (en) Interface testing method, device, electronic equipment and storage medium
CN113297087A (en) Test method and device
CN112433713A (en) Application program design graph processing method and device
CN118312076A (en) Map icon processing method and device, electronic equipment and computer readable medium
CN113590447B (en) Buried point processing method and device
CN113760274B (en) Front-end assembly logic injection method and device
CN116382640A (en) Method, device, equipment and storage medium for managing micro-service
CN113362097B (en) User determination method and device
CN111460273B (en) Information pushing method and device
CN114625458A (en) Page data processing method and device, electronic equipment and storage medium
CN113468342A (en) Data model construction method, device, equipment and medium based on knowledge graph
CN107885774B (en) Data processing method and system
CN113535163B (en) Method and device for generating message
CN116301869B (en) Front-end page configuration management and control system, method, equipment and medium
CN112905427B (en) Data processing method and device

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