CN106874188A - Software interface test approach and device - Google Patents

Software interface test approach and device Download PDF

Info

Publication number
CN106874188A
CN106874188A CN201611252188.4A CN201611252188A CN106874188A CN 106874188 A CN106874188 A CN 106874188A CN 201611252188 A CN201611252188 A CN 201611252188A CN 106874188 A CN106874188 A CN 106874188A
Authority
CN
China
Prior art keywords
scf
interface
services
serviced
software
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201611252188.4A
Other languages
Chinese (zh)
Other versions
CN106874188B (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.)
Beijing 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN201611252188.4A priority Critical patent/CN106874188B/en
Publication of CN106874188A publication Critical patent/CN106874188A/en
Application granted granted Critical
Publication of CN106874188B publication Critical patent/CN106874188B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/362Software debugging
    • G06F11/3648Software debugging using additional hardware
    • G06F11/3656Software debugging using additional hardware using a specific debug interface

Landscapes

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

Abstract

The present invention provides a kind of software interface test approach and device, and the method includes:Receive the title of the servicing communications framework SCF services of user input;Dispose the SCF services;The interface that the SCF is serviced is obtained by reflecting, the interface of the SCF services includes interface name, the parameter type for realizing class and interface of interface;The interface serviced by SCF described in default testing case.The automatic test of the interface to SCF services is the method achieve, checks source code manual identified interface without tester to be tested, so that the significant increase testing efficiency of software interface.

Description

Software interface test approach and device
Technical field
The present invention relates to computer technology, more particularly to a kind of software interface test approach and device.
Background technology
, it is necessary to docking port is tested in software test procedure.For example, based on servicing communications framework (Service Communication Framework, abbreviation SCF) framework software test in, it is necessary to SCF interfaces are tested.
In the prior art, the tester of software needs to first look at the corresponding source code of software, is recognized from source code Go out interface message to be tested, and then, interface to be tested is tested using test case.
But, prior art needs tester by checking source code manual identified interface, causes testing efficiency low.
The content of the invention
The present invention provides a kind of software interface test approach and device, for solving manual identified interface institute in the prior art The low problem of caused testing efficiency.
First aspect present invention provides a kind of software interface test approach, including:
Receive the title of the servicing communications framework SCF services of user input;
Dispose the SCF services;
The interface that the SCF is serviced is obtained by reflecting, the interface of the SCF services includes interface name, the reality of interface The parameter type of existing class and interface;
The interface serviced by SCF described in default testing case.
Further, before the default test case of execution, also include:
Initialize the SCF services.
Further, the initialization SCF services, including:
Detection transmission control protocol TCP connection status;
Restart the SCF services.
Further, before the detection transmission control protocol TCP connection status, also include:
With the presence or absence of SCF services in detection configuration file, if it is not, then increasing the SCF in the configuration file Service.
Further, before the deployment SCF services, also include:
Judge whether the SCF services have registered, if it is not, then carrying out the SCF service registrys.
Second aspect present invention provides a kind of software interface test device, including:
Receiver module, the title that the servicing communications framework SCF for receiving user input is serviced;
Deployment module, for disposing the SCF services;
Acquisition module, the interface for obtaining the SCF services by reflecting, the interface of the SCF services includes interface The parameter type for realizing class and interface of title, interface;
Test module, for the interface serviced by SCF described in default testing case.
Further, also include:
Initialization module, for initializing the SCF services.
Further, the initialization module includes:
Detection unit, for detecting transmission control protocol TCP connection status;
Unit is restarted, for restarting the SCF services.
Further, the initialization module also includes:
Adding unit, for when being serviced in the absence of the SCF in detecting configuration file, increasing in the configuration file Plus the SCF services.
Further, described device also includes:
Registering modules, for when judging that the SCF services are unregistered, carrying out the SCF service registrys.
Software interface test approach provided by the present invention and device, software test platform are obtained and dispose SCF clothes first Business, and then the interface that SCF is serviced is obtained by reflecting, and the interface that accessed SCF is serviced is tested.So as to realize Automatic test to the interface of SCF services, checks source code manual identified interface to be tested, so that pole without tester The big testing efficiency for improving software interface.
Brief description of the drawings
In order to illustrate more clearly of technical scheme of the invention or of the prior art, below will be to embodiment or prior art The accompanying drawing to be used needed for description is briefly described, it should be apparent that, drawings in the following description are of the invention one A little embodiments, for those of ordinary skill in the art, without having to pay creative labor, can also be according to this A little accompanying drawings obtain other accompanying drawings.
The system architecture diagram of the software interface test approach that Fig. 1 is provided for the present invention;
The schematic flow sheet of the software interface test approach embodiment one that Fig. 2 is provided for the present invention;
The schematic flow sheet of the software interface test approach embodiment two that Fig. 3 is provided for the present invention;
The schematic flow sheet of the software interface test approach embodiment three that Fig. 4 is provided for the present invention;
The schematic flow sheet of the software interface test approach example IV that Fig. 5 is provided for the present invention;
The function structure chart of the software interface test device embodiment one that Fig. 6 is provided for the present invention;
The function structure chart of the software interface test device embodiment two that Fig. 7 is provided for the present invention;
The function structure chart of the software interface test device embodiment three that Fig. 8 is provided for the present invention;
The function structure chart of the software interface test device example IV that Fig. 9 is provided for the present invention;
The function structure chart of the software interface test device embodiment five that Figure 10 is provided for the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with the embodiment of the present invention in it is attached Figure, is clearly and completely described to the technical scheme in the embodiment of the present invention, it is clear that described embodiment is the present invention A part of embodiment, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not having The every other embodiment obtained under the premise of creative work is made, the scope of protection of the invention is belonged to.
The system architecture diagram of the software interface test approach that Fig. 1 is provided for the present invention, as described in Figure 1, involved by the method Platform include:Software code writes platform, software translating platform and software test platform.Wherein, software developer is led to Cross software code and write platform write software code, then be compiled by software translating platform, form executable software kit, it is soft Software kit of the part test platform again to can perform is tested.The solution of the present invention corresponds to software test platform, i.e., by software Test platform performs the solution of the present invention, to realize the automatic test of software interface.
The schematic flow sheet of the software interface test approach embodiment one that Fig. 2 is provided for the present invention, as shown in Fig. 2 the party Method includes:
S201, the title of the SCF services of reception user input.
Software test platform can provide the user operable interface, and selective listing or input are shown in operation interface Frame etc., when needing to be tested, it is only necessary to be input into the title of SCF services to be tested.
Wherein, the SCF services in the present invention are specific software to be tested.
SCF is that a kind of support is cross-platform with high concurrent, high-performance, high reliability, and provides asynchronous, multi-protocols, event The intermediate layer service framework of driving, the software write based on the service framework is considered as SCF services, including many Individual SCF interfaces.When to SCF service testings, it is necessary to which the interface to SCF services is tested.
S202, deployment SCF services.
In based on the system architecture shown in Fig. 1, software translating platform for example can be Jenkins.Jenkins can be by Setting timing according to user carries out that software continuous are integrated, to obtain executable software kit.And preserve executable software kit Under fixed catalogue.
And then, in this step, software test platform can be obtained under the catalogue of above-mentioned fixation SCF services it is corresponding can The software kit of execution, and SCF services are disposed on software test platform, wherein, the executable software kit of SCF services includes visitor Family end software kit and service terminal software bag..
Alternatively, every time before deployment SCF services, SCF can be built by Jenkins and is serviced, to ensure the SCF of deployment The client bag and service end bag of service are all newest.
S203, the interface that above-mentioned SCF services are obtained by reflecting, the interface of SCF services include interface name, the reality of interface The parameter type of existing class and interface.
After the completion of deployment SCF services, software test platform can automatically obtain connecing for SCF services by reflection mode Mouthful, the information of acquired interface realizes class and interface parameters type etc. including interface name, interface.
Wherein, the specific method for SCF service interfaces being obtained by reflecting is referred to prior art, and here is omitted.
S204, the interface serviced by the above-mentioned SCF of default testing case.
Specifically, software test platform can import the test case that writes in advance, these test cases dedicated for The above-mentioned accessed interface of test.
Wherein, in test, a test case can only test a SCF interface, it is also possible to which test multiple SCF connects Mouthful, therefore, software test platform can be tested a SCF interface as needed, it is also possible to which multiple SCF interfaces are carried out Test.
In the present embodiment, software test platform is obtained and disposes SCF services first, and then obtains SCF services by reflecting Interface, and interface to accessed SCF services tests.So as to realize the automatic test of the interface to SCF services, Source code manual identified interface is checked without tester to be tested, so that the test effect of significant increase software interface Rate.
In another embodiment, before above-mentioned steps S204, also include:
Initialize above-mentioned SCF services.
The schematic flow sheet of the software interface test approach embodiment two that Fig. 3 is provided for the present invention, as shown in figure 3, above-mentioned The process for initializing above-mentioned SCF services is specially:
S301, detection transmission control protocol (Transmission Control Protocol, abbreviation TCP) connection status.
When the interface testing of SCF services is carried out, it is necessary to ensure that TCP connections are normal, therefore, it is necessary to first in this step Detection TCP connection state, if connection status exception, needs to solve the problem first, it is ensured that TCP connections are normal.
S302, restarting SCF services.
Specifically, software test platform can call the script that restarting SCF is serviced to restart SCF services.
The schematic flow sheet of the software interface test approach embodiment three that Fig. 4 is provided for the present invention, as shown in figure 4, initially The process for changing SCF services includes:
With the presence or absence of above-mentioned SCF services in S401, detection configuration file, if it is not, then increasing above-mentioned SCF in configuration file Service.
Above-mentioned configuration file refers to the configuration file in software test platform, it is necessary to the SCF services of test are required at this Registered in configuration file.Software test platform is being tested when SCF is serviced, it is necessary to read the letter of SCF services from the configuration file Tested again after breath.
In this step, if serviced in the absence of above-mentioned SCF in configuration file, need to increase above-mentioned in configuration file SCF is serviced.
S402, detection pass TCP connection state.
Detailed process is identical with the process of S301, may refer to S301, and here is omitted.
S403, restarting SCF services.
Detailed process is identical with the process of S302, may refer to S302, and here is omitted.
The schematic flow sheet of the software interface test approach example IV that Fig. 5 is provided for the present invention, as shown in figure 5, the party Method includes:
S501, the title of the SCF services of reception user input.
Detailed process is identical with the process of S201, may refer to S201, and here is omitted.
S502, judge whether above-mentioned SCF service has registered, if it is not, then carrying out above-mentioned SCF service registrys.
Specifically, judge whether SCF services have registered, that is, judge whether SCF services register in software test platform, If do not registered, need to register the information of SCF services on software test platform.
S503, deployment SCF services
Detailed process is identical with the process of S202, may refer to S202, and here is omitted.
S504, the interface that above-mentioned SCF services are obtained by reflecting, the interface of SCF services include interface name, the reality of interface The parameter type of existing class and interface.
Detailed process is identical with the process of S203, may refer to S203, and here is omitted.
S505, the interface serviced by the above-mentioned SCF of default testing case.
Detailed process is identical with the process of S204, may refer to S204, and here is omitted.
The function structure chart of the software interface test device embodiment one that Fig. 6 is provided for the present invention, as shown in fig. 6, the dress Put including:
Receiver module 601, the title that the SCF for receiving user input is serviced.
Deployment module 602, for disposing above-mentioned SCF services.
Acquisition module 603, the interface for obtaining above-mentioned SCF services by reflecting, the interface of above-mentioned SCF services includes connecing Mouth title, the parameter type for realizing class and interface of interface.
Test module 604, for the interface serviced by the above-mentioned SCF of default testing case.
The device is used to realize preceding method embodiment that its realization principle to be similar with technique effect, and here is omitted.
The function structure chart of the software interface test device embodiment two that Fig. 7 is provided for the present invention, as shown in fig. 7, also wrapping Include:
Initialization module 605, for initializing above-mentioned SCF services.
The function structure chart of the software interface test device embodiment three that Fig. 8 is provided for the present invention, as shown in fig. 7, initially Changing module 605 includes:
Detection unit 6051, for detecting TCP connection state.
Unit 6052 is restarted, for restarting above-mentioned SCF services.
The function structure chart of the software interface test device example IV that Fig. 9 is provided for the present invention, as shown in figure 9, initially Changing module 605 also includes:
Adding unit 6053, for when being serviced in the absence of above-mentioned SCF in detecting configuration file, increasing in configuration file Serviced plus SCF is stated.
The function structure chart of the software interface test device embodiment five that Figure 10 is provided for the present invention, as shown in Figure 10, should Device also includes:
Registering modules 606, for when judging that above-mentioned SCF services are unregistered, carrying out SCF service registrys.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to The related hardware of programmed instruction is crossed to complete.Foregoing program can be stored in a computer read/write memory medium.The journey Sequence upon execution, performs the step of including above-mentioned each method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or Person's CD etc. is various can be with the medium of store program codes.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent Pipe has been described in detail with reference to foregoing embodiments to the present invention, it will be understood by those within the art that:Its according to The technical scheme described in foregoing embodiments can so be modified, or which part or all technical characteristic are entered Row equivalent;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology The scope of scheme.

Claims (10)

1. a kind of software interface test approach, it is characterised in that including:
Receive the title of the servicing communications framework SCF services of user input;
Dispose the SCF services;
The interface that the SCF is serviced is obtained by reflecting, the interface of the SCF services includes that interface name, interface realize class And the parameter type of interface;
The interface serviced by SCF described in default testing case.
2. method according to claim 1, it is characterised in that before the default test case of execution, also include:
Initialize the SCF services.
3. method according to claim 2, it is characterised in that the initialization SCF services, including:
Detection transmission control protocol TCP connection status;
Restart the SCF services.
4. method according to claim 3, it is characterised in that before the detection transmission control protocol TCP connection status, Also include:
With the presence or absence of SCF services in detection configuration file, if it is not, then increasing the SCF services in the configuration file.
5. the method according to claim any one of 1-4, it is characterised in that before the deployment SCF services, also wrap Include:
Judge whether the SCF services have registered, if it is not, then carrying out the SCF service registrys.
6. a kind of software interface test device, it is characterised in that including:
Receiver module, the title that the servicing communications framework SCF for receiving user input is serviced;
Deployment module, for disposing the SCF services;
Acquisition module, for obtaining the interface that the SCF is serviced by reflecting, the interface of the SCF services include interface name, The parameter type for realizing class and interface of interface;
Test module, for the interface serviced by SCF described in default testing case.
7. device according to claim 6, it is characterised in that also include:
Initialization module, for initializing the SCF services.
8. device according to claim 7, it is characterised in that the initialization module includes:
Detection unit, for detecting transmission control protocol TCP connection status;
Unit is restarted, for restarting the SCF services.
9. device according to claim 8, it is characterised in that the initialization module also includes:
Adding unit, for when being serviced in the absence of the SCF in detecting configuration file, institute being increased in the configuration file State SCF services.
10. the device according to claim any one of 6-9, it is characterised in that described device also includes:
Registering modules, for when judging that the SCF services are unregistered, carrying out the SCF service registrys.
CN201611252188.4A 2016-12-30 2016-12-30 Software interface testing method and device Active CN106874188B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611252188.4A CN106874188B (en) 2016-12-30 2016-12-30 Software interface testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611252188.4A CN106874188B (en) 2016-12-30 2016-12-30 Software interface testing method and device

Publications (2)

Publication Number Publication Date
CN106874188A true CN106874188A (en) 2017-06-20
CN106874188B CN106874188B (en) 2020-05-12

Family

ID=59164150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611252188.4A Active CN106874188B (en) 2016-12-30 2016-12-30 Software interface testing method and device

Country Status (1)

Country Link
CN (1) CN106874188B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766242A (en) * 2017-10-09 2018-03-06 广州慧睿思通信息科技有限公司 A kind of interface test method based on JMETER
CN108763047A (en) * 2018-05-31 2018-11-06 北京五八信息技术有限公司 Method, apparatus, equipment and the storage medium that SCF is tested for the property
CN110569194A (en) * 2019-09-09 2019-12-13 五八有限公司 interface testing method and device, electronic equipment and storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866221A (en) * 2006-02-27 2006-11-22 华为技术有限公司 Software interface testing method and apparatus
CN101286131A (en) * 2007-04-09 2008-10-15 国际商业机器公司 Service test method and service test system
US20110321028A1 (en) * 2010-06-23 2011-12-29 Microsoft Corporation Applications including multiple experience modules
CN102591772A (en) * 2011-12-15 2012-07-18 北京航空航天大学 Service composition regression testing method and service composition regression testing device
CN102855178A (en) * 2011-06-30 2013-01-02 阿里巴巴集团控股有限公司 Method and device for generating Mock base during unit test
CN102932205A (en) * 2012-11-19 2013-02-13 深圳市亚特尔科技有限公司 Automatic test method and test platform of network server-side interface
CN103136095A (en) * 2011-11-28 2013-06-05 阿里巴巴集团控股有限公司 Method, device and system of test application program interface
US8893087B2 (en) * 2011-08-08 2014-11-18 Ca, Inc. Automating functionality test cases
CN104423983A (en) * 2013-08-29 2015-03-18 国际商业机器公司 Method and device for developing, testing and deploying application
CN104572463A (en) * 2014-12-31 2015-04-29 广州酷狗计算机科技有限公司 Method and device for testing interface information
US20150234651A1 (en) * 2014-02-20 2015-08-20 International Business Machines Corporation Managing deployment of application pattern based applications on runtime platforms
US9122804B2 (en) * 2013-05-15 2015-09-01 Oracle Internation Corporation Logic validation and deployment
CN105335286A (en) * 2014-08-15 2016-02-17 阿里巴巴集团控股有限公司 Static library test method and apparatus

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866221A (en) * 2006-02-27 2006-11-22 华为技术有限公司 Software interface testing method and apparatus
CN101286131A (en) * 2007-04-09 2008-10-15 国际商业机器公司 Service test method and service test system
US20110321028A1 (en) * 2010-06-23 2011-12-29 Microsoft Corporation Applications including multiple experience modules
CN102855178A (en) * 2011-06-30 2013-01-02 阿里巴巴集团控股有限公司 Method and device for generating Mock base during unit test
US8893087B2 (en) * 2011-08-08 2014-11-18 Ca, Inc. Automating functionality test cases
CN103136095A (en) * 2011-11-28 2013-06-05 阿里巴巴集团控股有限公司 Method, device and system of test application program interface
CN102591772A (en) * 2011-12-15 2012-07-18 北京航空航天大学 Service composition regression testing method and service composition regression testing device
CN102932205A (en) * 2012-11-19 2013-02-13 深圳市亚特尔科技有限公司 Automatic test method and test platform of network server-side interface
US9122804B2 (en) * 2013-05-15 2015-09-01 Oracle Internation Corporation Logic validation and deployment
CN104423983A (en) * 2013-08-29 2015-03-18 国际商业机器公司 Method and device for developing, testing and deploying application
US20150234651A1 (en) * 2014-02-20 2015-08-20 International Business Machines Corporation Managing deployment of application pattern based applications on runtime platforms
CN105335286A (en) * 2014-08-15 2016-02-17 阿里巴巴集团控股有限公司 Static library test method and apparatus
CN104572463A (en) * 2014-12-31 2015-04-29 广州酷狗计算机科技有限公司 Method and device for testing interface information

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郑珂,刘克成主编: "《Java程序设计》", 31 July 2012 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766242A (en) * 2017-10-09 2018-03-06 广州慧睿思通信息科技有限公司 A kind of interface test method based on JMETER
CN108763047A (en) * 2018-05-31 2018-11-06 北京五八信息技术有限公司 Method, apparatus, equipment and the storage medium that SCF is tested for the property
CN110569194A (en) * 2019-09-09 2019-12-13 五八有限公司 interface testing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN106874188B (en) 2020-05-12

Similar Documents

Publication Publication Date Title
US9424221B2 (en) Automated cabling process for a complex environment
CN108563567B (en) Automated testing method, apparatus, device and computer readable storage medium
CN104461903B (en) The method and apparatus of test client based on browser
US20220214932A1 (en) Methods, devices and computer storage media for inter-mini program platform communication
CN106874188A (en) Software interface test approach and device
CN110018962A (en) Service adjustment method and system based on distributed service framework and registration center
CN106888125A (en) A kind of method for processing abnormal shutdown daily record, mobile terminal and server
CN106993303A (en) Configuration and method, device, equipment and the computer-readable storage medium of the intelligent wifi equipment of maintenance
CN109039829A (en) A kind of network card performance testing method, apparatus, terminal and storage medium
CN108287789A (en) Batch-automated test method, device and electronic equipment
CN113553257B (en) Test method, device, storage medium and electronic equipment
CN103559114B (en) Flush bonding module drives function test system and method
CN110162435A (en) A kind of server PXE starting test method, system, terminal and storage medium
CN114064208A (en) Method and device for detecting application service state, electronic equipment and storage medium
CN110262838A (en) A kind of processing method of program crashing, device, terminal and storage medium
CN107644075A (en) The method and apparatus for collecting page info
CN113407393A (en) Chip verification method, terminal device, verification platform and storage medium
CN107656870A (en) Using adjustment method and device
CN109491909A (en) A kind of CPLD refreshes verification method, device, terminal and storage medium
US6807629B1 (en) Apparatus and method for accessing POST 80h codes via a computer port
CN106844206B (en) Method and device for debugging multiple systems in mobile terminal
CN103609193B (en) The method and wireless access network equipment of identification terminal type
CN106841984A (en) The method of testing and device of a kind of Bluetooth intelligent card
CN109167707A (en) A kind of shunting device test macro, method, apparatus, server and storage medium
CN109656804A (en) Automated testing method, equipment, storage medium and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant