CN115098398A - Test case processing method, device, equipment and medium - Google Patents

Test case processing method, device, equipment and medium Download PDF

Info

Publication number
CN115098398A
CN115098398A CN202210844751.6A CN202210844751A CN115098398A CN 115098398 A CN115098398 A CN 115098398A CN 202210844751 A CN202210844751 A CN 202210844751A CN 115098398 A CN115098398 A CN 115098398A
Authority
CN
China
Prior art keywords
case
test case
test
target
initial
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
CN202210844751.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.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech 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 CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202210844751.6A priority Critical patent/CN115098398A/en
Publication of CN115098398A publication Critical patent/CN115098398A/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/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3676Test management for coverage analysis
    • 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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/906Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/907Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Library & Information Science (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The disclosure provides a test case processing method which can be applied to the technical field of computers and the technical field of cloud computing. The test case processing method comprises the following steps: inquiring an initial test case with a preset case label according to the preset case label to obtain an initial test case set; dividing the initial test cases with the same case labels into the same initial test case subset according to the respective case labels of the initial test cases; extracting a target test case from the initial test case sample set according to a preset extraction rule to obtain a target test case set; and executing the target test cases in the target test case set to obtain a target test result. The present disclosure also provides a test case processing apparatus, device, medium, and program product.

Description

Test case processing method, device, equipment and medium
Technical Field
The present disclosure relates to the field of computer technologies and cloud computing technologies, and in particular, to a test case processing method, apparatus, device, medium, and program product.
Background
The automatic test may be a test method that automatically executes a test case by using a test tool, so that the test case can automatically run in a specified environment to obtain a test result. Before the related automatic test, the test case needing to be automatically tested is selected according to the test requirement, so that the selected test case meets the higher test coverage rate, and a proper automatic test tool is correspondingly selected to execute the selected test case, so that the related program or system can be improved according to the test result of the test case.
The inventor finds that the overall efficiency of testing the test case by using the automatic test tool is low, and the calculation cost consumed by the automatic test is large.
Disclosure of Invention
In view of the above, the present disclosure provides a test case processing method, apparatus, device, medium, and program product.
According to a first aspect of the present disclosure, there is provided a test case processing method, including:
inquiring an initial test case with the preset case label according to the preset case label to obtain an initial test case set, wherein the number of the initial test cases in the initial test case set is N;
dividing the initial test cases with the same case labels into the same initial test case subset according to the respective case labels of the initial test cases;
extracting target test cases from the initial test case example set according to a preset extraction rule to obtain a target test case set, wherein the target test cases in the target test case set comprise M, and N is more than M and is not less than 1; and
and executing the target test cases in the target test case set to obtain a target test result.
According to an embodiment of the present disclosure, the initial test case subset includes a plurality of test cases;
according to a preset extraction rule, extracting a target test case from the initial test case sample set to obtain a target test case set, wherein the target test case set comprises:
respectively determining a target test case from each initial test case example set according to the respective case updating time of the initial test cases, wherein the case updating time of the target test case is later than the case updating time of other initial test cases except the target test case in the initial test case set corresponding to the target test case; and
and respectively extracting a plurality of target test cases in the initial test case example sets and each initial test case example set to obtain the target test case set.
According to an embodiment of the present disclosure, the initial test case subset includes a plurality of test cases;
according to a preset extraction rule, extracting a target test case from the initial test case sample set to obtain a target test case set, wherein the target test case set comprises:
respectively determining a target test case from each initial test case example set according to a preset random rule; and
and respectively extracting a plurality of target test cases in the initial test case sample set and each initial test case sample set to obtain the target test case set.
According to the embodiment of the disclosure, according to a preset random rule, respectively determining a target test case from each of the initial test case example sets comprises:
under the condition that a plurality of initial test cases in the initial test case example set are included, randomly selecting one initial test case from the initial test case example set as the target test case according to the preset random rule; and
in a case that there is one initial test case in the initial test case example set, the initial test case in the initial test case example set is determined as the target test case.
According to an embodiment of the present disclosure, further comprising:
and setting case labels for the test cases according to the case attribute information of the test cases to obtain the initial test cases.
According to the embodiment of the disclosure, setting a case label for the test case according to the case attribute information of the test case, and obtaining the initial test case comprises:
inquiring a target interface corresponding to the test case according to the case attribute information of the test case, wherein the target interface is a test interface of an automatic test tool capable of executing the test case; and
and setting a case label with the same name as the target interface name of the target test interface for the test case to obtain the initial test case.
According to the embodiment of the disclosure, the case attribute information includes case service attribute information and case test function attribute information;
the case service attribute information includes at least one of: service category attribute information, service behavior attribute information and service associated user attribute information;
the case test function attribute information includes at least one of: vulnerability test attribute information, permeability test attribute information and boundary value test attribute information.
According to an embodiment of the present disclosure, executing the target test case in the target test case set, and obtaining the target test result includes:
and executing the target test case in the target test case set by using an automatic test tool to obtain the target test result.
A second aspect of the present disclosure provides a test case processing apparatus including:
the system comprises a query module, a test module and a test module, wherein the query module is used for querying an initial test case with a preset case label according to the preset case label to obtain an initial test case set, and the initial test cases in the initial test case set comprise N initial test cases;
the dividing module is used for dividing the initial test cases with the same case labels into the same initial test case subset according to the respective case labels of the initial test cases;
the extraction module is used for extracting target test cases from the initial test case set according to a preset extraction rule to obtain a target test case set, wherein the target test cases in the target test case set comprise M, and N is more than M and is not less than 1; and
and the execution module is used for executing the target test cases in the target test case set to obtain a target test result.
A third aspect of the present disclosure provides an electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method for test case processing.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method of test case processing described above.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the method of test case processing described above.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an application scenario diagram of a test case processing method according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a test case processing method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flowchart of extracting a target test case from an initial test case sample set according to a preset extraction rule to obtain a target test case set according to an embodiment of the present disclosure;
FIG. 4 is a flow chart schematically illustrating a process of extracting target test cases from an initial test case sample set according to a preset extraction rule to obtain a target test case set according to another embodiment of the present disclosure;
fig. 5 schematically illustrates an application scenario diagram of a test case processing method according to an embodiment of the present disclosure;
FIG. 6 schematically shows a block diagram of a test case processing apparatus according to an embodiment of the disclosure;
fig. 7 schematically shows a block diagram of an electronic device suitable for implementing a test case processing method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs, unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure, application and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations, necessary confidentiality measures are taken, and the customs of the public order is not violated.
In the technical scheme of the disclosure, before the personal information of the user is acquired or collected, the authorization or the consent of the user is acquired.
The embodiment of the disclosure provides a test case processing method, which includes: according to the preset case labels, inquiring the initial test cases with the preset case labels to obtain an initial test case set, wherein the number of the initial test cases in the initial test case set is N; dividing the initial test cases with the same case labels into the same initial test case subset according to the respective case labels of the initial test cases; extracting target test cases from the initial test case set according to a preset extraction rule to obtain a target test case set, wherein the target test cases in the target test case set comprise M, and N is more than M and is not less than 1; and executing the target test cases in the target test case set to obtain a target test result.
According to the embodiment of the disclosure, the initial test case set with the preset case label is obtained by querying according to the preset case label, so that the initial test cases in the initial test case set can meet the coverage rate required by the target test, the initial test cases with the same case label are divided into the same initial test case subset, the target test cases are extracted from the initial test case set, the target test cases can represent the initial test cases in the initial test case set to which the target test cases belong, and the number of the target test cases is smaller than the total number of the initial test cases under the condition of meeting the test coverage rate, so that the target test results obtained after the target test cases in the target test case set are executed can reduce the time consumed by the test under the condition of ensuring the test requirement, meanwhile, the operation steps of manually selecting the test cases are reduced, and the test execution efficiency of executing the test cases is integrally improved.
Fig. 1 schematically shows an application scenario diagram of a test case processing method according to an embodiment of the present disclosure.
As shown in fig. 1, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 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 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the test case processing method provided by the embodiments of the present disclosure may be generally executed by the server 105. Accordingly, the test case processing apparatus provided by the embodiments of the present disclosure may be generally disposed in the server 105. The test case processing method provided by the embodiments of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the test case processing apparatus provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The test case processing method of the disclosed embodiment will be described in detail below with fig. 2 to 5 based on the scenario described in fig. 1.
Fig. 2 schematically shows a flow chart of a test case processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the test case processing method of this embodiment may include operations S210 to S240.
In operation S210, according to the preset case labels, the initial test cases having the preset case labels are queried to obtain an initial test case set, where the initial test cases in the initial test case set may include N initial test cases.
According to an embodiment of the present disclosure, the preset case label may be used to characterize attributes of the test case, such as a test function attribute, a service attribute, and the like. The preset case labels may be determined according to actual test requirements of the target test case, for example, the preset case labels representing corresponding attributes may be determined according to business test requirements, functional test requirements, and the like, so that an initial test case set capable of meeting the test requirements may be queried according to the preset case labels.
According to the embodiment of the disclosure, the preset case labels can be manually set manually or can be set on the test cases in other ways.
It should be noted that the number of preset case labels may be one or multiple, and the embodiment of the present disclosure does not limit the number of preset case labels.
In operation S220, the initial test cases having the same case label are divided into the same initial test case subset according to the respective case labels of the initial test cases.
According to embodiments of the present disclosure, the initial test cases may respectively satisfy test requirements of one or more types of tests, and thus the initial test cases may have one or more case labels. The initial test cases with the same case labels are determined to be the same initial test case subset, and the initial test cases can be effectively classified according to the respective attributes of the initial test cases.
In operation S230, according to a preset extraction rule, target test cases are extracted from the initial test case set to obtain a target test case set, where the target test cases in the target test case set may include M, and N > M ≧ 1.
According to the embodiment of the disclosure, the preset extraction rule may be set according to actual test requirements, for example, an initial test case with a later creation time may be selected as a target test case, and the number of extracted target test cases may be set according to reliability required by a test result.
It should be noted that, the number of the target test cases extracted from each initial test case set may be one, or may also be multiple, and the embodiment of the present disclosure does not limit the number of the target test cases extracted from each initial test case set, and a person skilled in the art may design according to actual requirements as long as the number of the extracted target test cases is smaller than the number of the initial test cases in the initial test case set.
In operation S240, the target test case in the target test case set is executed to obtain a target test result.
According to the embodiment of the disclosure, the target test cases can be sent to the corresponding test interface or test suite to execute the target test cases, and a target test result corresponding to each target test case is obtained.
According to the embodiment of the disclosure, the initial test case set with the preset case label is obtained by querying according to the preset case label, so that the initial test cases in the initial test case set can meet the coverage rate required by the target test, the initial test cases with the same case label are divided into the same initial test case subset, the target test cases are extracted from the initial test case set, the target test cases can represent the initial test cases in the initial test case set to which the target test cases belong, and the number of the target test cases is smaller than the total number of the initial test cases under the condition of meeting the test coverage rate, so that the target test results obtained after the target test cases in the target test case set are executed can reduce the time consumed by the test under the condition of ensuring the test requirement, meanwhile, the operation steps of manually selecting the test cases are reduced, and the test execution efficiency of executing the test cases is integrally improved.
According to an embodiment of the present disclosure, the test case processing method may further include the following operations.
And setting case labels for the test cases according to the case attribute information of the test cases to obtain initial test cases.
According to the embodiment of the disclosure, the case attribute information can represent the attributes of the test case, and the case label in accordance with the case attribute information is set for the test case according to the case attribute information of the test case, so that the attributes of the initial test case can be clearly identified, and the target test case can be conveniently selected subsequently according to the actual test requirements or test strategies of the target test, so as to improve the determination rate of the target test case.
According to the embodiment of the disclosure, the case labels may, for example, add, modify, and delete corresponding test case labels to the test cases according to the case attribute information of the test cases in the process of editing the test cases, and for example, may add case labels such as "basic service", "boundary value test", and the like, thereby obtaining initial test cases with the case labels.
According to an embodiment of the present disclosure, the case attribute information includes case service attribute information and case test function attribute information.
The case service attribute information may include at least one of: service category attribute information, service behavior attribute information and service associated user attribute information.
The case test functionality attribute information may include at least one of: vulnerability test attribute information, permeability test attribute information and boundary value test attribute information.
According to the embodiment of the present disclosure, the service category attribute information may include the service category to which the test case applies, and the service category may include, for example, but is not limited to, deposit service, loan service, mortgage service, and the like, and may include other types of services, which may be selected by those skilled in the art according to the actual situation.
According to the embodiment of the present disclosure, the service behavior attribute information may include attribute information of an operation behavior related to the service, for example, a registration behavior, a logout behavior, a behavior of changing a bound mobile phone number, a real-name authentication behavior, and the like. The service associated user attribute information may include identity information of a user associated with the service, such as age attribute information and the like.
It should be noted that, in the embodiments of the present disclosure, the processes of collecting, storing, using, processing, transmitting, providing, disclosing, and applying the personal information of the user all conform to the regulations of the relevant laws and regulations, and necessary security measures are taken without violating the customs of the public order. Before the personal information of the user is collected, the consent of the user is obtained, and the relevant legal provisions are met.
According to the embodiment of the disclosure, setting case labels for test cases according to case attribute information of the test cases to obtain initial test cases may include the following operations:
inquiring a target interface corresponding to the test case according to the case attribute information of the test case, wherein the target interface is a test interface of an automatic test tool capable of executing the test case; and setting a case label with the same name as the target interface of the target test interface for the test case to obtain an initial test case.
According to the embodiment of the disclosure, in an application scenario for realizing the automatic interface test, a corresponding interface needs to be set for a test case so as to satisfy the requirement of executing the test case in the automatic test. According to the case attribute information of the test case, the interface corresponding to the test case can be found, and because the interface usually sets the interface name by the service attribute name, the interface name of the target interface corresponding to the test case can be used as the test case label, and the case label with the same name as the target interface name of the target test interface is set for the test case, so that the automatic setting of the case label for the test case is realized, and the subsequent test efficiency is further improved.
For example, the case attribute information of the test case may be a "real-name certification" service attribute, and the test case corresponds to a "real-name certification" service interface, so that the "real-name certification" interface of the service interface may be utilized to set a case label "real-name certification" for the test case, thereby obtaining an initial test case with a "real-name certification" case label.
According to embodiments of the present disclosure, the initial test case subset may include a plurality.
Fig. 3 schematically illustrates a flowchart of extracting a target test case from an initial test case sample set according to a preset extraction rule to obtain a target test case set according to an embodiment of the present disclosure.
As shown in fig. 3, the extracting 230 of the target test case from the initial test case set according to the preset extraction rule to obtain the target test case set may include operations S310 to S320.
In operation S310, a target test case is determined from each of the initial test case sample sets according to respective case update times of the initial test cases, where the case update time of the target test case is later than the case update times of other initial test cases except the target test case in the initial test case sample set corresponding to the target test case.
In operation S320, a plurality of initial test case sets are respectively extracted, and a target test case in each of the initial test case sets is obtained.
According to an embodiment of the present disclosure, the case update time may represent the last edit time, modification time, etc. of the initial test case. The case updating time of the target test case is later than the case updating time of other initial test cases in the initial test case subset corresponding to the target test case, so that the target test case can be determined to be updated in the initial test case sample set for the latest time, namely, the target test case can represent the timeliness of the current test stage for the test requirement.
The target test cases in each initial test case example set are extracted to obtain a target test case set, so that the coverage rate requirement of the target test can be met, the timeliness test requirement for the target test can be met, and the reliability of the target test result is comprehensively improved.
And simultaneously, the case attribute information of the initial test case subset is represented by the target test cases in the initial test case set, so that the number of the target test cases in the target test case set can be reduced, and the execution efficiency of the target test is further improved.
According to embodiments of the present disclosure, the initial test case subset may include a plurality.
Fig. 4 schematically shows a flowchart of extracting a target test case from an initial test case sample set according to a preset extraction rule to obtain a target test case set according to another embodiment of the present disclosure.
As shown in fig. 4, the operation 230 of extracting the target test case from the initial test case set according to the preset extraction rule to obtain the target test case set may include operations S410 to S420.
In operation S410, a target test case is determined from each of the initial test case examples respectively according to a preset random rule.
In operation S420, a plurality of initial test case sets are respectively extracted, and a target test case in each of the initial test case sets is obtained.
According to embodiments of the present disclosure, the target test cases may be randomly determined from each initial test case example set, for example, a fixed number of target test cases may be randomly determined from the initial test case example set, or an unfixed number of target test cases may also be randomly determined from the initial test case subset. Only the number of the target test cases in the obtained target test case set is required to be less than the number of the initial test cases in the initial test case set.
According to the embodiment of the disclosure, the target test case is determined from each initial test case according to the preset random rule, and the attributes of the initial test cases such as timeliness and test case quality in the initial test case example set can be comprehensively considered, so that the efficiency and reliability of target test execution are guaranteed under the condition that the coverage rate required by the target test is met, and the technical problem of poor reliability of the test result of the target test caused by selecting the target test case with a single attribute or a fixed attribute is avoided.
According to an embodiment of the present disclosure, the operation S410 of determining the target test case from each initial test case example set according to the preset random rule may include the following operations.
Under the condition that a plurality of initial test cases in the initial test case example set are included, randomly selecting one initial test case from the initial test case example set as a target test case according to a preset random rule; and determining the initial test cases in the initial test case example set as target test cases in the case that one initial test case is included in the initial test case example set.
According to the embodiment of the disclosure, one initial test case in the initial test case set is randomly selected as a target test case, the selected target test case represents the initial test case set to which the target test case belongs, and case attribute information of all the initial test cases, so that the number of test cases for executing the test is reduced to the maximum extent while the test coverage of the target test is guaranteed, that is, the minimum-scale test case coverage set is realized by determining the target test case set, so that the execution efficiency and the test coverage of the target test are unified, and the test efficiency and the test reliability of the target test are integrally improved.
According to an embodiment of the present disclosure, executing the target test case in the target test case set to obtain the target test result may include the following operations.
And executing the target test cases in the target test case set by using an automatic test tool to obtain a target test result.
According to an embodiment of the present disclosure, the automated test tool may include a test tool used in the related art to perform automated tests, such as Selenium, Postman, and the like. The target test case set obtained by automatic selection is executed by using an automatic test tool, so that the test efficiency of automatic test can be further improved, the technical problems that the test coverage rate of the automatic test in the related technology is low and the test requirement is difficult to meet are at least partially solved, and the technical effect that the test effect and the test coverage rate of the automatic test are unified is realized.
Fig. 5 schematically shows an application scenario of the test case processing method according to an embodiment of the present disclosure.
As shown in fig. 5, after the start operation S510 is performed, an operation S520 may be performed to select an initial test case to obtain an initial test case set.
According to the test strategy or the test requirement of the automatic test, the adaptive preset case label can be selected, and the initial test case with the preset case label can be inquired by using the preset case label.
In this embodiment, the number of the preset case labels may be multiple, and the logical relationship between the preset case labels may be an OR, so that each of the preset case labels may be used to determine the initial test case having the preset case label, and after all the initial test cases having the preset case label are combined, the repeated initial test cases are removed, so as to obtain the initial test case set.
For example, for the test requirement of new user registration, the preset case labels may be selected as "account opening", "eighteen years old", "id card registered", and the like, and an OR is selected among the preset case labels as a logical relationship among the preset case labels. Correspondingly, according to the test function requirement, the preset case labels for representing the function attributes such as 'authority verification' and 'balance inquiry' can be selected.
It should be understood that the selection of the preset case label may be determined according to actual test requirements, for example, the preset case label may also be determined according to actual test requirements such as a test method, business attributes, and the like, and the embodiment of the present disclosure does not limit the specific type of the preset case label.
After the preset case labels are determined, an initial test case with at least one preset case label can be queried according to the preset case labels to obtain an initial test case set.
In operation S530, an initial test case subset is determined. The initial test cases with the same test case labels can be divided into the same initial test case subset according to the respective test case labels of each initial test case in the initial test case set, so that a plurality of initial test case subsets can be determined.
For example, in the case where the preset case label is "label a" OR "label B" OR "label C", initial test case S1 has "label a", "label B" and "label C", initial test case S2 has "label a", "label B" and "label E", initial test case S3 has "label a" and "label B", initial test case S4 has "label a" and "label D", and initial test case S5 has "label a" and "label E".
It may be determined that initial test case subset J1 ═ S1, initial test case subset J2 ═ S2, S3, and initial test case subset J3 ═ S4, S5, and accordingly, initial test case subset J1 has case labels of: "label a", "label B", "label C", the initial test case subset J2 having case labels of: "label a", "label B", the initial test case subset J3 has case labels of: "tag A".
In operation S540, it is determined whether the number of initial test cases in the initial test case set is greater than 1.
In case that the judgment result is yes, operation S550 may be performed to randomly select an initial test case as the target test case. That is, an initial test case is randomly determined from the initial test case sample set as a target test case.
For example, for the initial test case subset J2 { S2, S3}, the initial test case S2 may be randomly chosen as the target test case.
In case that the determination result is no, operation S560 may be performed to determine the initial test case as the target test case, that is, in case that the initial test case subset includes only one initial test case, the initial test case may be determined as the target test case.
For example, for the initial test case subset J1 { S1}, the initial test case S1 may be determined as the target test case.
By determining the target test case, the target test case can be determined as a target test case set based on the determined target test case, so that the minimum-scale test case set can be obtained under the condition of meeting the test coverage rate.
For example, the target test cases S1, S2, and S4 may be determined such that the number of target test cases is significantly less than the number of initial test cases in the initial set of test cases, while still meeting the test coverage required for the test, resulting in a minimum set of test cases { S1, S2, S4 }.
Then, operation S570 is performed to execute the target test case. The target test cases in the target test case set can be executed by using an automatic test tool, so that the target test result can be quickly obtained. Operation S580 may then be performed, ending the operation.
In the embodiment of the disclosure, after the target test result is obtained, the test result of each target test case can be recorded, and a corresponding test report is generated. And then the test report is sent to related operation and maintenance personnel according to the set sending condition so that the operation and maintenance personnel can carry out subsequent operation and maintenance work according to the test report.
According to the test case processing method provided by the embodiment of the disclosure, the test cases can be automatically managed, so that the automatic test work can be efficiently completed, and the overall test efficiency of the automatic test is improved.
Based on the test case processing method, the disclosure also provides a test case processing device. The apparatus will be described in detail below with reference to fig. 6.
Fig. 6 schematically shows a block diagram of a test case processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 6, the test case processing apparatus 600 of this embodiment includes a query module 610, a dividing module 620, an extracting module 630, and an executing module 640.
The query module 610 is configured to query the initial test cases with the preset case labels according to the preset case labels to obtain an initial test case set, where the initial test cases in the initial test case set include N initial test cases.
The dividing module 620 is configured to divide the initial test cases with the same case label into the same initial test case subset according to the respective case labels of the initial test cases.
The extracting module 630 is configured to extract target test cases from the initial test case set according to a preset extracting rule to obtain a target test case set, where the target test cases in the target test case set include M target test cases, and N > M ≧ 1.
The executing module 640 is configured to execute the target test case in the target test case set to obtain a target test result.
According to embodiments of the present disclosure, the initial test case subset may include a plurality.
The extraction module may include: a first determination submodule and a first extraction submodule.
The first determining submodule is used for determining the target test case from each initial test case example set according to the respective case updating time of the initial test cases, wherein the case updating time of the target test case is later than the case updating time of other initial test cases except the target test case in the initial test case example set corresponding to the target test case.
The first extraction submodule is used for respectively extracting a plurality of initial test case sample sets, and target test cases in each initial test case sample set are obtained to obtain a target test case set.
According to embodiments of the present disclosure, the initial test case subset may include a plurality.
The extraction module may further include: a second determination submodule and a second extraction submodule.
And the second determining submodule is used for respectively determining the target test case from each initial test case example set according to a preset random rule.
The second extraction submodule is used for respectively extracting a plurality of initial test case sample sets, and target test cases in each initial test case sample set are obtained to obtain a target test case set.
According to an embodiment of the present disclosure, the second determination submodule may include: a first selection unit and a third determination unit.
The first selection unit is used for randomly selecting one initial test case from the initial test case example set as a target test case according to a preset random rule under the condition that the initial test cases in the initial test case example set comprise a plurality of initial test cases.
The third determining unit determines the initial test cases in the initial test case example set as the target test cases in a case where there is one initial test case in the initial test case example set.
According to an embodiment of the present disclosure, the test case processing apparatus may further include: a first setup submodule.
The first setting submodule is used for setting case labels for the test cases according to the case attribute information of the test cases to obtain initial test cases.
According to an embodiment of the present disclosure, the first setting sub-module may include: the device comprises a first query unit and a second setting unit.
The first query unit is used for querying a target interface corresponding to the test case according to the case attribute information of the test case, wherein the target interface is a test interface of an automatic test tool capable of executing the test case.
The second setting unit is used for setting a case label which is the same as the target interface name of the target test interface for the test case to obtain an initial test case.
According to an embodiment of the present disclosure, the case attribute information includes case service attribute information and case test function attribute information.
The case service attribute information includes at least one of: service category attribute information, service behavior attribute information and service associated user attribute information.
The case test functionality attribute information includes at least one of: vulnerability test attribute information, permeability test attribute information and boundary value test attribute information.
According to an embodiment of the present disclosure, the execution module may include an execution submodule.
The execution submodule is used for executing the target test cases in the target test case set by using the automatic test tool to obtain a target test result.
According to an embodiment of the present disclosure, any plurality of the query module 610, the dividing module 620, the extracting module 630 and the executing module 640 may be combined into one module to be implemented, or any one of the modules may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the querying module 610, the dividing module 620, the extracting module 630 and the executing module 640 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware and firmware, or in a suitable combination of any several of them. Alternatively, at least one of the query module 610, the dividing module 620, the extracting module 630 and the executing module 640 may be at least partially implemented as a computer program module, which when executed, may perform a corresponding function.
Fig. 7 schematically shows a block diagram of an electronic device suitable for implementing a test case processing method according to an embodiment of the disclosure.
As shown in fig. 7, an electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. The processor 701 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 701 may also include on-board memory for caching purposes. The processor 701 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. The processor 701 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 702 and/or the RAM 703. It is noted that the programs may also be stored in one or more memories other than the ROM 702 and RAM 703. The processor 701 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 700 may also include input/output (I/O) interface 705, which input/output (I/O) interface 705 is also connected to bus 704, according to an embodiment of the present disclosure. The electronic device 700 may also include one or more of the following components connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be embodied in the device/apparatus/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: 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), 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 disclosure, 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. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the above-described ROM 702 and/or RAM 703 and/or one or more memories other than the ROM 702 and RAM 703.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated in the flow chart. The program code is for causing a computer system to implement the test case processing methods provided by the embodiments of the present disclosure when the computer program product is run on the computer system.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 701. The above described systems, devices, modules, units, etc. may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted in the form of a signal on a network medium, distributed, downloaded and installed via the communication section 709, and/or installed from the removable medium 711. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by the processor 701, performs the above-described functions defined in the system of the embodiment of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, 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).
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 disclosure. 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.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the disclosure, and these alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (12)

1. A test case processing method, comprising:
according to a preset case label, inquiring an initial test case with the preset case label to obtain an initial test case set, wherein the number of the initial test cases in the initial test case set is N;
dividing the initial test cases with the same case labels into the same initial test case subset according to the respective case labels of the initial test cases;
extracting target test cases from the initial test case set according to a preset extraction rule to obtain a target test case set, wherein the target test cases in the target test case set comprise M, and N is more than M and is not less than 1; and
and executing the target test cases in the target test case set to obtain a target test result.
2. The test case processing method of claim 1, wherein the initial test case subset comprises a plurality;
according to a preset extraction rule, extracting a target test case from the initial test case set to obtain a target test case set, wherein the target test case set comprises:
respectively determining a target test case from each initial test case example set according to the respective case updating time of the initial test cases, wherein the case updating time of the target test case is later than the case updating time of other initial test cases except the target test case in the initial test case example set corresponding to the target test case; and
and respectively extracting a plurality of initial test case example sets, and target test cases in each initial test case example set to obtain the target test case set.
3. The test case processing method of claim 1, wherein the initial test case subset comprises a plurality;
extracting a target test case from the initial test case example set according to a preset extraction rule to obtain a target test case set, wherein the target test case set comprises:
respectively determining a target test case from each initial test case example set according to a preset random rule; and
and respectively extracting a plurality of initial test case example sets, and target test cases in each initial test case example set to obtain the target test case set.
4. The test case processing method of claim 3, wherein determining the target test case from each of the initial test case examples set according to a preset random rule comprises:
under the condition that a plurality of initial test cases in the initial test case example set exist, randomly selecting one initial test case from the initial test case example set as the target test case according to the preset random rule; and
and determining the initial test cases in the initial test case example set as the target test cases when one initial test case is included in the initial test case example set.
5. The test case processing method of claim 1, further comprising:
and setting a case label for the test case according to the case attribute information of the test case to obtain the initial test case.
6. The test case processing method of claim 5, wherein setting case labels for the test cases according to case attribute information of the test cases to obtain the initial test cases comprises:
inquiring a target interface corresponding to the test case according to the case attribute information of the test case, wherein the target interface is a test interface of an automatic test tool capable of executing the test case; and
and setting a case label with the same name as the target interface of the target test interface for the test case to obtain the initial test case.
7. The test case processing method of claim 5, the case attribute information comprising case service attribute information and case test function attribute information;
the case service attribute information includes at least one of: service category attribute information, service behavior attribute information and service associated user attribute information;
the case test function attribute information includes at least one of: vulnerability test attribute information, permeability test attribute information and boundary value test attribute information.
8. The test case processing method of claim 1, wherein executing the target test cases in the target test case set to obtain the target test results comprises:
and executing the target test cases in the target test case set by using an automatic test tool to obtain the target test result.
9. A test case processing apparatus comprising:
the system comprises a query module, a test module and a test module, wherein the query module is used for querying an initial test case with a preset case label according to the preset case label to obtain an initial test case set, and the initial test cases in the initial test case set comprise N initial test cases;
the dividing module is used for dividing the initial test cases with the same case labels into the same initial test case subset according to the respective case labels of the initial test cases;
the extraction module is used for extracting target test cases from the initial test case set according to a preset extraction rule to obtain a target test case set, wherein the target test cases in the target test case set comprise M, and N is more than M and is not less than 1; and
and the execution module is used for executing the target test cases in the target test case set to obtain a target test result.
10. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-8.
11. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 8.
12. A computer program product comprising a computer program which, when executed by a processor, carries out the method according to any one of claims 1 to 8.
CN202210844751.6A 2022-07-18 2022-07-18 Test case processing method, device, equipment and medium Pending CN115098398A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210844751.6A CN115098398A (en) 2022-07-18 2022-07-18 Test case processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210844751.6A CN115098398A (en) 2022-07-18 2022-07-18 Test case processing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115098398A true CN115098398A (en) 2022-09-23

Family

ID=83298230

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210844751.6A Pending CN115098398A (en) 2022-07-18 2022-07-18 Test case processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115098398A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111708703A (en) * 2020-06-18 2020-09-25 深圳前海微众银行股份有限公司 Test case set generation method, device, equipment and computer readable storage medium
US20210263838A1 (en) * 2020-02-20 2021-08-26 International Business Machines Corporation Assignment of test case priorities based on combinatorial test design model analysis
CN114637689A (en) * 2022-04-11 2022-06-17 中国工商银行股份有限公司 Application evaluation method, device, equipment and storage medium
CN114691527A (en) * 2022-04-28 2022-07-01 中国工商银行股份有限公司 Unit test case generation method, apparatus, device, medium, and program product

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210263838A1 (en) * 2020-02-20 2021-08-26 International Business Machines Corporation Assignment of test case priorities based on combinatorial test design model analysis
CN111708703A (en) * 2020-06-18 2020-09-25 深圳前海微众银行股份有限公司 Test case set generation method, device, equipment and computer readable storage medium
WO2021253904A1 (en) * 2020-06-18 2021-12-23 深圳前海微众银行股份有限公司 Test case set generation method, apparatus and device, and computer readable storage medium
CN114637689A (en) * 2022-04-11 2022-06-17 中国工商银行股份有限公司 Application evaluation method, device, equipment and storage medium
CN114691527A (en) * 2022-04-28 2022-07-01 中国工商银行股份有限公司 Unit test case generation method, apparatus, device, medium, and program product

Similar Documents

Publication Publication Date Title
CN113987074A (en) Distributed service full-link monitoring method and device, electronic equipment and storage medium
US11182500B2 (en) Sensitive data management
CN109542764B (en) Webpage automatic testing method and device, computer equipment and storage medium
CN113595886A (en) Instant messaging message processing method and device, electronic equipment and storage medium
CN115567596B (en) Cloud service resource deployment method, device, equipment and storage medium
CN115904527A (en) Data processing method, device, equipment and medium
CN114490130A (en) Message subscription method and device, electronic equipment and storage medium
CN115098398A (en) Test case processing method, device, equipment and medium
CN114780807A (en) Service detection method, device, computer system and readable storage medium
CN114900807B (en) Method and system for processing short message problem event list
CN114329612A (en) Sensitive data identification method and device, electronic equipment and storage medium
CN114254621A (en) Document auditing method and device, electronic equipment and storage medium
CN114138834A (en) Message processing method, device, equipment, storage medium and program product
CN114218330A (en) ES cluster selection method, ES cluster selection device, ES cluster selection apparatus, ES cluster selection medium, and program product
CN114218198A (en) Service information migration method, device, equipment and medium
CN115237391A (en) Method, device, electronic equipment and medium for generating script
CN116431913A (en) Intelligent recommendation method, device and equipment for vehicle owner service push text and storage medium thereof
CN117176576A (en) Network resource changing method, device, equipment and storage medium
CN115795426A (en) Data processing method, apparatus, device, medium, and program product
CN114861054A (en) Information acquisition method and device, electronic equipment and storage medium
CN114169984A (en) Method, system, apparatus, medium and product for funds release
CN114443620A (en) Service data processing method and device, electronic equipment and storage medium
CN115525365A (en) Method, device and equipment for determining target data entity and storage medium
CN114218254A (en) Report generation method, device, equipment and storage medium
CN118427879A (en) Data processing strategy generation method and device, equipment, storage medium and program product

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