CN103942140A - Automatic testing program conversion method - Google Patents

Automatic testing program conversion method Download PDF

Info

Publication number
CN103942140A
CN103942140A CN201310702911.4A CN201310702911A CN103942140A CN 103942140 A CN103942140 A CN 103942140A CN 201310702911 A CN201310702911 A CN 201310702911A CN 103942140 A CN103942140 A CN 103942140A
Authority
CN
China
Prior art keywords
test
automatic switching
switching method
test procedure
procedure automatic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310702911.4A
Other languages
Chinese (zh)
Inventor
兰积钱
夏高明
薛郝
汤挺
周明珠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JIANGSU RUITIAN INFORMATION TECHNOLOGY Co Ltd
Original Assignee
JIANGSU RUITIAN 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 JIANGSU RUITIAN INFORMATION TECHNOLOGY Co Ltd filed Critical JIANGSU RUITIAN INFORMATION TECHNOLOGY Co Ltd
Priority to CN201310702911.4A priority Critical patent/CN103942140A/en
Publication of CN103942140A publication Critical patent/CN103942140A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an automatic testing program conversion method. The automatic testing program conversion method is characterized by comprising the following steps of grammar defining, 2 semantic analyzing and 3 target script generating. According to the automatic testing program conversion method, the technology that a test case and a target script are separated and one time of test case compiling corresponds to a plurality of target scripts is used, the process from test case generation to target code generation only takes several seconds, later target code maintenance is also extremely simple and only the test case needs to be corrected for conversion again.

Description

A kind of test procedure automatic switching method
Technical field
The present invention relates to a kind of test procedure automatic switching method, be specifically related to a kind of test case of tester being utilized to familiar carrier and write by simple, certain rule and automatically convert the method for the executable script file of target machine to, the invention belongs to software verification field tests.
Background technology
Along with the expansion of software size, in software development, occur that the chance of mistake or defect is more and more, market strengthens gradually to the understanding of software quality importance.The importance of software test in software project implementation process becomes increasingly conspicuous, automatic test is as in software test important one, requirement to tester also increases, and except using automated test tool, also needs to be familiar with different scripts.
Script file compiling procedure is that the script of concrete test case transforms.The automatic test personnel that begin to learn all can use the process of script to amendment script of recording.But specialized suggestion is to be recorded as reference, taking compile script as main behavior, to avoid recording the redundancy that script brings, the problem such as non-adjustable use, the debugging complexity of script of common elements.
The preparation request tester of automatized script file has certain target script development ability, in a common test team, only has 1 to 2, and write task for larger test case, need most of tester to participate in, due to tester's level or custom difference caused some test script file of low quality, even hide mistake, affected the judgement of test result.
Summary of the invention
For solving the deficiencies in the prior art, the object of the present invention is to provide a kind of test procedure automatic switching method.
In order to realize above-mentioned target, the present invention adopts following technical scheme:
A kind of test procedure automatic switching method, is characterized in that, comprises the steps:
Step 1: definition grammer;
Step 2: semanteme is analyzed;
Step 3: generate target script.
Aforesaid a kind of test procedure automatic switching method, is characterized in that, described step 1 comprises:
Step 1a: the feature of analyzing system under test (SUT);
Step 1b: according to syntax rule definition statement.
Aforesaid a kind of test procedure automatic switching method, is characterized in that, the feature of described system under test (SUT) comprises system under test (SUT) environment of living in, the element in system under test (SUT), the attribute in system under test (SUT), the method for operating of system under test (SUT).
Aforesaid a kind of test procedure automatic switching method, is characterized in that, described statement comprises object, attribute, method of operating, operating parameter.
Aforesaid a kind of test procedure automatic switching method, is characterized in that, described step 2 comprises:
Step 2a: utilize described statement to write test case;
Step 2b: test case is imported, and according to the regular generative semantics tree having defined.
Aforesaid a kind of test procedure automatic switching method, is characterized in that, described step 2b comprises:
Step 2b1: order read test use-case file, this process is called different fetch interface functions because test case file type is different;
Step 2b2: the analysis subprocess different according to current syntactic type Selection and call, can disposable analysis complete for simple syntax rule, directly enter step 2b3; The syntax rule completing for non-once, call stack is stored temporarily, is only obtaining after the complement mark of current syntax rule, just carries out step 2b3;
Step 2b3: the result that step 2b2 is obtained is added in overall semantic tree.
Aforesaid a kind of test procedure automatic switching method, is characterized in that, the result that described step 2b2 obtains i.e. a tree node order.
Aforesaid a kind of test procedure automatic switching method, is characterized in that, described step 3 comprises: according to the selected target script of user, the semantic tree that step 2b3 is obtained converts target scripted code to, and spanned file.
Aforesaid a kind of test procedure automatic switching method, is characterized in that, described target script is Python, Perl or TK/Tcl.
Aforesaid a kind of test procedure automatic switching method, is characterized in that, step 3 comprises: targeted code storehouse, the full content in code library covering grammar definition rule, the corresponding executable code piece of each point in syntax rule; Develop public setup code storehouse and connect system under test (SUT).
Usefulness of the present invention is: the technology that use test use-case of the present invention is write corresponding multiple target scripts with the separation of target script, a test case, generation from test case to object code only needs several seconds, the maintenance of later stage object code is also very simple, only needs amendment test case again to change.
Brief description of the drawings
Fig. 1 is the process flow diagram of a kind of test procedure automatic switching method of the present invention;
Fig. 2 is semantic tree generative process figure in a kind of test procedure automatic switching method of the present invention;
Fig. 3 is semantic tree storage map in a kind of test procedure automatic switching method of the present invention;
Fig. 4 is the automatic flow path switch figure of a kind of test procedure automatic switching method Program of the present invention.
Embodiment
Below in conjunction with the drawings and specific embodiments, the present invention is done to concrete introduction.
Shown in Fig. 1, a kind of test procedure automatic switching method of the present invention, need to be divided into 4 steps: definition grammer, semanteme is analyzed to generation script code.
Part I: definition grammer.
First to analyze the feature of system under test (SUT), under what environment, have what element, have which attribute, have which method, according to some statements of certain rule definition.A complete statement generally includes: object, attribute, method of operating, operating parameter etc.For example:
Set Objective " Test PosX of Sys1 "; // test target is set herein, be shown to user for test process;
Set Sys1.PosX 1000; // value that the attribute PosX of system Sys1 is set is herein 1000;
Load APP1; // this statement starts application A PP1
Get Sys1.PosX Temp // obtain the value of the attribute PosX of system Sys1 herein, and store temporary variable Temp into;
When some operation meeting is often used, we just can write a public functional blocks, to facilitate calling of other use-case.
Syntax rule is limited, but extendible, is not limited to object code requirement.
Part II: semanteme is analyzed.
After syntax rule has defined, just can carry out having write of test case, test case can be kept at Txt file, XML file, Excel file etc.
Write test case when user utilizes the statement that Part I defines, just test case can have been imported, and according to the regular generative semantics tree having defined.Fig. 2 is semantic tree generative process figure in a kind of test procedure automatic switching method of the present invention; Fig. 3 is semantic tree storage map in a kind of test procedure automatic switching method of the present invention; Whole importing process mainly contains following step:
Step 1: order read test use-case file, this process is called different fetch interface functions because test case file type is different;
Step 2: the analysis subprocess different according to current syntactic type Selection and call, can disposable analysis complete for simple syntax rule, directly enter step 3; The syntax rule completing for non-once needs call stack to store temporarily, is only obtaining, after the complement mark of current syntax rule, just carry out step 3, and this process relates to nested problem, and therefore Output rusults may be also the tree of a multi-layer;
Step 3: the result that step 2 is obtained an i.e. tree node order is added in overall semantic tree.
Semantic analysis has realized the transformation from file data to internal storage data, and in the mode of sequential storage in multiway tree.
Perform statement frame represents one or more other basic function point, support in theory 3 layers above nested.
Part III: generate target script.
According to the selected target script of user, as Python, Perl, TK/Tcl etc., the semantic tree that Part II is obtained converts target scripted code to, and spanned file.Need targeted code storehouse in advance herein, the full content of code library in should covering grammar definition rule, each point in syntax rule is a corresponding executable code piece.And for realizing user interface content, also need to develop some public setup code storehouses and connect system under test (SUT).Whole process is illustrated in fig. 4 shown below.
Thus, what time following the present invention realized: 1. with predefine, limited, extendible Rule Expression automatic test program; 2. preserve automatic test routine data with the form of multiway tree, supporting multi-layer nested 3. automatically to generate final executable object code according to the object code of selecting is that automatic test script file 4. target script files can be expanded, convenient transplanting, and need not again write test case.
The technology that use test use-case of the present invention is write corresponding multiple target scripts with the separation of target script, a test case, generation from test case to object code only needs several seconds, the maintenance of later stage object code is also very simple, only needs amendment test case again to change.
Use of the present invention, makes common test personnel also can write automatic test cases, and professional development of automation personnel are responsible for writing object code storehouse.Thereby accelerate writing and safeguarding of automatic test cases, shorten the test case construction cycle, promoted efficiency, saved cost.
More than show and described ultimate principle of the present invention, principal character and advantage.The technician of the industry should understand, and above-described embodiment does not limit the present invention in any form, and all employings are equal to replaces or technical scheme that the mode of equivalent transformation obtains, all drops in protection scope of the present invention.

Claims (10)

1. a test procedure automatic switching method, is characterized in that, comprises the steps:
Step 1: definition grammer;
Step 2: semanteme is analyzed;
Step 3: generate target script.
2. a kind of test procedure automatic switching method according to claim 1, is characterized in that, described step 1 comprises:
Step 1a: the feature of analyzing system under test (SUT);
Step 1b: according to syntax rule definition statement.
3. a kind of test procedure automatic switching method according to claim 2, is characterized in that, the feature of described system under test (SUT) comprises system under test (SUT) environment of living in, the element in system under test (SUT), the attribute in system under test (SUT), the method for operating of system under test (SUT).
4. a kind of test procedure automatic switching method according to claim 3, is characterized in that, described statement comprises object, attribute, method of operating, operating parameter.
5. a kind of test procedure automatic switching method according to claim 1, is characterized in that, described step 2 comprises:
Step 2a: utilize described statement to write test case;
Step 2b: test case is imported, and according to the regular generative semantics tree having defined.
6. a kind of test procedure automatic switching method according to claim 5, is characterized in that, described step 2b comprises:
Step 2b1: order read test use-case file, this process is called different fetch interface functions because test case file type is different;
Step 2b2: the analysis subprocess different according to current syntactic type Selection and call, can disposable analysis complete for simple syntax rule, directly enter step 2b3; The syntax rule completing for non-once, call stack is stored temporarily, is only obtaining after the complement mark of current syntax rule, just carries out step 2b3;
Step 2b3: the result that step 2b2 is obtained is added in overall semantic tree.
7. a kind of test procedure automatic switching method according to claim 6, is characterized in that, the result that described step 2b2 obtains i.e. a tree node order.
8. according to a kind of test procedure automatic switching method described in claim 1 to 7 any one, it is characterized in that, described step 3 comprises: according to the selected target script of user, the semantic tree that step 2b3 is obtained converts target scripted code to, and spanned file.
9. a kind of test procedure automatic switching method according to claim 8, is characterized in that, described target script is Python, Perl or TK/Tcl.
10. a kind of test procedure automatic switching method according to claim 9, it is characterized in that, step 3 comprises: targeted code storehouse, the full content in code library covering grammar definition rule, the corresponding executable code piece of each point in syntax rule; Develop public setup code storehouse and connect system under test (SUT).
CN201310702911.4A 2013-12-19 2013-12-19 Automatic testing program conversion method Pending CN103942140A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310702911.4A CN103942140A (en) 2013-12-19 2013-12-19 Automatic testing program conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310702911.4A CN103942140A (en) 2013-12-19 2013-12-19 Automatic testing program conversion method

Publications (1)

Publication Number Publication Date
CN103942140A true CN103942140A (en) 2014-07-23

Family

ID=51189813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310702911.4A Pending CN103942140A (en) 2013-12-19 2013-12-19 Automatic testing program conversion method

Country Status (1)

Country Link
CN (1) CN103942140A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104391793A (en) * 2014-11-27 2015-03-04 中国联合网络通信集团有限公司 Generation method and device of test steps and scripts
CN108958726A (en) * 2017-05-19 2018-12-07 北京京东尚科信息技术有限公司 A kind of method and apparatus of data mining
CN109074254A (en) * 2016-03-30 2018-12-21 日立社会信息服务有限公司 Program source conversion method, program supply changeover device, information processing unit, information processing method and program
CN111651157A (en) * 2020-07-13 2020-09-11 太仓市同维电子有限公司 Python-based PoE instrument packaging method
CN111694738A (en) * 2020-06-04 2020-09-22 贵州易鲸捷信息技术有限公司 Method for generating SQL test script
CN112667494A (en) * 2020-12-08 2021-04-16 上海纳恩汽车技术股份有限公司 Automobile UDS automatic testing method and system based on configuration table and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436128A (en) * 2007-11-16 2009-05-20 北京邮电大学 Software test case automatic generating method and system
US20100058300A1 (en) * 2008-08-26 2010-03-04 International Business Machines Corporation Test coverage analysis method and apparatus
CN102541730A (en) * 2011-12-08 2012-07-04 北京空间飞行器总体设计部 Semantic identification and automatic generation method for spacecraft test script

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101436128A (en) * 2007-11-16 2009-05-20 北京邮电大学 Software test case automatic generating method and system
US20100058300A1 (en) * 2008-08-26 2010-03-04 International Business Machines Corporation Test coverage analysis method and apparatus
CN102541730A (en) * 2011-12-08 2012-07-04 北京空间飞行器总体设计部 Semantic identification and automatic generation method for spacecraft test script

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104391793A (en) * 2014-11-27 2015-03-04 中国联合网络通信集团有限公司 Generation method and device of test steps and scripts
CN104391793B (en) * 2014-11-27 2017-07-14 中国联合网络通信集团有限公司 Testing procedure and test script generation method and device
CN109074254A (en) * 2016-03-30 2018-12-21 日立社会信息服务有限公司 Program source conversion method, program supply changeover device, information processing unit, information processing method and program
CN109074254B (en) * 2016-03-30 2021-12-24 日立社会信息服务有限公司 Program source conversion method and program source conversion device
CN108958726A (en) * 2017-05-19 2018-12-07 北京京东尚科信息技术有限公司 A kind of method and apparatus of data mining
CN108958726B (en) * 2017-05-19 2022-01-28 北京京东尚科信息技术有限公司 Data development method and device
CN111694738A (en) * 2020-06-04 2020-09-22 贵州易鲸捷信息技术有限公司 Method for generating SQL test script
CN111651157A (en) * 2020-07-13 2020-09-11 太仓市同维电子有限公司 Python-based PoE instrument packaging method
CN111651157B (en) * 2020-07-13 2024-02-27 太仓市同维电子有限公司 PoE instrument packaging method based on Python
CN112667494A (en) * 2020-12-08 2021-04-16 上海纳恩汽车技术股份有限公司 Automobile UDS automatic testing method and system based on configuration table and storage medium

Similar Documents

Publication Publication Date Title
CN103942140A (en) Automatic testing program conversion method
CN103412820B (en) The method of testing of the page in Web system and device
CN100401265C (en) Keyword-driven automatic testing system and method
US10354031B2 (en) Information processing by interpenetrating signal transmission channel in design for testability of chip
CN110737594B (en) Database standard conformance testing method and device for automatically generating test cases
CN106293664A (en) Code generating method and device
CN104598274A (en) Automatic instrumentation, compiling and installing method and system
CN110471652B (en) Task arrangement method, task arranger, task arrangement device and readable storage medium
US9098630B2 (en) Data selection
CN105893254A (en) Test case input method and device
CN110109897A (en) Database script generation method, device, computer equipment and storage medium
CN102306122A (en) Automated testing method and equipment
CN111506314B (en) Project development method, device, server and medium
CN110046091B (en) Automatic test method and device
CN110543427B (en) Test case storage method and device, electronic equipment and storage medium
CN103186463B (en) Determine the method and system of the test specification of software
CN104750606A (en) Reflection-based automated testing method
US20120259611A1 (en) System and method for generation of cim-based power system circuit models
CN116610568A (en) Method, device, equipment and medium for identifying dependency relationship of codes
CN116629172A (en) Method, device, equipment and medium for automatically generating and integrating modules in chip design
US11099978B2 (en) Modeling system for software-implemented testing using domain specific profiles to translate tests for a subset of paths included in a UML test model
CN108897678B (en) Static code detection method, static code detection system and storage device
CN105159746B (en) Reliablility simulation tool towards fault-tolerant combination web services
US20090064092A1 (en) Visual programming language optimization
CN113672509A (en) Automatic testing method, device, testing platform and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140723