CN111694751A - Automatic testing method and system - Google Patents

Automatic testing method and system Download PDF

Info

Publication number
CN111694751A
CN111694751A CN202010617588.0A CN202010617588A CN111694751A CN 111694751 A CN111694751 A CN 111694751A CN 202010617588 A CN202010617588 A CN 202010617588A CN 111694751 A CN111694751 A CN 111694751A
Authority
CN
China
Prior art keywords
service
layer
test
tested
keyword
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
CN202010617588.0A
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.)
China Travelsky Technology Co Ltd
China Travelsky Holding Co
Original Assignee
China Travelsky Holding Co
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 China Travelsky Holding Co filed Critical China Travelsky Holding Co
Priority to CN202010617588.0A priority Critical patent/CN111694751A/en
Publication of CN111694751A publication Critical patent/CN111694751A/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/3684Test management for test design, e.g. generating new test cases

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)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides an automatic test method and a system, wherein the method comprises the following steps: acquiring a test requirement and test data corresponding to a service to be tested, and determining a tested object system corresponding to the service to be tested; determining a plurality of keywords corresponding to the test requirement in a preset keyword library, and determining test parameters corresponding to each keyword in the test data; constructing a test case by using each keyword and each test parameter; and analyzing the test case and sending an analysis result to the tested object system to enable the tested object system to execute the test case. In the scheme, a keyword library is preset, keywords corresponding to the test requirements are obtained from the keyword library, and test parameters corresponding to the keywords are obtained from test data. The keywords and the test parameters are used for constructing the test cases, the tested object system is called to execute the test cases, the test cases corresponding to different application systems are not required to be designed, the test efficiency is improved, and the test cost is reduced.

Description

Automatic testing method and system
Technical Field
The invention relates to the technical field of data processing, in particular to an automatic testing method and system.
Background
With the development of civil aviation information systems, civil aviation services are gradually transferred from large-scale host systems to open systems, and the same civil aviation service can be realized in different application systems. Before an application is enabled, the application needs to be tested.
The current method for testing the application system is as follows: and designing a set of test cases, and testing the application system through the test cases. However, due to differences between different application systems, different application systems have different ways of implementing the same civil aviation service. That is, the same set of test cases cannot be applied to different application systems, but the test cases corresponding to the same set of test cases are designed for each application system, which requires a lot of time and design cost, and results in low test efficiency and high test cost.
Disclosure of Invention
In view of this, embodiments of the present invention provide an automated testing method and system to solve the problems of low testing efficiency and high testing cost in the current testing method for an application system.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
the first aspect of the embodiment of the invention discloses an automatic test method, which is applied to an automatic test system, wherein the automatic test system comprises a test case layer, a keyword layer, a service description layer, a service realization layer and an interface adaptation layer, and the method comprises the following steps:
the test case layer acquires test requirements and test data corresponding to a service to be tested and determines a tested object system corresponding to the service to be tested;
the keyword layer determines a plurality of keywords corresponding to the test requirement in a preset keyword library and determines a test parameter corresponding to each keyword in the test data, wherein the keyword library is determined according to the automatic test range information, the service attribute set and the flow action set corresponding to the service to be tested;
the service description layer constructs a test case by using each keyword and each test parameter;
the service description layer is combined with a service realization layer to analyze the test case, and the service realization layer sends an analysis result to the tested object system through an interface adaptation layer to enable the tested object system to execute the test case.
Preferably, the process of determining the keyword library by the keyword layer includes:
the keyword layer determines a plurality of service demand points to be tested corresponding to the service to be tested according to the automatic test range information of the service to be tested;
for each service demand point to be detected, the keyword layer determines a service attribute corresponding to the service demand point to be detected from the service attribute set of the service to be detected;
aiming at each service demand point to be detected, the keyword layer determines a keyword corresponding to the service demand point to be detected from the flow action set of the service to be detected by using the service attribute corresponding to the service demand point to be detected;
and the keyword layer adds the keywords corresponding to each service demand point to be tested into a keyword library.
Preferably, the analyzing the test case by the service description layer in combination with the service implementation layer, and the sending the analysis result to the tested object system by the service implementation layer through the interface adaptation layer to make the tested object system execute the test case includes:
the service description layer analyzes the test case to obtain multi-row analysis information corresponding to the test case;
aiming at each line of the analysis information, the service description layer extracts the key words and the test parameters corresponding to the analysis information;
aiming at each line of the analysis information, the service description layer processes the key words and the test parameters corresponding to the analysis information and sends the processing result to a service implementation layer;
and aiming at each line of the analysis information, the service implementation layer sends the processing result corresponding to the analysis information to an interface adaptation layer, so that the interface adaptation layer analyzes the processing result to obtain a code segment and sends the code segment to the tested object system, and the tested object system executes the code segment.
Preferably, before the service description layer parses the test case, the method further includes:
and the service description layer initializes the bottom layer execution sequence file corresponding to the test case.
Preferably, after the causing the object under test system to execute the code segment, the method further includes:
and the service implementation layer receives an execution result fed back by the system to be tested through the interface adaptation layer, wherein the execution result is obtained by the system to be tested executing the code segment corresponding to the analysis information.
A second aspect of the embodiments of the present invention discloses an automated testing system, which includes: the system comprises a test case layer, a keyword layer, a service description layer, a service realization layer and an interface adaptation layer;
the test case layer is used for acquiring test requirements and test data corresponding to a service to be tested and determining a tested object system corresponding to the service to be tested;
the keyword layer is used for determining a plurality of keywords corresponding to the test requirement in a preset keyword library and determining test parameters corresponding to each keyword in the test data, and the keyword library is determined according to the automatic test range information, the service attribute set and the flow action set corresponding to the service to be tested;
the service description layer is used for constructing a test case by utilizing each keyword and each test parameter;
the service description layer is also used for analyzing the test case by combining with the service realization layer;
and the service implementation layer is used for sending the analysis result to the tested object system through the interface adaptation layer so that the tested object system executes the test case.
Preferably, the determining the keyword layer of the keyword library includes:
the first determining unit is used for determining a plurality of service demand points to be tested corresponding to the service to be tested according to the automatic testing range information of the service to be tested;
a second determining unit, configured to determine, for each service demand point to be detected, a service attribute corresponding to the service demand point to be detected from the service attribute set of the service to be detected;
a third determining unit, configured to determine, for each service demand point to be detected, a keyword corresponding to the service demand point to be detected from the flow action set of the service to be detected by using the service attribute corresponding to the service demand point to be detected;
and the adding unit is used for adding the key words corresponding to the service demand points to be tested into a key word library.
Preferably, the service description layer for analyzing the test case in combination with the service implementation layer includes:
the analysis unit is used for analyzing the test case to obtain multi-row analysis information corresponding to the test case;
an extracting unit, configured to extract, for each line of the analysis information, the keyword and the test parameter corresponding to the analysis information;
the processing unit is used for processing the key words and the test parameters corresponding to the analysis information and sending a processing result to a service implementation layer aiming at each line of the analysis information;
accordingly, the number of the first and second electrodes,
and the service implementation layer is used for sending the processing result corresponding to the analysis information to an interface adaptation layer aiming at each line of the analysis information, so that the interface adaptation layer analyzes the processing result to obtain a code segment and sends the code segment to the tested object system, and the tested object system executes the code segment.
Preferably, the service description layer further includes:
and the initialization unit is used for initializing the bottom layer execution sequence file corresponding to the test case.
Preferably, the service implementation layer is further configured to: and receiving an execution result fed back by the system to be tested through the interface adaptation layer, wherein the execution result is a result obtained by the system to be tested executing the code segment corresponding to the analysis information.
Based on the above-mentioned automatic testing method and system provided by the embodiment of the invention, the method is as follows: the test case layer acquires test requirements and test data corresponding to the service to be tested and determines a tested object system corresponding to the service to be tested; the keyword layer determines a plurality of keywords corresponding to the test requirement in a preset keyword library and determines test parameters corresponding to each keyword in the test data; the service description layer constructs a test case by using each keyword and each test parameter; the service description layer is combined with the service realization layer to analyze the test case, and the service realization layer sends an analysis result to the tested object system through the interface adaptation layer, so that the tested object system executes the test case. In the scheme, a keyword library is preset, keywords corresponding to the test requirements are obtained from the keyword library, and test parameters corresponding to the keywords are obtained from test data. The key words and the test parameters are utilized to construct the test cases, the analysis results obtained by analyzing the test cases are sent to the tested object system, so that the tested object system executes the test cases, the test cases corresponding to different application systems are not required to be designed, the test efficiency is improved, and the test cost is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a block diagram of an automated test system according to an embodiment of the present invention;
FIG. 2 is a flow chart of an automated testing method according to an embodiment of the present invention;
FIG. 3 is a flow chart of determining a keyword library according to an embodiment of the present invention;
fig. 4 is a flowchart for calling a system to be tested to execute a test case according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a test case for creating a PNR according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating an eTerm call to create a PNR according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating an IBE being called to create a PNR according to an embodiment of the present invention;
fig. 8 is a block diagram of an automated testing system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
It can be known from the background art that, when an application system is tested at present, due to differences between different application systems, the same set of test cases cannot be applied to different application systems, but a corresponding test case is designed for each application system, which needs to spend a lot of time and design cost, and has low test efficiency and high test cost.
Therefore, an embodiment of the present invention provides an automated testing method and system, which preset a keyword library, obtain a keyword corresponding to a testing requirement from the keyword library, and obtain a testing parameter corresponding to the keyword from testing data. The keywords and the test parameters are utilized to construct the test cases, the tested object system is called to execute the test cases, and the test cases corresponding to different application systems are not required to be designed, so that the test efficiency is improved, and the test cost is reduced.
It should be noted that terms used in the examples of the present invention are explained below for better explanation.
PNR: and the Passenger reservation Record (passport Name Record) is used for reflecting the voyage of the Passenger, the number of occupied seats of the flight and the Passenger information.
IBE: the internet booking service interface mainly has the function of assisting an airline company to realize internet ticket booking and selling.
eTerm: the simulation terminal access system provides functions of accessing business information of eTerm users to users such as airlines and airports.
It can be understood that the automated testing method according to the embodiment of the present invention is applied to an automated testing system, which at least includes a test case layer, a keyword layer, a service description layer, a service implementation layer, and an interface adaptation layer, and in order to better understand the contents of the automated testing method in the following embodiments, the architecture of the automated testing system is illustrated by fig. 1.
Referring to fig. 1, an architecture diagram of an automated testing system provided by an embodiment of the present invention is shown, where the automated testing system includes a test case layer 100, a keyword layer 200, a service description layer 300, a service implementation layer 400, and an interface adaptation layer 500.
The interface adaptation layer 500 is connected to a system call layer 600 including a plurality of systems to be tested (e.g., IBE, eTerm, etc.), so as to implement information interaction between the automatic test system and the systems to be tested.
It should be noted that the test case is composed of a plurality of keywords and test data (including test parameters corresponding to the keywords) related to the test requirement (test intention), the test case is a multi-row two-dimensional table structure, the horizontal direction of the two-dimensional table structure represents the test data related to the test requirement, and the column direction represents the business process corresponding to the test requirement.
In the keyword layer 200, a keyword library is preset, and keywords in the keyword library are set according to preset business rules. The business rules are used for expressing the data structure of the business, and the process change of the business is reflected according to the change of the data structure.
To better explain the specific contents of the data structure and the keyword, the data structure ticket _ info and the keyword related thereto are exemplified, and the specific contents of the data structure ticket _ info and the keyword related thereto are shown in table 1.
Table 1:
Figure BDA0002561919720000071
Figure BDA0002561919720000081
it is understood that the contents in table 1 above are only for illustration, and corresponding keywords, such as "login system" and "logout system", and also such as "login agent" and "logout agent", and also such as "connection database" and "disconnection database", may also be set according to the pre-condition and the post-condition of test case execution.
The service description layer 300 is connected to the keyword layer 200 and the service implementation layer 400, and the service description layer 300 receives the test parameters corresponding to the keywords transmitted by the keyword layer 200.
The service implementation layer 400 is connected to the service description layer 300 and the interface adaptation layer 500, and is used for processing data transmitted by the service description layer 300.
The interface adaptation layer 500 connects the service implementation layer 400 and the system call layer 600, and it can be understood that the system call layer 600 is a tested object system (such as IBE and eTerm) related in the embodiment of the present invention, the interface adaptation layer 500 provides a plurality of call interfaces of the tested object system, the tested object system can be called through the interfaces, and the interface adaptation layer 500 isolates the service implementation layer 400 from the system call layer 600, thereby improving the security of the automatic test system.
Referring to fig. 2, a flowchart of an automated testing method provided in an embodiment of the present invention is shown, where the automated testing method is applicable to an automated testing system, the automated testing system includes a test case layer, a keyword layer, a service description layer, a service implementation layer, and an interface adaptation layer, and the automated testing method includes the following steps:
step S201: and the test case layer acquires the test requirement and the test data corresponding to the service to be tested and determines the system of the tested object corresponding to the service to be tested.
The service to be tested, the test requirement corresponding to the service to be tested, the test data corresponding to the service to be tested and the system to be tested (the system to be tested) are determined in advance. In the process of implementing step S201 specifically, the test case layer obtains the test requirement and the test data, and determines the system of the object to be tested.
Step S202: the keyword layer determines a plurality of keywords corresponding to the test requirement in a preset keyword library, and determines test parameters corresponding to each keyword in the test data.
It should be noted that the test case is constructed based on the keywords related to the test requirements and the test parameters related to the keywords, and a keyword library is pre-established, where the keyword library includes a plurality of keywords.
It can be understood that the keyword library is continuously expanded along with different test requirements, and in order to ensure that the keywords in the keyword library can meet the test requirements corresponding to the service to be tested, the keyword library needs to be expanded according to the test requirements corresponding to the service to be tested.
Specifically, the way of expanding the keyword library according to the test requirement corresponding to the service to be tested is as follows: and determining a keyword library meeting the test requirement corresponding to the service to be tested according to the automatic test range information, the service attribute set and the flow action set corresponding to the service to be tested.
In the process of implementing step S202 specifically, the keyword layer extracts a plurality of keywords corresponding to the test requirement from a keyword library (a keyword library satisfying the test requirement corresponding to the service to be tested) according to the test requirement of the service to be tested, and determines a test parameter corresponding to each keyword (a keyword corresponding to the test requirement) from the test data.
Step S203: and the service description layer constructs a test case by using each keyword and each test parameter.
In the process of implementing step S203 specifically, the service description layer constructs a test case (constructed in the form of a script, also referred to as a test script) by using each keyword (keyword corresponding to the test requirement) and each test parameter (test parameter corresponding to the keyword) determined by the keyword layer.
When defining the data structure of the test parameters, the data structure of the test parameters is defined as a data structure supported by the system to be tested.
Preferably, in combination with the architecture diagram of the automated testing system related in fig. 1 in the embodiment of the present invention, an automated testing framework based on keyword driving is constructed according to a service description layer, a service implementation layer, and an interface adaptation layer, where the automated testing framework at least includes a test driving engine for parsing a test case.
The test driving engine comprises a plurality of components constructed according to a service description layer, a service realization layer and an interface adaptation layer, wherein the plurality of components are respectively as follows: the method comprises the steps of analyzing a top driver (service description layer driver) of a test case according to a top test data sheet (service description layer), analyzing a middle driver (service implementation layer driver) of the test case according to a middle test data sheet (service implementation layer), and analyzing a bottom driver (interface adaptation layer driver) of the test case according to a bottom test data sheet (interface adaptation layer).
It can be understood that, after determining each keyword and each test parameter corresponding to the service to be tested, the top layer test data table, the middle layer test data table, and the bottom layer test data table related to the foregoing are constructed according to the automated test architecture, each keyword, and each test parameter (according to the transfer relationship of the test parameters in the automated test architecture).
The top layer test data table includes the service attribute of the service to be tested (service attribute in the service attribute set) and the corresponding relation between the middle layer test data table.
The middle layer test data table comprises a corresponding relation between the flow actions (flow actions in the flow action set) in the service flow corresponding to the service attribute of the service to be tested and the bottom layer test data table.
The bottom layer test data table comprises a test parameter and a calling relation between the system calling layers, and the test parameter indicates a configurable parameter in a specific action logic of the service to be tested.
Step S204: the service description layer is combined with the service realization layer to analyze the test case, and the service realization layer sends an analysis result to the tested object system through the interface adaptation layer, so that the tested object system executes the test case.
It is understood that the test case is loaded into the pre-constructed keyword-driven-based automated testing framework involved in the above step S203. For each keyword in the test case, the test driving engine of the automatic test framework sequentially calls the top driver, the middle driver and the bottom driver to process the keyword, and the processing result is converted into a calling mode supported by the tested object system to interact with the tested object system, so that the tested object system executes the test case.
In the process of implementing step S204 specifically, the service description layer analyzes the test case in combination with the service implementation layer to obtain a corresponding analysis result. The service implementation layer utilizes the interface adaptation layer to send the analysis result (converted into a calling mode supported by the system to be tested) to the system to be tested, so that the system to be tested executes the test case.
It can be understood that, with reference to the content shown in fig. 1 in the embodiment of the present invention, in the process of constructing a test case and sending the test case to a passive object system for execution, the direction of data transmission sequentially includes a test case layer, a keyword layer, a service description layer, a service implementation layer, an interface adaptation layer, and a system call layer.
It should be noted that after the test case is executed by the system to be tested, the corresponding execution result is fed back, and the data transmission directions of the execution result are in turn: the system comprises a system calling layer, an interface adaptation layer, a service realization layer, a service description layer, a keyword layer and a test case layer.
In the embodiment of the invention, a keyword library is preset, keywords corresponding to the test requirement are obtained from the keyword library, and test parameters corresponding to the keywords are obtained from the test data. The key words and the test parameters are utilized to construct the test cases, the analysis results obtained by analyzing the test cases are sent to the tested object system, so that the tested object system executes the test cases, the test cases corresponding to different application systems are not required to be designed, the test efficiency is improved, and the test cost is reduced.
In the above-described embodiment of the present invention, referring to fig. 3, a process of determining a keyword library meeting a test requirement corresponding to a service to be tested in step S202 in fig. 2 shows a flowchart of determining a keyword library provided in the embodiment of the present invention, which includes the following steps:
step S301: and the keyword layer determines a plurality of service demand points to be tested corresponding to the service to be tested according to the automatic test range information of the service to be tested.
In the process of implementing step S301, the automated testing range information corresponding to the service to be tested is predetermined. And after the automatic test range information is determined, the keyword layer extracts a plurality of service demand points to be tested corresponding to the service to be tested from the automatic test range information.
Step S302: and aiming at each service demand point to be tested, the keyword layer determines the service attribute corresponding to the service demand point to be tested from the service attribute set of the service to be tested.
In the process of implementing step S302 specifically, for each service demand point to be measured, the keyword layer determines a service attribute corresponding to the service demand point to be measured from the service attribute set of the service to be measured, and constructs a data structure corresponding to the service to be measured according to the determined service attribute.
It should be noted that the service attribute is data information abstracted from the service to be tested, and covers the logical description of multiple requirement points in the software requirement, and the service requirement point to be tested includes multiple (1 and more than 1) service attributes.
It should be further noted that the data structure is an expression for describing a business scenario.
Step S303: and aiming at each service demand point to be tested, the keyword layer determines the keyword corresponding to the service demand point to be tested from the flow action set of the service to be tested by utilizing the service attribute corresponding to the service demand point to be tested.
It should be noted that the flow action set includes a keyword corresponding to a flow action (a business flow action), the keyword is a necessary action description for the corresponding flow action, and the definition of the flow action needs to cover all the related testable points and test types corresponding to the business to be tested.
In the process of implementing step S303 specifically, for each service demand point to be tested, the keyword layer extracts keywords related to the service attribute of the service demand point to be tested from the flow action set of the service to be tested.
For example: a passenger may reserve a plurality of flights (service attributes of service demand points to be tested) or may cancel individual flights, the keywords corresponding to the plurality of flights are flights for adding tickets, and the keywords for canceling individual flights are flights for deleting tickets.
Step S304: and the keyword layer adds the keywords corresponding to each service demand point to be tested into a keyword library.
In the process of implementing step S304 specifically, for each service demand point to be tested, the keyword layer optimizes and merges all service attributes and keywords of the service demand point to be tested, and adds the result after optimization and merging to the keyword library.
It can be understood that, according to the contents in the above steps S301 to S304, the keyword corresponding to each service demand point of the service to be tested is added to the keyword library, so that the keyword in the keyword library can cover all the service demand points to be tested in the automatic test range information of the service to be tested.
In the embodiment of the invention, the keywords in the keyword library are expanded according to the automatic test range information, the service attribute set and the flow action set of the service to be tested, so that the keyword library can cover all service demand points to be tested in the automatic test range information of the service to be tested, the keyword library can meet the test process of the service to be tested, and the test stability and accuracy are improved.
In the above-mentioned embodiment of the present invention, referring to fig. 4, a process of processing a test case by using an automated testing framework based on keyword driving in step S204 in fig. 2 shows a flowchart for calling a system to be tested to execute the test case, which includes the following steps:
step S401: and the service description layer analyzes the test case to obtain multi-row analysis information corresponding to the test case.
As can be seen from the content in step S204 in fig. 2 in the embodiment of the present invention, the test case is loaded into the automated testing framework based on the keyword driver, and preferably, before step S401 is executed, the service description layer initializes the bottom layer execution sequence file corresponding to the test case.
It should be noted that, when the automated testing framework based on the keyword driving processes the test cases, the test cases are processed in a line-by-line processing manner, and in the process of specifically implementing step S401, the service description layer parses the test cases to obtain multiple lines of parsing information corresponding to the test cases
Step S402: and aiming at each line of analysis information, the service description layer extracts keywords and test parameters corresponding to the analysis information.
In the process of implementing step S402 specifically, for each line of analysis information, the service description layer extracts the keywords and test parameters corresponding to the line of analysis information.
Step S403: and aiming at each line of analysis information, the service description layer processes the key words and the test parameters corresponding to the analysis information and sends the processing result to the service implementation layer.
In the process of implementing step S403 specifically, for each line of analysis information, the service description layer initializes or updates the data structure (the initialized or updated data structure is a processing result) according to the keyword and the test parameter corresponding to the line of analysis information, and sends the processing result (the initialized or updated data structure) to the service implementation layer.
Specifically, whether to execute the initialization data structure or the update data structure for each line of analysis information is determined according to the keywords and the test parameters corresponding to the line of analysis information.
Such as: as can be seen from the foregoing table 1, the keywords beginning with "start" (for example only) are used to initialize the data structure, and the keywords of "configure", "add", and "delete" (for example only) are used to update the data structure.
Step S404: and aiming at each line of analysis information, the service implementation layer sends a processing result corresponding to the analysis information to the interface adaptation layer, so that the interface adaptation layer analyzes the processing result to obtain a code segment and sends the code segment to the tested object system, and the tested object system executes the code segment.
In the process of implementing step S404 specifically, for each line of analysis information, the service implementation layer extracts a preset field in a processing result corresponding to the analysis information, and sends the preset field to the interface adaptation layer, the interface adaptation layer parses the preset field into a code segment that can be executed by the object system to be tested in a calling manner supported by the object system to be tested (for example, IBE is called by calling an interface, and eTerm is called by an instruction string in a specified format), and the interface adaptation layer sends the code segment to the object system to be tested, so that the object system to be tested executes the code segment.
Through the contents in the steps S401 to S404, the keywords and the test parameters corresponding to each line of analysis information are extracted one by one, after the keywords and the test parameters corresponding to the line of analysis information are extracted, the line of analysis information is processed, and the code segment corresponding to the processing result is sent to the tested object system for execution, so that the tested object system executes the test cases line by line.
Preferably, after sending the code segment corresponding to the line analysis information to the tested object system for execution, the service implementation layer receives an execution result fed back by the tested object system through the interface adaptation layer, and the execution result is a result obtained by the tested object system executing the code segment corresponding to the analysis information.
Correspondingly, for each line of analysis information, after the service implementation layer receives the execution result corresponding to the line of analysis information through the interface adaptation layer, the service implementation layer transmits the execution result to the test case layer through the service description layer and the keyword layer. That is, for each line of analysis information, the data transmission direction of the execution result of the line of analysis information is sequentially: the system comprises a system calling layer, an interface adaptation layer, a service realization layer, a service description layer, a keyword layer and a test case layer.
It should be noted that, as can be understood from the above, the object-to-be-tested system executes the code segments corresponding to the analysis information in the test case line by line, and the object-to-be-tested system feeds back the execution result corresponding to one line of analysis information after executing one code segment corresponding to the line of analysis information, it can be understood that the execution result fed back by the object-to-be-tested system may be used as a test parameter corresponding to other unprocessed analysis information in the test case.
To better explain the contents of the above steps S401 to S404, the process of calling the tested object system to execute the test case is illustrated by fig. 5 to 7, and it should be noted that fig. 5 to 7 are only used for illustration.
It should be noted that the application scenarios in fig. 5 to 7 are as follows: zhang III needs to take a Y cabin of a 4-month 23-day CA1831 flight to fly from Beijing (the city three-letter code is PEK) to an airplane in Shanghai (the city three-letter code is SHA), one ticket needs to be reserved for Zhang III, the connection mode of Zhang III is XXXYYYYQQQQ, and the identity card number is XXXXXXXXXYYYYMMDQQQZ.
Referring to fig. 5, a schematic diagram of a test case for creating a PNR according to an embodiment of the present invention is shown, in fig. 5, keywords corresponding to sequence numbers 1 to 14 represent a service flow of the test case for creating a PNR, and the keywords and test parameters corresponding to sequence numbers 1 to 14 are described in the following.
Number 1: the key is "start configuration ticket", and this key is used to initialize the data structure ticket _ info.
Sequence number 2: the keyword is 'configured ticket type', the test parameter is 'domestic', and the 'domestic' is assigned to the type field in ticket _ info.
It should be noted that the relevant information configuring the passenger is to create a passer data structure in ticket _ info, and the specific contents are the contents in sequence number 3 to sequence number 7.
Sequence No. 3: the key is "start to configure passengers", and the data structure ticket _ info.
Number 4: the keyword is "configure name", and the test parameter "Zhang three" is assigned to the field in the passer data structure related to the name.
Number 5: the keyword is 'configure passenger ID card', and the test parameter 'XXXXXYYYMMDDQQQZ' is assigned to the field related to the ID card in the passer data structure.
Number 6: the keyword is "add contact", and the test parameter "XXXYYYYQQQQ" is assigned to the contact related field in the passer data structure.
Number 7: the keyword is "complete configuration passenger", indicating completion of creation of the data structure related to the passenger information, and returning the passenger information structure (execution result of the business process), the execution result being "$ { passenger information } in the serial number 7.
It should be noted that the flight information is configured to create a ticket _ info.
Number 8: the keyword is "search for the designated flight", and it is ensured that the Y cabin of the CA1831 flight flying from beijing to shanghai in 23 days 4 is bookable, that is, the test parameters are "PEK" and "SHA", and a flight query result (execution result of the business process) is returned, and the execution result is "$ { available flight }" in sequence number 8.
Number 9: the keyword is 'flight for configuring passenger tickets', the test parameter is a flight query result returned by the serial number 8 (namely the test parameter is "$ { available flight }"), and the test parameter "$ { available flight }" is used as an input parameter of 'flight for configuring passenger tickets', and is used for creating a flight data structure.
It should be noted that the configured freight rate information is used to create ticket _ info.fare data structure, specifically including configuration payment method, configuration currency, configuration operation mode in serial number 10, and so on, which is only exemplified by serial number 10,
number 10: the keyword is 'configure freight rate mode', the test parameter is 'M', and the test parameter 'M' is assigned to a field related to 'configure freight rate mode' in the fare data structure.
Note that the completed ticket reservation includes contents of serial numbers 11 to 14.
Number 11: the keyword is "submit flight information".
Number 12: the keyword is "submit passenger information".
Number 13: the keyword is "submit freight rate information".
Sequence number 14: the keyword is "submit ticket booking information", and the execution result is fed back ("$ { pnr _ number } in serial number 14).
It can be understood that the above serial numbers 1 to 14 are contents in a test case, and the ticket _ info data structure of the test case is converted into a data structure supporting system invocation of the tested object according to the actual situation of the test case and the tested object system.
For example: as shown in fig. 6, by calling eTerm to create a PNR, ticket _ info data structure of a test case is converted into a host instruction that can be recognized by eTerm, so that eTerm executes the test case, and creation of the PNR is completed.
Another example is: as shown in fig. 7, the schematic diagram of invoking IBE to create PNR converts ticket _ info data structure of the test case into a data structure that can be invoked by IBE, so that IBE executes the test case to complete creation of PNR.
In the embodiment of the invention, the test case is analyzed in a calling mode supported by the tested object, and the analysis result obtained by analyzing the test case is sent to the tested object system, so that the tested object system executes the test case without designing the test case corresponding to different application systems, thereby improving the test efficiency and reducing the test cost.
Corresponding to the above automated testing method provided by the embodiment of the present invention, referring to fig. 8, the embodiment of the present invention further provides a structural block diagram of an automated testing system, where the automated testing system includes: a test case layer 801, a keyword layer 802, a service description layer 803, a service implementation layer 804 and an interface adaptation layer 805;
and the test case layer 801 is used for acquiring test requirements and test data corresponding to the service to be tested and determining a tested object system corresponding to the service to be tested.
The keyword layer 802 is configured to determine a plurality of keywords corresponding to a test requirement in a preset keyword library, and determine a test parameter corresponding to each keyword in test data, where the keyword library is determined according to automation test range information, a service attribute set, and a flow action set corresponding to a service to be tested.
And the service description layer 803 is used for constructing a test case by using each keyword and each test parameter.
The service description layer 803 is further configured to analyze the test case in combination with the service implementation layer 804.
And the service implementation layer 804 is configured to send the analysis result to the tested object system through the interface adaptation layer 805, so that the tested object system executes the test case.
In the embodiment of the invention, a keyword library is preset, keywords corresponding to the test requirement are obtained from the keyword library, and test parameters corresponding to the keywords are obtained from the test data. The key words and the test parameters are utilized to construct the test cases, the analysis results obtained by analyzing the test cases are sent to the tested object system, so that the tested object system executes the test cases, the test cases corresponding to different application systems are not required to be designed, the test efficiency is improved, and the test cost is reduced.
Preferably, in conjunction with the content shown in fig. 8, the keyword layer 802 for determining the keyword library includes: the device comprises a first determining unit, a second determining unit, a third determining unit and an adding unit, wherein the execution principle of each unit is as follows:
the first determining unit is used for determining a plurality of service demand points to be tested corresponding to the service to be tested according to the automatic testing range information of the service to be tested.
And the second determining unit is used for determining the service attribute corresponding to the service demand point to be detected from the service attribute set of the service to be detected aiming at each service demand point to be detected.
And the third determining unit is used for determining the keywords corresponding to the service demand points to be detected from the flow action set of the service to be detected by utilizing the service attributes corresponding to the service demand points to be detected aiming at each service demand point to be detected.
And the adding unit is used for adding the key words corresponding to the service demand points to be tested into the key word library.
In the embodiment of the invention, the keywords in the keyword library are expanded according to the automatic test range information, the service attribute set and the flow action set of the service to be tested, so that the keyword library can cover all service demand points to be tested in the automatic test range information of the service to be tested, the keyword library can meet the test process of the service to be tested, and the test stability and accuracy are improved.
Preferably, in combination with the content shown in fig. 8, the service description layer 803 for parsing the test case in combination with the service implementation layer includes: the analysis unit, the extraction unit and the processing unit, the execution principle of each unit is as follows:
and the analysis unit is used for analyzing the test case to obtain multi-row analysis information corresponding to the test case.
And the extraction unit is used for extracting the key words and the test parameters corresponding to the analysis information for each line of analysis information.
And the processing unit is configured to process the keyword and the test parameter corresponding to the analysis information for each line of analysis information, and send a processing result to the service implementation layer 804.
Accordingly, the number of the first and second electrodes,
and the service implementation layer 804 is configured to send a processing result corresponding to the analysis information to the interface adaptation layer 805 for each line of analysis information, so that the interface adaptation layer 805 analyzes the processing result to obtain a code segment and sends the code segment to the tested object system, so that the tested object system executes the code segment.
Preferably, the service description layer 803 further includes:
and the initialization unit is used for initializing the bottom layer execution sequence file corresponding to the test case.
Preferably, the service implementation layer 804 is further configured to: and receiving an execution result fed back by the tested object system through the interface adaptation layer, wherein the execution result is obtained by the tested object system executing the code segment corresponding to the analysis information.
In the embodiment of the invention, the test case is analyzed in a calling mode supported by the tested object, and the analysis result obtained by analyzing the test case is sent to the tested object system, so that the tested object system executes the test case without designing the test case corresponding to different application systems, thereby improving the test efficiency and reducing the test cost.
In summary, embodiments of the present invention provide an automated testing method and system, which preset a keyword library, obtain a keyword corresponding to a testing requirement from the keyword library, and obtain a testing parameter corresponding to the keyword from testing data. The key words and the test parameters are utilized to construct the test cases, the analysis results obtained by analyzing the test cases are sent to the tested object system, so that the tested object system executes the test cases, the test cases corresponding to different application systems are not required to be designed, the test efficiency is improved, and the test cost is reduced.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. An automated testing method is applied to an automated testing system, the automated testing system comprises a test case layer, a keyword layer, a service description layer, a service realization layer and an interface adaptation layer, and the method comprises the following steps:
the test case layer acquires test requirements and test data corresponding to a service to be tested and determines a tested object system corresponding to the service to be tested;
the keyword layer determines a plurality of keywords corresponding to the test requirement in a preset keyword library and determines a test parameter corresponding to each keyword in the test data, wherein the keyword library is determined according to the automatic test range information, the service attribute set and the flow action set corresponding to the service to be tested;
the service description layer constructs a test case by using each keyword and each test parameter;
the service description layer is combined with a service realization layer to analyze the test case, and the service realization layer sends an analysis result to the tested object system through an interface adaptation layer to enable the tested object system to execute the test case.
2. The method of claim 1, wherein the keyword layer determines the keyword library by a process comprising:
the keyword layer determines a plurality of service demand points to be tested corresponding to the service to be tested according to the automatic test range information of the service to be tested;
for each service demand point to be detected, the keyword layer determines a service attribute corresponding to the service demand point to be detected from the service attribute set of the service to be detected;
aiming at each service demand point to be detected, the keyword layer determines a keyword corresponding to the service demand point to be detected from the flow action set of the service to be detected by using the service attribute corresponding to the service demand point to be detected;
and the keyword layer adds the keywords corresponding to each service demand point to be tested into a keyword library.
3. The method of claim 1, wherein the service description layer analyzes the test case in combination with a service implementation layer, and the service implementation layer sends an analysis result to the object system through an interface adaptation layer, so that the object system executes the test case, including:
the service description layer analyzes the test case to obtain multi-row analysis information corresponding to the test case;
aiming at each line of the analysis information, the service description layer extracts the key words and the test parameters corresponding to the analysis information;
aiming at each line of the analysis information, the service description layer processes the key words and the test parameters corresponding to the analysis information and sends the processing result to a service implementation layer;
and aiming at each line of the analysis information, the service implementation layer sends the processing result corresponding to the analysis information to an interface adaptation layer, so that the interface adaptation layer analyzes the processing result to obtain a code segment and sends the code segment to the tested object system, and the tested object system executes the code segment.
4. The method of claim 3, wherein before the parsing the test case by the service description layer, the method further comprises:
and the service description layer initializes the bottom layer execution sequence file corresponding to the test case.
5. The method of claim 3, wherein after causing the object under test system to execute the code segment, further comprising:
and the service implementation layer receives an execution result fed back by the system to be tested through the interface adaptation layer, wherein the execution result is obtained by the system to be tested executing the code segment corresponding to the analysis information.
6. An automated test system, the system comprising: the system comprises a test case layer, a keyword layer, a service description layer, a service realization layer and an interface adaptation layer;
the test case layer is used for acquiring test requirements and test data corresponding to a service to be tested and determining a tested object system corresponding to the service to be tested;
the keyword layer is used for determining a plurality of keywords corresponding to the test requirement in a preset keyword library and determining test parameters corresponding to each keyword in the test data, and the keyword library is determined according to the automatic test range information, the service attribute set and the flow action set corresponding to the service to be tested;
the service description layer is used for constructing a test case by utilizing each keyword and each test parameter;
the service description layer is also used for analyzing the test case by combining with the service realization layer;
and the service implementation layer is used for sending the analysis result to the tested object system through the interface adaptation layer so that the tested object system executes the test case.
7. The system of claim 6, wherein the keyword layer for determining the keyword library comprises:
the first determining unit is used for determining a plurality of service demand points to be tested corresponding to the service to be tested according to the automatic testing range information of the service to be tested;
a second determining unit, configured to determine, for each service demand point to be detected, a service attribute corresponding to the service demand point to be detected from the service attribute set of the service to be detected;
a third determining unit, configured to determine, for each service demand point to be detected, a keyword corresponding to the service demand point to be detected from the flow action set of the service to be detected by using the service attribute corresponding to the service demand point to be detected;
and the adding unit is used for adding the key words corresponding to the service demand points to be tested into a key word library.
8. The system of claim 6, wherein the business description layer for parsing the test case in conjunction with a business implementation layer comprises:
the analysis unit is used for analyzing the test case to obtain multi-row analysis information corresponding to the test case;
an extracting unit, configured to extract, for each line of the analysis information, the keyword and the test parameter corresponding to the analysis information;
the processing unit is used for processing the key words and the test parameters corresponding to the analysis information and sending a processing result to a service implementation layer aiming at each line of the analysis information;
accordingly, the number of the first and second electrodes,
and the service implementation layer is used for sending the processing result corresponding to the analysis information to an interface adaptation layer aiming at each line of the analysis information, so that the interface adaptation layer analyzes the processing result to obtain a code segment and sends the code segment to the tested object system, and the tested object system executes the code segment.
9. The system of claim 8, wherein the service description layer further comprises:
and the initialization unit is used for initializing the bottom layer execution sequence file corresponding to the test case.
10. The system of claim 8, wherein the service implementation layer is further configured to: and receiving an execution result fed back by the system to be tested through the interface adaptation layer, wherein the execution result is a result obtained by the system to be tested executing the code segment corresponding to the analysis information.
CN202010617588.0A 2020-06-30 2020-06-30 Automatic testing method and system Pending CN111694751A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010617588.0A CN111694751A (en) 2020-06-30 2020-06-30 Automatic testing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010617588.0A CN111694751A (en) 2020-06-30 2020-06-30 Automatic testing method and system

Publications (1)

Publication Number Publication Date
CN111694751A true CN111694751A (en) 2020-09-22

Family

ID=72484598

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010617588.0A Pending CN111694751A (en) 2020-06-30 2020-06-30 Automatic testing method and system

Country Status (1)

Country Link
CN (1) CN111694751A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667494A (en) * 2020-12-08 2021-04-16 上海纳恩汽车技术股份有限公司 Automobile UDS automatic testing method and system based on configuration table and storage medium
CN113297084A (en) * 2021-05-27 2021-08-24 上海移远通信技术股份有限公司 Test method, test system, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068927A (en) * 2015-08-04 2015-11-18 株洲南车时代电气股份有限公司 Keyword drive-based automatic test method of urban rail drive control units

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068927A (en) * 2015-08-04 2015-11-18 株洲南车时代电气股份有限公司 Keyword drive-based automatic test method of urban rail drive control units

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667494A (en) * 2020-12-08 2021-04-16 上海纳恩汽车技术股份有限公司 Automobile UDS automatic testing method and system based on configuration table and storage medium
CN113297084A (en) * 2021-05-27 2021-08-24 上海移远通信技术股份有限公司 Test method, test system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US20190318309A1 (en) Cargo logistics platform
CN110610240A (en) Virtual automation assistance based on artificial intelligence
CN109002510A (en) A kind of dialog process method, apparatus, equipment and medium
CN105487931B (en) Passenger information real-time synchronization method between system and device
CN111694751A (en) Automatic testing method and system
WO2016100722A1 (en) Automatic conversion of formatted travel information
CN109460841A (en) User's account-opening method, system and storage medium
CN112651671A (en) Flight space adjusting method and related equipment
US20080300926A1 (en) Method and system for allowing user check-in
CN111950984A (en) Method and device for automatically opening departure check-in machine
AU2013211481B2 (en) Smart parsing of data
CN114594934A (en) Visual page generation method, device, equipment and medium
US9456042B2 (en) External device interface abstraction
CN108230218B (en) Multi-user-value machine pushing method and system, storage medium and electronic equipment
CN109784184A (en) Luggage delivery and claim method and device, storage medium, electronic equipment
DE212015000331U1 (en) Device for communication between users and computer systems
CN113010255A (en) Interaction method and device based on binding session group and computer equipment
CA2677389C (en) Remote customisation module and system comprising said module
US11789829B2 (en) Interprocess communication for asynchronous tasks
CN112231412B (en) Information synchronization updating method and device
CN103403714A (en) System and method for processing complex queries
CN113609014A (en) Interface field checking method and device, storage medium and electronic equipment
KR20210117039A (en) System and method for providing tour itinerary
CN115495031B (en) Method and system for realizing full-automatic unattended operation travel itinerary continuous printing
US20240031322A1 (en) Communication assist 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200922

RJ01 Rejection of invention patent application after publication