TWI664537B - Test case generation system, method and computer program product for generating test cases based on test keywords - Google Patents

Test case generation system, method and computer program product for generating test cases based on test keywords Download PDF

Info

Publication number
TWI664537B
TWI664537B TW104114347A TW104114347A TWI664537B TW I664537 B TWI664537 B TW I664537B TW 104114347 A TW104114347 A TW 104114347A TW 104114347 A TW104114347 A TW 104114347A TW I664537 B TWI664537 B TW I664537B
Authority
TW
Taiwan
Prior art keywords
test
test case
steps
generating
software
Prior art date
Application number
TW104114347A
Other languages
Chinese (zh)
Other versions
TW201640382A (en
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 中華電信股份有限公司
Priority to TW104114347A priority Critical patent/TWI664537B/en
Publication of TW201640382A publication Critical patent/TW201640382A/en
Application granted granted Critical
Publication of TWI664537B publication Critical patent/TWI664537B/en

Links

Abstract

本發明係提供一種依據測試關鍵字產生測試案例之測試案例生成系統、方法及其電腦程式產品。前述之生成系統係分析測試關鍵字以提供對應之複數個測試步驟,並將該等測試步驟作為步驟關聯圖之節點,並再依據該等節點之測試步驟屬性形成一軟體測試案例。據此,藉由本案系統、方法及其電腦程式產品得以免去軟體更動時需透過人工重新撰寫測案例之繁複作業程序。 The invention provides a test case generating system and method for generating a test case according to a test keyword, and a computer program product thereof. The aforementioned generation system analyzes test keywords to provide corresponding plural test steps, and uses the test steps as nodes in the step association graph, and then forms a software test case based on the test step attributes of the nodes. According to this, the system, method and computer program product of this case can avoid the complicated operation procedure of manually rewriting test cases when software changes are needed.

Description

依據測試關鍵字產生測試案例之測試案例生成系統、方法及其電腦程式產品 Test case generation system, method and computer program product for generating test cases based on test keywords

本發明係一種測試案例生成系統、系統、方法及其電腦程式產品,尤指一種依據測試關鍵字產生測試案例之系統、方法及其電腦程式產品。 The invention relates to a test case generating system, system and method, and a computer program product thereof, in particular to a system, method and computer program product for generating a test case according to a test keyword.

在軟體研發、維護的過程,各項設計時常因應需求及環境而變更,而用來檢驗軟體品質的測試案例也必須隨之更改。尤其對於功能複雜的軟體而言,少量的設計變更很有可能影響到後續諸多的測試案例,而需投入高成本重新撰寫測試案例。 In the process of software development and maintenance, various designs are often changed according to requirements and the environment, and the test cases used to verify the quality of the software must also be changed accordingly. Especially for software with complex functions, a small number of design changes are likely to affect many subsequent test cases, and it is necessary to invest in rewriting test cases at a high cost.

為解決前揭之問題,習知技術(US8161459 B2)提出一產生測試案例的方法,該方法利用軟體設計文件中的活動圖(activity diagram)生成多個測試案例,此方法雖可產生一測試案例。但是該方案無法依各個軟體的特性,例如需測試之軟體頁面範圍、被測試之功能、檢查重點等來產生對應之測試案件。因此當軟體測人員需執行特定之測試作業,或微調測試環境時,前揭之習知技術並無法達成所需之功效。 In order to solve the problem of previous disclosure, the conventional technology (US8161459 B2) proposes a method for generating test cases. This method uses activity diagrams in software design files to generate multiple test cases. Although this method can generate a test case . However, this solution cannot generate corresponding test cases based on the characteristics of each software, such as the range of software pages to be tested, the functions being tested, and the focus of inspection. Therefore, when software testers need to perform specific test operations or fine-tune the test environment, the previously known techniques cannot achieve the required effect.

綜上所述,如何提供一種可設定測試的功能及涵蓋範圍,以便測試系統操作流程修改時,使用者只需修改相關的關鍵字轉換、步驟編排規則等即可完成自動生成測試案例之技術手段乃本領域亟需解決之技術 問題。 In summary, how to provide a function and coverage that can be set to test, so that when the test system operation process is modified, the user only needs to modify the relevant keyword conversions, step scheduling rules, etc. to complete the technical means of automatically generating test cases Is a technology that needs to be solved in this field problem.

為解決前揭之問題,本發明之目的係提供一種可自動生成測試案例之系統、方法及其電腦程式產品。 In order to solve the problem of previous disclosure, the object of the present invention is to provide a system, method and computer program product that can automatically generate test cases.

為達上述目的,本發明提出一種依據測試關鍵字產生測試案例之測試案例生成系統。該系統係分析測試關鍵字以提供對應之複數個測試步驟,並將測試步驟作為步驟關聯圖之節點,並再依據節點之測試步驟屬性形成一軟體測試案例。 To achieve the above object, the present invention provides a test case generation system for generating test cases based on test keywords. The system analyzes the test keywords to provide a corresponding plurality of test steps, and uses the test steps as nodes of the step association graph, and then forms a software test case according to the test step attributes of the nodes.

為達上述目的,本發明提出一種依據測試關鍵字產生測試案例之測試案例生成方法。該方法應用於一電腦裝置,並包含下列步驟:首先,分析測試關鍵字以提供對應之複數個測試步驟。接著,依據測試步驟作為步驟關聯圖之節點。再者,依據節點之測試步驟屬性形成一軟體測試案例。 To achieve the above object, the present invention provides a test case generation method for generating a test case based on a test keyword. The method is applied to a computer device and includes the following steps. First, the test keywords are analyzed to provide a corresponding plurality of test steps. Then, use the test steps as the nodes of the step association graph. Furthermore, a software test case is formed according to the test step attributes of the nodes.

為達上述目的,本發明提出一種用於生成測試案例之電腦程式產品,當電腦裝置載入並執行該電腦程式產品,可完成前述方法所述之步驟。 To achieve the above object, the present invention provides a computer program product for generating a test case. When the computer device is loaded and executed by the computer program product, the steps described in the foregoing method can be completed.

綜上所述,本發明之測試案例生成系統、方法及其電腦程式產品可自動的生成測試案件,而得以免去軟體更動時需透過人工重新撰寫測案例之繁複作業程序。 In summary, the test case generating system, method and computer program product of the present invention can automatically generate test cases, thereby avoiding the complicated operation procedure of manually rewriting test cases when software changes are required.

1‧‧‧測試案例生成系統 1‧‧‧test case generation system

11‧‧‧轉換模組 11‧‧‧ Conversion Module

12‧‧‧生成模組 12‧‧‧ Generate Module

13‧‧‧編排模組 13‧‧‧Orchestration module

20‧‧‧關鍵字 20‧‧‧Keyword

21‧‧‧步驟集合 21‧‧‧step collection

22‧‧‧步驟關聯圖 22‧‧‧step correlation diagram

23‧‧‧測試案例 23‧‧‧Test Case

第1圖係為本發明一實施例之測試案例生成系統之系統方塊圖。 FIG. 1 is a system block diagram of a test case generation system according to an embodiment of the present invention.

第2圖係為本發明另一實施例之測試案例生成方法之方法流程圖。 FIG. 2 is a method flowchart of a test case generating method according to another embodiment of the present invention.

第3圖係為本發明實施例之系統流程示意圖。 FIG. 3 is a schematic flowchart of a system according to an embodiment of the present invention.

第4圖係為本發明之步驟關聯圖。 FIG. 4 is a diagram of steps associated with the present invention.

以下將描述具體之實施例以說明本發明之實施態樣,惟其並非用以限制本發明所欲保護之範疇。 The following describes specific embodiments to illustrate the implementation of the present invention, but it is not intended to limit the scope of the present invention.

請參閱第1圖,其為本發明一實施例之測試案例生成系統。前述之測試案例生成系統1係依據測試關鍵字20產生測試案例23。前述之系統係包含相互連接之轉換模組11、生成模組12以及編排模組13。當轉換模組11取得至少一筆關鍵字20後,會分析測試關鍵字20以提供對應之複數個測試步驟。接著生成模組12會將測試步驟作為步驟關聯圖22之節點。而編排模組13會再依據節點之測試步驟屬性形成一軟體測試案例23。前述之轉換模組11、生成模組12以及編排模組13可使用軟體模組實現之。前述之測試案例係定義為軟體操作頁面之流程。 Please refer to FIG. 1, which is a test case generation system according to an embodiment of the present invention. The aforementioned test case generation system 1 generates a test case 23 based on the test keyword 20. The aforementioned system includes a conversion module 11, a generation module 12, and an orchestration module 13 connected to each other. After the conversion module 11 obtains at least one keyword 20, it analyzes the test keyword 20 to provide a corresponding plurality of test steps. The generating module 12 then associates the test steps as the steps in FIG. 22 with the nodes. The orchestration module 13 then forms a software test case 23 according to the test step attributes of the nodes. The aforementioned conversion module 11, generation module 12, and orchestration module 13 can be implemented using software modules. The aforementioned test case is defined as the process of the software operation page.

前述之測試步驟係為「包含測試步驟」,或者是「排除測試步驟」。據此,各節點係標記為包含步驟屬性或排除步驟屬性。而軟體測試案例23之執行路徑僅具有標記為「包含步驟屬性」之節點;換言之,前述之軟體測試案例23之執行路徑係排除標記為「排除步驟屬性」之節點。進一步說明之,前揭之「包含測試步驟」以及「排除測試步驟」之步驟係指軟體測試之步驟,而非本案方法標的之步驟。 The aforementioned test steps are "include test steps" or "exclude test steps". Accordingly, each node is marked as including the step attribute or excluding the step attribute. The execution path of the software test case 23 has only the nodes marked as "include step attributes"; in other words, the execution path of the aforementioned software test case 23 excludes the nodes marked as "exclude step attributes". To further explain, the steps of “including test steps” and “excluding test steps” mentioned before refer to the steps of software testing, not the steps of the method in this case.

請接著參閱第2圖,其為本發明另一實施例之測試案例生成 方法。該方法應用於一電腦裝置,並依據測試關鍵字產生測試案例。該方法主要包含下列步驟: Please refer to FIG. 2, which is a test case generated according to another embodiment of the present invention. method. The method is applied to a computer device, and a test case is generated according to a test keyword. The method mainly includes the following steps:

S101:分析測試關鍵字以提供對應之複數個測試步驟。 S101: Analyze the test keywords to provide a corresponding plurality of test steps.

S102:依據測試步驟作為步驟關聯圖之節點。 S102: Use the test steps as the nodes of the step association graph.

S103:依據節點之測試步驟屬性形成一軟體測試案例。 S103: Form a software test case according to the test step attributes of the node.

本發明於另一實施例更提供用於生成測試案件之電腦程式產品,當電腦裝置載入並執行該電腦程式產品,可完成前述方法所述之步驟。 In another embodiment of the present invention, a computer program product for generating a test case is provided. When a computer device loads and executes the computer program product, the steps described in the foregoing method can be completed.

本案係以電信服務軟體測試說明之,惟其測試之軟體不在此限。請接著參閱第3圖,其為前述實施例之系統流程示意圖。相較於習知之技術無法設定適切的測試內容。本案讓測試人員透過關鍵字20來設定所需測試之軟體頁面範圍、被測試之功能、檢查重點等。而當轉換模組11取得關鍵字20後,會從資料庫中查詢各個關鍵字20所對應之測試步驟(如表1所示),並將測試步驟彙整為一步驟集合21。 This case is explained by telecommunication service software testing, but the software tested is not limited. Please refer to FIG. 3, which is a schematic flowchart of the system of the foregoing embodiment. Compared with the conventional technology, it is impossible to set appropriate test content. This case allows the tester to set the software page range to be tested, the function to be tested, and the focus of the inspection through the keyword 20. After the conversion module 11 obtains the keywords 20, it will query the test steps (as shown in Table 1) corresponding to each keyword 20 from the database, and aggregate the test steps into a step set 21.

前述之「包含測試步驟」為{A1,A2}、{B1,B2,A2}、{B4};而排除測試步驟為{null}、{B3}、{null}。接著,對各個關鍵字20所對應之「包含測試步驟」以及「排除測試步驟」分別取聯集輸出,可得包含測試步驟集合21{A1,A2,B1,B2,B4},以及排除測試步驟集合21{B3} The aforementioned "including test steps" are {A1, A2}, {B1, B2, A2}, {B4}; and the exclusion test steps are {null}, {B3}, {null}. Then, for each keyword 20, the "include test step" and "exclude test step" are respectively output from the union set, and the test step set 21 {A1, A2, B1, B2, B4} is included, and the test step is excluded Collection 21 {B3}

接著,生成模組12存取如表2之預定義步驟關係表,該表左邊欄位為步驟代號,中間欄位為步驟在被測系統中可接續之步驟,右邊欄位為可閱讀之步驟描述。接著依據步驟代號以及可接續之步驟產生如第4圖所示之步驟關聯圖22。 Next, the generating module 12 accesses the predefined step relationship table as shown in Table 2. The left column of the table is the step code, the middle column is the step that the step can be connected to in the system under test, and the right column is the step that can be read. description. Then, according to the step code and the steps that can be connected, the step correlation diagram 22 shown in FIG. 4 is generated.

在完成步驟關聯圖22後,編排模組13依據「包含測試步驟集合21」{A1,A2,B1,B2,B4},以及「排除測試步驟集合21」{B3}來標記步驟關聯圖22內部之節點。接著,編排模組13會移除標記為「排除」之節點(即節點B3),並在該圖中尋找執行路徑。其執行路徑可採用旅行推銷員問題之近似演算法達成之。該演算法之虛擬碼表3所示: After completing the step correlation diagram 22, the orchestration module 13 marks the inside of the step correlation diagram 22 according to "Include test step set 21" {A1, A2, B1, B2, B4} and "Exclude test step set 21" {B3} Node. Then, the orchestration module 13 removes the node marked as "excluded" (ie, node B3), and finds the execution path in the graph. Its execution path can be achieved using an approximate algorithm for the traveling salesman problem. The virtual code table of the algorithm is shown in Table 3:

藉由前述之演算法可生成如下之執行路徑:案例開始→C1→A1→A2→C1→B1→B4→B2→C1→C2→案例結束 Through the aforementioned algorithm, the following execution path can be generated: case start → C1 → A1 → A2 → C1 → B1 → B4 → B2 → C1 → C2 → case end

除此之外,系統更可查詢表2之步驟描述,並輸出如表4所述 之測試案例23說明檔案: In addition, the system can also query the description of the steps in Table 2 and output the test case 23 description file described in Table 4:

在取得軟體測試案例23之執行路徑後,該系統可透過用來進行自動測試之軟體(例如:selenium)載入並該執行路徑,以執行標的軟體之軟體測試。 After obtaining the execution path of the software test case 23, the system can load and execute the execution path through software (for example, selenium) used for automatic testing to execute the software test of the target software.

前述之軟體模組係可藉由ASP、C/C++/C#、Java、Python、PHP、Perl等程式語言實現之,惟其程式語言之類別不在此限。 The aforementioned software modules can be implemented by programming languages such as ASP, C / C ++ / C #, Java, Python, PHP, Perl, but the types of programming languages are not limited to this.

上列詳細說明係針對本發明之一可行實施例之具體說明,惟該實施例並非用以限制本發明之專利範圍,凡未脫離本發明技藝精神所為之等效實施或變更,均應包含於本案之專利範圍中。 The above detailed description is a specific description of a feasible embodiment of the present invention, but this embodiment is not intended to limit the patent scope of the present invention. Any equivalent implementation or change that does not depart from the technical spirit of the present invention should be included in Within the scope of the patent in this case.

Claims (10)

一種依據測試關鍵字產生測試案例之測試案例生成系統,係分析測試關鍵字以提供對應之複數個測試步驟,並將該等測試步驟作為步驟關聯圖之節點,並再依據該等節點之測試步驟屬性及該步驟關聯圖所載資訊尋找執行路徑,進而形成一軟體測試案例。A test case generation system that generates test cases based on test keywords, analyzes test keywords to provide corresponding multiple test steps, and uses these test steps as nodes in the step association graph, and then according to the test steps of these nodes The attribute and the information contained in the step correlation diagram are used to find an execution path, and then a software test case is formed. 如請求項1所述之測試案例生成系統,其中該等測試步驟係為包含測試步驟或排除測試步驟。The test case generation system according to claim 1, wherein the test steps include an inclusive test step or an exclusive test step. 如請求項2所述之測試案例生成系統,其中各該節點係標記為包含步驟屬性或排除步驟屬性。The test case generation system according to claim 2, wherein each node is marked as including a step attribute or excluding a step attribute. 如請求項3所述之測試案例生成系統,其中該軟體測試案例之執行路徑僅具有標記為包含步驟屬性之該節點。The test case generation system as described in claim 3, wherein the execution path of the software test case has only the node marked as containing the step attribute. 如請求項1所述之測試案例生成系統,其中該軟體測試案例之執行路徑係排除標記為排除步驟屬性之該節點。The test case generation system according to claim 1, wherein the execution path of the software test case is to exclude the node marked as an attribute of the exclusion step. 一種依據測試關鍵字產生測試案例之測試案例生成方法,應用於一電腦裝置,包含下列步驟:分析測試關鍵字以提供對應之複數個測試步驟;依據該等測試步驟作為步驟關聯圖之節點;以及依據該等節點之測試步驟屬性及該步驟關聯圖所載資訊尋找執行路徑,進而形成一軟體測試案例。A test case generation method for generating a test case based on a test keyword, which is applied to a computer device and includes the following steps: analyzing the test keyword to provide a corresponding plurality of test steps; and using the test steps as nodes of a step association diagram; and A software test case is formed by finding an execution path according to the test step attributes of the nodes and the information contained in the step correlation diagram. 如請求項6所述之測試案例生成方法,其中該等測試步驟係包含測試步驟或排除測試步驟。The method for generating a test case according to claim 6, wherein the test steps include a test step or an exclusion test step. 如請求項7所述之測試案例生成方法,其中各該節點係標記為包含步驟屬性或排除步驟屬性。The method for generating a test case according to claim 7, wherein each node is marked as including a step attribute or excluding a step attribute. 如請求項8所述之測試案例生成方法,其中該軟體測試案例之執行路徑僅具有標記為該包含步驟屬性之該節點。The method for generating a test case according to claim 8, wherein the execution path of the software test case has only the node marked as the attribute of the containing step. 一種用於生成測試案件之電腦程式產品,當電腦裝置載入並執行該電腦程式產品,可完成如請求項6至9任一項所述之方法。A computer program product for generating a test case. When a computer device loads and executes the computer program product, the method described in any one of claims 6 to 9 can be completed.
TW104114347A 2015-05-06 2015-05-06 Test case generation system, method and computer program product for generating test cases based on test keywords TWI664537B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW104114347A TWI664537B (en) 2015-05-06 2015-05-06 Test case generation system, method and computer program product for generating test cases based on test keywords

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW104114347A TWI664537B (en) 2015-05-06 2015-05-06 Test case generation system, method and computer program product for generating test cases based on test keywords

Publications (2)

Publication Number Publication Date
TW201640382A TW201640382A (en) 2016-11-16
TWI664537B true TWI664537B (en) 2019-07-01

Family

ID=57850677

Family Applications (1)

Application Number Title Priority Date Filing Date
TW104114347A TWI664537B (en) 2015-05-06 2015-05-06 Test case generation system, method and computer program product for generating test cases based on test keywords

Country Status (1)

Country Link
TW (1) TWI664537B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200919248A (en) * 2007-10-23 2009-05-01 Inventec Corp Method and system for processing test diaries
CN100561444C (en) * 2006-11-15 2009-11-18 中兴通讯股份有限公司 A kind of automatic test approach and test macro thereof that drives based on key word
CN100595756C (en) * 2005-10-24 2010-03-24 华为技术有限公司 Navigation method for keyword driving
TW201235960A (en) * 2011-02-24 2012-09-01 Hon Hai Prec Ind Co Ltd System and method for creating a test report
TW201405306A (en) * 2012-07-27 2014-02-01 Hon Hai Prec Ind Co Ltd System and method for automatically generating software test cases
US20150073961A1 (en) * 2013-09-06 2015-03-12 State Street Corporation System and method for interactive visual analytics of multi-dimensional temporal data
CN104536897A (en) * 2015-01-16 2015-04-22 安一恒通(北京)科技有限公司 Automatic testing method and system based on keyword

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100595756C (en) * 2005-10-24 2010-03-24 华为技术有限公司 Navigation method for keyword driving
CN100561444C (en) * 2006-11-15 2009-11-18 中兴通讯股份有限公司 A kind of automatic test approach and test macro thereof that drives based on key word
TW200919248A (en) * 2007-10-23 2009-05-01 Inventec Corp Method and system for processing test diaries
TW201235960A (en) * 2011-02-24 2012-09-01 Hon Hai Prec Ind Co Ltd System and method for creating a test report
TW201405306A (en) * 2012-07-27 2014-02-01 Hon Hai Prec Ind Co Ltd System and method for automatically generating software test cases
US20150073961A1 (en) * 2013-09-06 2015-03-12 State Street Corporation System and method for interactive visual analytics of multi-dimensional temporal data
CN104536897A (en) * 2015-01-16 2015-04-22 安一恒通(北京)科技有限公司 Automatic testing method and system based on keyword

Also Published As

Publication number Publication date
TW201640382A (en) 2016-11-16

Similar Documents

Publication Publication Date Title
US10108536B2 (en) Integrated automated test case generation for safety-critical software
US11507677B2 (en) Image classification modeling while maintaining data privacy compliance
US10318595B2 (en) Analytics based on pipes programming model
US9208451B2 (en) Automatic identification of information useful for generation-based functional verification
JP2019204482A (en) Concurrency vulnerability detection
US20130179863A1 (en) Bug variant detection using program analysis and pattern identification
US8972938B2 (en) Determining functional design/requirements coverage of a computer code
US9612946B2 (en) Using linked data to determine package quality
CN109522228B (en) Interface automation test data construction method, device, platform and storage medium
US9898392B2 (en) Automated test planning using test case relevancy
US20140258954A1 (en) Ranking verification results for root cause analysis
US11513944B1 (en) Ranking tests based on code change and coverage
US10990510B2 (en) Associating attribute seeds of regression test cases with breakpoint value-based fingerprints
US9600347B2 (en) Verifying synchronization coverage in logic code
US10037264B2 (en) Test suite minimization
WO2018092237A1 (en) Program code generation apparatus, program code generation method, and program code generation program
US20160239407A1 (en) Small scale integration test generation
US11663113B2 (en) Real time fault localization using combinatorial test design techniques and test case priority selection
CN109800147B (en) Test case generation method and terminal equipment
TWI664537B (en) Test case generation system, method and computer program product for generating test cases based on test keywords
US10528691B1 (en) Method and system for automated selection of a subset of plurality of validation tests
Lavoie et al. A case study of TTCN-3 test scripts clone analysis in an industrial telecommunication setting
US20130111449A1 (en) Static analysis with input reduction
CN110297625B (en) Application processing method and device
JP2017224185A (en) Bug contamination probability calculation program and bug contamination probability calculation method

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees