CN106886493B - Method and device for establishing automatic test system - Google Patents

Method and device for establishing automatic test system Download PDF

Info

Publication number
CN106886493B
CN106886493B CN201710096304.6A CN201710096304A CN106886493B CN 106886493 B CN106886493 B CN 106886493B CN 201710096304 A CN201710096304 A CN 201710096304A CN 106886493 B CN106886493 B CN 106886493B
Authority
CN
China
Prior art keywords
service
automatic test
requirement
test script
unit
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.)
Active
Application number
CN201710096304.6A
Other languages
Chinese (zh)
Other versions
CN106886493A (en
Inventor
王帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201710096304.6A priority Critical patent/CN106886493B/en
Publication of CN106886493A publication Critical patent/CN106886493A/en
Application granted granted Critical
Publication of CN106886493B publication Critical patent/CN106886493B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

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

Abstract

The embodiment of the invention discloses a method and a device for establishing an automatic test system, wherein a service requirement is formed according to the corresponding relation between an REST API list and a requirement decomposition table; combining the service requirements to obtain a service scene; therefore, a service scene which is convenient for a user to understand is formed by the dispersed and non-intuitive REST API, an automatic test script is generated aiming at the service scene, and the establishment of an automatic test system is completed. Therefore, the automatic test script is used for testing the service scene, and the service scene generally does not change, so that the generated automatic test script can be compiled once and run for many times, the defect that the test script needs to be recorded again when the test is carried out again is avoided, and the test working efficiency is effectively improved.

Description

Method and device for establishing automatic test system
Technical Field
The invention relates to the technical field of software testing, in particular to a method and a device for establishing an automatic testing system.
Background
Currently, the software industry is increasingly competitive, monitoring the quality of software projects throughout the entire project process, since manual testing takes a long time and is prone to errors, and automated testing is heavily incorporated into software testing activities.
The automated tests that are now common include two types, one is system level testing for Graphical User Interfaces (GUIs) and the other is Interface testing for Interface levels. However, both of these tests have their own drawbacks, and the first system level test for GUI results in frequent GUI changes due to frequent changes of project requirements, so that the previously recorded test scripts cannot be used after GUI changes, and the test scripts need to be recorded again during testing, which results in a reduction in the testing efficiency. The second interface test is generally used for interactive development among multiple systems or test of development of an application system with multiple subsystems. The interface test is suitable for a bottom-layer framework system and a central service system which provide services for other systems, and mainly tests interfaces provided by the systems to the outside to verify the correctness and the stability of the interfaces, but the test is too one-sided, and the service of the whole system cannot be proved to be free of problems due to the fact that the interface test is single.
Therefore, how to accurately and efficiently realize the test of the system service is a problem to be solved urgently by technical personnel in the field.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for establishing an automatic test system, so that the established automatic test system can accurately and efficiently realize the test of system services.
In order to solve the above technical problem, an embodiment of the present invention provides a method for establishing an automated test system, including:
forming a service requirement according to the corresponding relation between the REST API list and the requirement decomposition table;
combining the service requirements to obtain a service scene;
and generating an automatic test script aiming at the service scene to complete the establishment of an automatic test system.
Optionally, the automatic test script includes mailbox information and preset time.
Optionally, the method further includes:
in the preset time, automatically testing the service scene by using the automatic test script corresponding to the service scene;
and after the preset time is reached, sending a test report to a mailbox account included in the mailbox information according to the mailbox information included in the automatic test script.
Optionally, the script development language of the automatic test script adopts javascript.
The embodiment of the invention also provides a device for establishing the automatic test system, which comprises a forming unit, a combining unit and a generating unit:
the forming unit is used for forming the service requirement according to the corresponding relation between the REST API list and the requirement decomposition table;
the combination unit is used for combining the service requirements to obtain a service scene;
and the generating unit is used for generating an automatic test script aiming at the service scene to complete the establishment of an automatic test system.
Optionally, the automatic test script includes mailbox information and preset time.
Optionally, the system further comprises a test unit and a sending unit:
the test unit is used for carrying out automatic test on the service scene by using the automatic test script corresponding to the service scene within the preset time;
and when the preset time is up, triggering the sending unit, wherein the sending unit is used for sending a test report to a mailbox account included in the mailbox information according to the mailbox information included in the automatic test script.
Optionally, the script development language of the automatic test script adopts javascript.
According to the technical scheme, the service requirement is formed according to the corresponding relation between the REST API list and the requirement decomposition table; combining the service requirements to obtain a service scene; therefore, a service scene which is convenient for a user to understand is formed by the dispersed and non-intuitive REST API, an automatic test script is generated aiming at the service scene, and the establishment of an automatic test system is completed. Therefore, the automatic test script is used for testing the service scene, and the service scene generally does not change, so that the generated automatic test script can be compiled once and run for many times, the defect that the test script needs to be recorded again when the test is carried out again is avoided, and the test working efficiency is effectively improved.
Drawings
In order to illustrate the embodiments of the present invention more clearly, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a method for establishing an automatic test system according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a setup apparatus of an automatic test 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 obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative work belong to the protection scope of the present invention.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Next, a method for establishing an automated testing system according to an embodiment of the present invention will be described in detail. Fig. 1 is a flowchart of a method for establishing an automated test system according to an embodiment of the present invention, where the method includes:
s101: and forming a service requirement according to the corresponding relation between the REST API list and the requirement decomposition table.
Before the automatic test system is established, an automatic test framework and a script development language used by the automatic test system need to be selected in advance.
By definition of the framework, the automated testing framework may be a basic automated testing module that provides reusability, such as: selenium, watir, etc., which mainly provide the most basic automated testing functions. The automated test Framework may also be an architecture module providing automated test execution and management functions, such as Phoenix Framework, robot, SATF, etc. An automated testing framework may be a set of tools consisting of one or more automated testing infrastructure modules, automated testing management modules, automated testing statistics modules, and the like. In the embodiment of the present invention, an automatic test framework may be selected according to specific requirements, which is not limited herein, for example, the automatic test framework may adopt Selenium + webdriver + nodejs, and a corresponding script development language may adopt javascript.
The service requirement may be a basic test item of the service test, for example, if the booting is required to be tested, the corresponding service requirement is the booting test requirement. A service requirement can be converted into a requirement of a smaller unit after being split, the requirement can be called a service unit, a complete service requirement can be formed by combining one or more service units, and the requirement splitting table can be used for storing the service units after the service requirement is split.
One or more REST APIs can be combined to form corresponding service requirements according to the corresponding relation between the REST API list and the requirement decomposition list. That is, a business requirement may be composed of one or more REST APIs.
S102: and combining the service requirements to obtain a service scene.
The service scenario may be used to represent a service that needs to be tested, and may be defined according to a test requirement of a user. For a service scenario, there may be one or more service requirements, and the implementation of a service scenario generally goes through several processes, each process is equivalent to a service requirement. Therefore, the relevant service requirements are combined, and a corresponding service scene is obtained.
S103: and generating an automatic test script aiming at the service scene to complete the establishment of an automatic test system.
In the embodiment of the invention, the automatic test script can be generated through an automatic test tool, and the automatic test tool can generate the automatic test script corresponding to the service scene aiming at different service scenes, namely the automatic test scripts corresponding to different service scenes are different. The automated testing tool may be, for example, selenium.
According to the technical scheme, the service requirement is formed according to the corresponding relation between the REST API list and the requirement decomposition table; combining the service requirements to obtain a service scene; therefore, a service scene which is convenient for a user to understand is formed by the dispersed and non-intuitive REST API, an automatic test script is generated aiming at the service scene, and the establishment of an automatic test system is completed. Therefore, the automatic test script is used for testing the service scene, and the service scene generally does not change, so that the generated automatic test script can be compiled once and run for many times, the defect that the test script needs to be recorded again when the test is carried out again is avoided, and the test working efficiency is effectively improved.
After the automated testing tool is used to generate the automated testing script, the automated testing script may be used to test the service scenario in order to detect whether the automated testing system can implement the test on the service scenario. Specifically, the service scene may be automatically tested by using the automatic test script corresponding to the service scene within a preset time; and after the preset time is reached, sending a test report to a mailbox account included in the mailbox information according to the mailbox information included in the automatic test script.
The format of the test report may be defined by a selected automated test framework, and the test report may be used to indicate whether the service scenario passes the test result.
In a specific implementation, mailbox information and preset time can be marked in the generated automatic test script.
For example, the mailbox information may be a mailbox account of the responsible person, and the purpose of labeling the mailbox information is to send the generated test report to the mailbox account of the responsible person, so that the responsible person can know the operation condition of the automatic test system and timely process a service scene which fails to pass the test. The mailbox information can also contain a mailbox account number of the project manager, so that the project manager can know the condition of the automatic test system in time and make further planning on the establishment of the automatic test system.
The preset time may be a scheduled completion time for testing the business scenario. The length of the preset time can be set according to actual requirements, and is not described in detail herein.
Fig. 2 is a schematic structural diagram of a setup apparatus of an automatic test system according to an embodiment of the present invention, including a forming unit 21, a combining unit 22, and a generating unit 23:
the forming unit 21 is configured to form a service requirement according to a corresponding relationship between the REST API list and the requirement decomposition table.
The combining unit 22 is configured to combine the service requirements to obtain a service scenario.
The generating unit 23 is configured to generate an automated testing script for the service scenario, so as to complete establishment of an automated testing system.
Optionally, the automatic test script includes mailbox information and preset time.
Optionally, the system further comprises a test unit and a sending unit:
the test unit is used for carrying out automatic test on the service scene by using the automatic test script corresponding to the service scene within the preset time;
and when the preset time is up, triggering the sending unit, wherein the sending unit is used for sending a test report to a mailbox account included in the mailbox information according to the mailbox information included in the automatic test script.
Optionally, the script development language of the automatic test script adopts javascript.
The description of the features in the embodiment corresponding to fig. 2 may refer to the related description of the embodiment corresponding to fig. 1, and is not repeated here.
The method and the device for establishing the automatic test system provided by the invention are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
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 steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

Claims (8)

1. A method for establishing an automatic test system is characterized by comprising the following steps:
forming a service requirement according to the corresponding relation between the REST API list and the requirement decomposition table; one service requirement is formed by combining one or more service units, a requirement decomposition table is used for storing the service units after the service requirements are split, and one or more REST APIs are combined according to the corresponding relation between the REST API list and the requirement decomposition table to form corresponding service requirements;
combining the service requirements to obtain a service scene;
and generating an automatic test script aiming at the service scene to complete the establishment of an automatic test system.
2. The method of claim 1, wherein the automated test script comprises mailbox information and a preset time.
3. The method of claim 2, further comprising:
in the preset time, automatically testing the service scene by using the automatic test script corresponding to the service scene;
and after the preset time is reached, sending a test report to a mailbox account included in the mailbox information according to the mailbox information included in the automatic test script.
4. A method according to any one of claims 1 to 3, wherein the script development language of the automated test script is javascript.
5. The automatic test system establishing device is characterized by comprising a forming unit, a combining unit and a generating unit:
the forming unit is used for forming the service requirement according to the corresponding relation between the REST API list and the requirement decomposition table; one service requirement is formed by combining one or more service units, a requirement decomposition table is used for storing the service units after the service requirements are split, and one or more REST APIs are combined according to the corresponding relation between the REST API list and the requirement decomposition table to form corresponding service requirements;
the combination unit is used for combining the service requirements to obtain a service scene;
and the generating unit is used for generating an automatic test script aiming at the service scene to complete the establishment of an automatic test system.
6. The apparatus of claim 5, wherein the automated test script comprises mailbox information and a preset time.
7. The apparatus of claim 6, further comprising a testing unit and a transmitting unit:
the test unit is used for carrying out automatic test on the service scene by using the automatic test script corresponding to the service scene within the preset time;
and when the preset time is up, triggering the sending unit, wherein the sending unit is used for sending a test report to a mailbox account included in the mailbox information according to the mailbox information included in the automatic test script.
8. The apparatus of any of claims 5-7, wherein the script development language of the automated test script is javascript.
CN201710096304.6A 2017-02-22 2017-02-22 Method and device for establishing automatic test system Active CN106886493B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710096304.6A CN106886493B (en) 2017-02-22 2017-02-22 Method and device for establishing automatic test system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710096304.6A CN106886493B (en) 2017-02-22 2017-02-22 Method and device for establishing automatic test system

Publications (2)

Publication Number Publication Date
CN106886493A CN106886493A (en) 2017-06-23
CN106886493B true CN106886493B (en) 2021-02-02

Family

ID=59179428

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710096304.6A Active CN106886493B (en) 2017-02-22 2017-02-22 Method and device for establishing automatic test system

Country Status (1)

Country Link
CN (1) CN106886493B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368412A (en) * 2017-07-03 2017-11-21 上海前隆信息科技有限公司 Automated testing method/system, computer-readable recording medium and electronic equipment
CN107818045A (en) * 2017-09-29 2018-03-20 安徽四创电子股份有限公司 A kind of method for testing software of safe city
CN108268377A (en) * 2018-01-23 2018-07-10 郑州云海信息技术有限公司 A kind of service test method of server, device and medium
CN108984406A (en) * 2018-07-12 2018-12-11 郑州云海信息技术有限公司 A kind of method and system of automatic Verification BMC console KVM stability
CN109344077A (en) * 2018-10-24 2019-02-15 郑州云海信息技术有限公司 RestAPI characteristic test method, device, equipment and storage medium
CN110515848B (en) * 2019-08-29 2023-06-09 行吟信息科技(上海)有限公司 Automatic test system and automatic test method
CN111209185B (en) * 2019-12-23 2022-12-06 厦门市美亚柏科信息股份有限公司 Keyword-based automated testing method and computer-readable storage medium
CN117931679B (en) * 2024-03-21 2024-07-16 成都佰维存储科技有限公司 Version test result sending method and device, readable storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005059744A1 (en) * 2003-12-18 2005-06-30 Motorola Inc A method of automatically generating test scripts from a system specification model
CN105159829A (en) * 2015-08-27 2015-12-16 浪潮电子信息产业股份有限公司 Demand tracking system based on automatic test
CN105988904A (en) * 2015-02-06 2016-10-05 展讯通信(天津)有限公司 Self-adaptive testing method and system
CN106201800A (en) * 2016-07-15 2016-12-07 北京捷科智诚科技有限公司 A kind of test design platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005059744A1 (en) * 2003-12-18 2005-06-30 Motorola Inc A method of automatically generating test scripts from a system specification model
CN105988904A (en) * 2015-02-06 2016-10-05 展讯通信(天津)有限公司 Self-adaptive testing method and system
CN105159829A (en) * 2015-08-27 2015-12-16 浪潮电子信息产业股份有限公司 Demand tracking system based on automatic test
CN106201800A (en) * 2016-07-15 2016-12-07 北京捷科智诚科技有限公司 A kind of test design platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于YANG的ODL控制器连网需求模型的建立与测试;王长忠;《中国优秀硕士学位论文全文数据库 信息科技辑》;20170215(第02期);第27页 *

Also Published As

Publication number Publication date
CN106886493A (en) 2017-06-23

Similar Documents

Publication Publication Date Title
CN106886493B (en) Method and device for establishing automatic test system
CN105335293B (en) A kind of automatization test system and method based on interface concurrent
US10229039B2 (en) Testing a virtual network function by a virtual network tester
US10241897B2 (en) Identifying test gaps using code execution paths
CN109947641B (en) Automatic testing method and device
US20100058295A1 (en) Dynamic Test Coverage
CN106933709B (en) Test method and device
CN105787364B (en) Automatic testing method, device and system for tasks
CN109376088B (en) Automatic test system and automatic test method
CN109633351B (en) Intelligent IT operation and maintenance fault positioning method, device, equipment and readable storage medium
WO2019104916A1 (en) Development role creation method, device and equipment for test case, and storage medium
CN110532021B (en) Processing method of configuration file of distributed control system, client and service device
CN107038120B (en) Software testing method and device
CN104202201A (en) Log processing method and device and terminal
CN107302476A (en) A kind of automated testing method and system for testing asynchronous interactive system
CN109710474B (en) Hard disk fault detection method and device, terminal and readable storage medium
CN107193730A (en) A kind of interface test method of automation
US9823999B2 (en) Program lifecycle testing
CN111444051A (en) Complete machine production testing method and system for product
CN106557419B (en) Program testing method and device
CN110750453B (en) HTML 5-based intelligent mobile terminal testing method, system, server and storage medium
CN108243033A (en) A kind of method given a mark to video quality, cloud server terminal and system
CN106972983B (en) Automatic testing device and method for network interface
CN107783879B (en) Method and equipment for analyzing workflow execution path
CN105786694A (en) Automatic test system and method, and mobile terminals

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210105

Address after: Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: Room 1601, floor 16, 278 Xinyi Road, Zhengdong New District, Zhengzhou City, Henan Province

Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant