WO2017162058A1 - Procédé et dispositif de test de logiciel - Google Patents

Procédé et dispositif de test de logiciel Download PDF

Info

Publication number
WO2017162058A1
WO2017162058A1 PCT/CN2017/076399 CN2017076399W WO2017162058A1 WO 2017162058 A1 WO2017162058 A1 WO 2017162058A1 CN 2017076399 W CN2017076399 W CN 2017076399W WO 2017162058 A1 WO2017162058 A1 WO 2017162058A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
program
target program
test point
software testing
Prior art date
Application number
PCT/CN2017/076399
Other languages
English (en)
Chinese (zh)
Inventor
刘俊峰
姚文辉
张海勇
朱家稷
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2017162058A1 publication Critical patent/WO2017162058A1/fr

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
    • 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

Definitions

  • the present invention relates to computer technology, and in particular, to a software testing method and apparatus.
  • Software testing is a necessary link before the software runs online. Different software application environments can be tested by different software testing methods to ensure the running stability of the software running online.
  • the Failover test is a test method for testing software for processing and recovering. At present, when the software fails the recovery test, the test code is pre-written in the program code of the tested software, so that the test is compiled.
  • the test software needs to perform simulated abnormal exit scenarios under various paths, which is commonly referred to as simulated abnormal paths, and therefore, existing Every time an error path is tested in the technology, the programmer needs to update the code and recompile, which is less efficient.
  • the present invention provides a software testing method and apparatus for solving the technical problem of low efficiency of failure recovery testing in the prior art.
  • a software testing method comprising:
  • test program corresponding to the test point is called to test the target program.
  • a software testing apparatus comprising:
  • the software testing method and device provided by the embodiment of the present invention, by setting a test point in the target program in advance, in the process of executing the target program, executing the test program corresponding to the test point to the target after setting the position of the test point The program is tested.
  • the process of recompilation improves the efficiency of the test.
  • FIG. 1 is a schematic flowchart of a software testing method according to Embodiment 1 of the present invention.
  • FIG. 2 is a schematic flowchart of a software testing method according to Embodiment 2 of the present invention.
  • FIG. 3 is a schematic structural diagram of a software testing apparatus according to Embodiment 3 of the present invention.
  • FIG. 4 is a schematic structural diagram of a software testing apparatus according to Embodiment 4 of the present invention.
  • FIG. 1 is a schematic flowchart of a software testing method according to Embodiment 1 of the present invention. As shown in FIG. 1, the method includes:
  • Step 101 Execute a target program.
  • test points When writing the target program code, test points have been preset in the target program.
  • the content of the test point includes the test point identifier, such as the test point name, and the test point may also include a macro and a custom code, wherein the macro is used to indicate the execution order of the custom code and the calling test program.
  • test procedures usually use execution methods, events
  • the fixed format of content and event types is described, so in order to increase the flexibility of testing, the user can write a piece of custom code for testing in the test point before writing the target program code.
  • each test point in the target program can be set to the closed state, and then the target program is compiled, so that the target program is not affected by the test point, and the integrity and relative of the target program are guaranteed.
  • the client sends a Remote Procedure Call Protocol (RCP) request as a request for setting the open/close state, and the server sets the test point in the target program to be turned on or off according to the RCP request.
  • RCP Remote Procedure Call Protocol
  • Step 102 When executing a test point preset in the target program, calling the test program corresponding to the test point to test the target program.
  • test program is invoked to perform a failure recovery test on the target program.
  • test program is called to test the execution time of the target program.
  • the test program marked by the test point identifier may be queried in the container for recording the test program according to the test point identifier in the test point, according to the execution manner indicated by the test program, The content of the event and/or the type of event, the failure recovery test of the target program.
  • the execution mode may be a single execution, multiple executions, random execution, and the like;
  • the event type may be a delay, a return error code, an exception thrown, and a termination process, and the event content may be a specific time of the delay.
  • test points and when executing to the test point, the test program corresponding to the test point is called to test the target program to simulate various scenarios.
  • the target program and the test program are independent of each other, when the test program needs to be modified, there is no need to recompile the target program, which improves the efficiency of the test and the convenience of the test.
  • the solution in this embodiment is applied to a distributed system, since the distributed system is deployed with a high degree of complexity, the advantage of modifying the code and compiling the target program running in the distributed system is reflected. More fully.
  • Embodiment 2 is a schematic flowchart of a software testing method according to Embodiment 2 of the present invention. To clear the execution flow when the client performs a modification to the server-side test program, this embodiment provides a specific Schematic diagram of the process.
  • the method provided in this embodiment is executed by a server and a client, wherein the server is used to run the target program, and a server (Map) storing the test program is set on the server.
  • the client can update the test program in the Map through the RCP request.
  • test points are inserted in the required test locations within the target program, for example, to eliminate the bug point.
  • the debug point can be designed in a singleton mode.
  • the location of the debug point needs to be added, and the name of a debug point is declared, for example: DECLARE_DBG_POINT(New_DebugPiontName), where New_DebugPiontName is the name of the debug point. .
  • DECLARE_DBG_POINT New_DebugPiontName
  • New_DebugPiontName is the name of the debug point.
  • DBG_POINT_PRE_EXEC New_DebugPiontName, code
  • DBG_POINT_PRE_EXEC is a macro, this macro indicates that the custom code is executed before executing the test program corresponding to the debug point.
  • Different macros can specify a custom code to be executed before execution or after executing the test program at the debug point. Since this part of the custom code is located in the target program and therefore cannot be modified by the client, it needs to be determined when writing the code of the target program.
  • the test program corresponding to each test point is stored in the Map, and the test program includes the execution mode (Point Type), the event content (Action), and the event type (Action Type) of each debug point.
  • the execution mode may be a single execution, multiple executions, random execution, and the like;
  • the event type may be a delay, a return error code, an exception thrown, and a termination process, and the event content may be a specific time of the delay.
  • the software testing methods include:
  • Step 201 The client sends an RCP request.
  • the RPC request carries the name of the debug point, and the execution mode, event content, and event type of the test program corresponding to the debug point.
  • Step 202 The server end updates the test program according to the RCP request.
  • the server side modifies the execution mode, the event content, and the event type in the test program corresponding to the debug point in the Map container to the execution mode, the event content, and the event type in the RCP request.
  • Step 203 When the server runs the target program to the test point location, query the test program corresponding to the test point.
  • the server side executes the test point to DBG_POINT_PRE_EXEC(New_DebugPiontName, code)
  • the server first executes the custom code code, and then calls the singleton method of the debug point to query the Map container for events that need to be executed. Including event content and event type, as well as event execution Line mode.
  • Step 204 Determine whether the event type in the test program is a delay. If yes, execute step 205; otherwise, perform step 206.
  • Step 205 Determine an execution time according to a delay time remaining in the test program whose delay time has not ended and a delay time indicated in the current test program, and perform delay according to the determined execution time.
  • the delay type event Before executing the delay type event, it is necessary to query the debug point that has been executed before the debug point, whether there is a debug point whose event type is delayed, and the delay time does not end. If it does not exist, execute the event. If it exists, The difference between the delay time of the unfinished debug point and the delay time of the current event is used as the delay time for the event to be executed. When the delay time for the event to be executed is a positive number, the calculated delay is performed according to the calculated delay. Time to execute the delay event.
  • the actual delay time is the delay time of the previous debug point.
  • Step 206 Perform a test procedure corresponding to the test point.
  • the test is performed directly according to the contents of the test program, that is, the execution mode, event content, and event type indicated by the test program are executed.
  • the test program corresponding to the test point is called after the position where the test point is set, and the target program is tested.
  • FIG. 3 is a schematic structural diagram of a software testing apparatus according to Embodiment 3 of the present invention. As shown in FIG. 3, the method includes: an executing module 31 and a calling module 32.
  • the execution module 31 is configured to execute a target program.
  • the calling module 32 is configured to, when executing a test point preset to the target program, invoke a test program corresponding to the test point to test the target program.
  • test points can include: test point identification, macros and custom code.
  • the calling module 32 is specifically configured to invoke the test program to perform a failure recovery test on the target program.
  • the test program corresponding to the test point is called after the position where the test point is set, and the target program is tested.
  • the calling module 32 further includes: a query unit 321 and a testing unit. 322.
  • the query unit 321 is configured to query the test program marked by the test point identifier in a container for recording a test program according to the test point identifier in the test point.
  • the testing unit 322 is configured to perform a failure recovery test on the target program according to the execution manner, the event content, and/or the event type indicated by the test program.
  • testing unit 322 includes a query sub-unit 3221, a computing sub-unit 3222, and an executing sub-unit 3223.
  • the query subunit 3221 is configured to query, in the test program that has been executed, whether the test program has a delay time that is not completed when the event type of the test program is delayed.
  • the calculation sub-unit 3222 is configured to determine, if present, an actual delay time of the test program based on a remaining delay time of the test program whose delay time has not ended, and a delay time indicated by an event content of the test program.
  • the executing subunit 3223 is configured to delay the target program according to the actual delay time of the test program.
  • the software testing device further includes: a customization module 33, a receiving module 34, an updating module 35, a compiling module 36, a status receiving module 37, a setting module 38, and a confirming module 39.
  • a custom module 33 configured to execute the custom code and the test program according to the macro in the test point In order, execute the custom code.
  • the receiving module 34 is configured to receive an update request.
  • the update request includes a test point identifier, and an execution manner, event content, and/or event type.
  • the updating module 35 is configured to update the test program indicated by the update request according to the update request.
  • the update module 35 is specifically configured to update the execution mode, the event content, and/or the event type in the test program corresponding to the test point identifier in the update request, and update the execution manner, the event content, and the event content in the update request. / or event type.
  • the compiling module 36 is configured to compile the target program after setting each test point in the target program to a closed state.
  • the status receiving module 37 is configured to receive a request for setting an open/close state.
  • the setting module 38 is configured to set the test point in the target program to an open state or a closed state according to the request for setting an open/close state.
  • the confirmation module 39 is configured to confirm that the test point is in an open state before calling the test program corresponding to the test point to test the target program.
  • the device provided in this embodiment is specifically used to perform the method shown in FIG. 1 and FIG. 2 .
  • the specific implementation method of each function module refer to the related description in the corresponding embodiment, which is not repeatedly described in this embodiment.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

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

L'invention concerne un procédé et un dispositif de test de logiciel. Le procédé consiste à appeler, par préréglage d'un point de test dans un programme cible, au cours du processus d'exécution du programme cible (101), lorsque l'exécution progresse vers le point de test présélectionné dans le programme cible, un programme de test correspondant au point de test pour tester le programme cible (102). Quand différents chemins exceptionnels doivent être simulés, il est inutile de modifier le code d'un programme cible, seul un programme de test doit être mis à jour, ce qui permet d'éviter le processus de recompilation du programme cible provoqué par la modification du code du programme cible, et d'améliorer l'efficacité du test.
PCT/CN2017/076399 2016-03-23 2017-03-13 Procédé et dispositif de test de logiciel WO2017162058A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610168942.XA CN107229558B (zh) 2016-03-23 2016-03-23 软件测试方法和装置
CN201610168942.X 2016-03-23

Publications (1)

Publication Number Publication Date
WO2017162058A1 true WO2017162058A1 (fr) 2017-09-28

Family

ID=59899200

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/076399 WO2017162058A1 (fr) 2016-03-23 2017-03-13 Procédé et dispositif de test de logiciel

Country Status (3)

Country Link
CN (1) CN107229558B (fr)
TW (1) TW201734791A (fr)
WO (1) WO2017162058A1 (fr)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256331A (zh) * 2018-01-04 2018-07-06 郑州云海信息技术有限公司 一种服务器bmc安全方案的测试方法
US10248554B2 (en) 2016-11-14 2019-04-02 International Business Machines Corporation Embedding profile tests into profile driven feedback generated binaries
CN112069083A (zh) * 2020-11-12 2020-12-11 深圳开源互联网安全技术有限公司 一种测试用例的设计方法、装置及存储介质
US10929117B2 (en) 2018-02-08 2021-02-23 Red Hat, Inc. Container image building using shared resources

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI682295B (zh) 2018-11-05 2020-01-11 財團法人資訊工業策進會 測試資料產生裝置及測試資料產生方法
CN111143229A (zh) * 2019-12-31 2020-05-12 中国银行股份有限公司 软件测试方法及装置、计算机设备及计算机可读存储介质
CN113568796A (zh) * 2021-08-04 2021-10-29 上海肇观电子科技有限公司 模块测试方法和装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183335A (zh) * 2007-12-25 2008-05-21 中兴通讯股份有限公司 一种实现嵌入式软件异常测试的方法及***
CN103761184A (zh) * 2013-12-31 2014-04-30 华为技术有限公司 程序的代码段测试方法、装置和***
CN104834590A (zh) * 2014-02-11 2015-08-12 腾讯科技(深圳)有限公司 软件测试方法和***
CN105224466A (zh) * 2015-11-17 2016-01-06 广州亦云信息技术有限公司 一种基于Docker的集成测试方法及***
WO2016001982A1 (fr) * 2014-06-30 2016-01-07 株式会社 日立製作所 Dispositif d'aide à la génération de données de test et procédé d'aide à la génération de données de test

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095087A (zh) * 2015-08-31 2015-11-25 武汉启明联创信息科技有限公司 一种基于权限操作的软件测试***和方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183335A (zh) * 2007-12-25 2008-05-21 中兴通讯股份有限公司 一种实现嵌入式软件异常测试的方法及***
CN103761184A (zh) * 2013-12-31 2014-04-30 华为技术有限公司 程序的代码段测试方法、装置和***
CN104834590A (zh) * 2014-02-11 2015-08-12 腾讯科技(深圳)有限公司 软件测试方法和***
WO2016001982A1 (fr) * 2014-06-30 2016-01-07 株式会社 日立製作所 Dispositif d'aide à la génération de données de test et procédé d'aide à la génération de données de test
CN105224466A (zh) * 2015-11-17 2016-01-06 广州亦云信息技术有限公司 一种基于Docker的集成测试方法及***

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10248554B2 (en) 2016-11-14 2019-04-02 International Business Machines Corporation Embedding profile tests into profile driven feedback generated binaries
CN108256331A (zh) * 2018-01-04 2018-07-06 郑州云海信息技术有限公司 一种服务器bmc安全方案的测试方法
US10929117B2 (en) 2018-02-08 2021-02-23 Red Hat, Inc. Container image building using shared resources
US11599348B2 (en) 2018-02-08 2023-03-07 Red Hat, Inc. Container image building using shared resources
CN112069083A (zh) * 2020-11-12 2020-12-11 深圳开源互联网安全技术有限公司 一种测试用例的设计方法、装置及存储介质

Also Published As

Publication number Publication date
CN107229558B (zh) 2020-10-16
CN107229558A (zh) 2017-10-03
TW201734791A (zh) 2017-10-01

Similar Documents

Publication Publication Date Title
WO2017162058A1 (fr) Procédé et dispositif de test de logiciel
CN108509336B (zh) 一种操作***规范形式化验证与测试方法
WO2020140820A1 (fr) Procédé de test de logiciel, système, appareil, dispositif, support et produit de programme informatique
US11748245B2 (en) Object-oriented regression-candidate filter
KR102166753B1 (ko) 자동화된 반도체 디바이스 테스트를 위한 테스트 계획을 컴파일하기 위해 사용되는 개발 환경 내에 편집 및 갱신 기능 구현
Liao et al. Toward a service platform for developing smart contracts on blockchain in bdd and tdd styles
US8893090B2 (en) Stepping out of an asynchronous method into its continuation in a debugger
US20190073292A1 (en) State machine software tester
JP6726140B2 (ja) 技術的システムのオペレーティングソフトウェアの変更およびシミュレーション
US9389989B2 (en) Self verifying device driver for multi-version compatible data manipulation devices
CN106897090B (zh) 一种嵌入式设备程序升级方法及***
CN108228190B (zh) 持续集成和交付方法、***、设备及计算机可读存储介质
US20060036910A1 (en) Automated testing framework for event-driven systems
US9317254B1 (en) Fault tolerance model, methods, and apparatuses and their validation techniques
US20070283327A1 (en) Hierarchical test verification using an extendable interface
CN108701057B (zh) 用于供应部署管道的计算机可读存储介质、***和方法
Gotovos et al. Test-driven development of concurrent programs using concuerror
CN107179982B (zh) 一种跨进程调试方法和装置
US20040122928A1 (en) Method and system for managing application server lifecycle
CN113742215A (zh) 一种自动配置和调用测试工具进行测试分析的方法及***
US7685472B1 (en) Method and apparatus for testing object-oriented-programming methods
JP7015625B2 (ja) プロセスアプリケーションを開発及び診断するためのステップバック機構
US5692122A (en) Generation of random conversation testcases
CN109947645A (zh) 自动化配置工具方法及***
WO2022222626A1 (fr) Procédé et appareil d'acquisition de code source incrémental, dispositif électronique et support de stockage

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17769335

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17769335

Country of ref document: EP

Kind code of ref document: A1