CN106445818B - A kind of automatized script adjustment method and device based on model-driven - Google Patents

A kind of automatized script adjustment method and device based on model-driven Download PDF

Info

Publication number
CN106445818B
CN106445818B CN201610820867.0A CN201610820867A CN106445818B CN 106445818 B CN106445818 B CN 106445818B CN 201610820867 A CN201610820867 A CN 201610820867A CN 106445818 B CN106445818 B CN 106445818B
Authority
CN
China
Prior art keywords
script
mbt
model
unit
driven
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610820867.0A
Other languages
Chinese (zh)
Other versions
CN106445818A (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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201610820867.0A priority Critical patent/CN106445818B/en
Publication of CN106445818A publication Critical patent/CN106445818A/en
Application granted granted Critical
Publication of CN106445818B publication Critical patent/CN106445818B/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

Abstract

This application discloses a kind of automatized script adjustment method and device based on model-driven, wherein this method comprises: using MBT pel, generate service logic;Generate automatized script;Script debugging plug-in unit is embedded into MBT modeling tool;Modified sentence in the script is selected, on the basis of the sentence and environment executed retains in the buffer, directly executes the modified sentence.Above-mentioned automatized script adjustment method and device based on model-driven provided by the present application, can shorten the runing time of script and test suite, to reduce the debug time entirely automated.

Description

A kind of automatized script adjustment method and device based on model-driven
Technical field
The invention belongs to software automated testing technical fields, more particularly to a kind of automation foot based on model-driven This adjustment method and device.
Background technique
It works for software automated testing, the most time-consuming in the whole cycle of automatic test is exactly to automate foot This debugging, debugging method in the prior art is relatively simple, is to debug one by one in test suite to script, if in debugging foot The data variable that test suite is modified during this, then test suite will rerun, since test suite wants initialization apparatus Environmental variance and node parameter, therefore runing time is all long.
Summary of the invention
To solve the above problems, the present invention provides a kind of automatized script adjustment method and dress based on model-driven It sets, the runing time of script and test suite can be shortened, to reduce the debug time entirely automated.
A kind of automatized script adjustment method based on model-driven provided by the invention, comprising:
Using the pel of MBT, service logic is generated;
Generate automatized script;
Script debugging plug-in unit is embedded into MBT modeling tool;
Modified sentence in the script is selected, on the basis that the sentence and environment executed retains in the buffer On, directly execute the modified sentence.
Preferably, described that script debugging plug-in unit is embedding in the automatized script adjustment method above-mentioned based on model-driven Enter into MBT modeling tool are as follows:
The script debugging plug-in unit is embedded into the MBT modeling tool in a manner of once compiling Dynamic link library.
Preferably, in the automatized script adjustment method above-mentioned based on model-driven, the pel using MBT is raw Include: at service logic
By the way of xml document, pel control logic node parameter the opening up to physical node parameter of the MBT is utilized Flutter mapping.
Preferably, in the automatized script adjustment method above-mentioned based on model-driven, the pel using MBT is controlled The Topological Mapping of logical node parameter to physical node parameter includes:
Using dynamic link library, the script that many-to-one connection executes, while script execution failure or completion Discharge the dynamic link library.
Preferably, in the automatized script adjustment method above-mentioned based on model-driven, in the pel using MBT, Before generation service logic, further includes:
The common unit of reading and writing and the forwarding for data is taken out using Python, wherein use proxy mode Realize the forwarding of the data.
A kind of automatized script debugging apparatus based on model-driven provided by the invention, comprising:
First generation unit generates service logic for the pel using MBT;
Second generation unit, for generating automatized script;
Embedded unit, for script debugging plug-in unit to be embedded into MBT modeling tool;
Execution unit, for selecting modified sentence in the script, in the sentence and environment executed slow On the basis of depositing reservation, the modified sentence is directly executed.
Preferably, in the automatized script debugging apparatus above-mentioned based on model-driven, the embedded unit is specifically used for The script debugging plug-in unit is embedded into the MBT modeling tool in a manner of once compiling Dynamic link library.
Preferably, in the automatized script debugging apparatus above-mentioned based on model-driven, first generation unit is specific For being reflected using the topology of pel control logic node parameter to the physical node parameter of the MBT by the way of xml document It penetrates.
Preferably, in the automatized script debugging apparatus above-mentioned based on model-driven, first generation unit is specific For utilizing dynamic link library, the script that many-to-one connection executes discharges while script execution failure or completion The dynamic link library.
Preferably, in the automatized script debugging apparatus above-mentioned based on model-driven, further includes:
Abstraction unit, for taking out the common unit of reading and writing and forwarding for data using Python, In, the forwarding of the data is realized using proxy mode.
As can be seen from the above description, above-mentioned automatized script adjustment method and dress based on model-driven provided by the invention Set, due to this method comprises: using MBT pel, generate service logic;Generate automatized script;Script debugging plug-in unit is embedding Enter into MBT modeling tool;Select modified sentence in the script, the sentence and environment executed in the buffer On the basis of reservation, the modified sentence is directly executed, therefore the runing time of script and test suite can be shortened, thus Reduce the debug time entirely automated.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is the signal of the first automatized script adjustment method based on model-driven provided by the embodiments of the present application Figure;
Fig. 2 is the signal of the first automatized script debugging apparatus based on model-driven provided by the embodiments of the present application Figure.
Specific embodiment
Core of the invention thought is to provide a kind of automatized script adjustment method and device based on model-driven, energy Enough shorten the runing time of script and test suite, to reduce the debug time entirely automated.
This method and the test object of device are mass memory unit, and the debugging based on model-driven is exactly automating On the basis of script generates, the efficiency of script debugging is increased substantially, a large amount of consumptions of the script debugging in automatic test are avoided When, the feedback cycle of the automatic test of software version is reduced, transformation manual test mode is full-automatic test pattern.
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The first automatized script adjustment method based on model-driven provided by the embodiments of the present application is as shown in Figure 1, Fig. 1 For the schematic diagram of the first automatized script adjustment method based on model-driven provided by the embodiments of the present application.This method includes Following steps:
S1: using the pel of MBT, service logic is generated;
It should be noted that MBT, that is, Model Based Testing therein, the debugging based on mode activated first have to Understanding based on business model draws service logic using MBT pel abundant.
S2: automatized script is generated;
S3: script debugging plug-in unit is embedded into MBT modeling tool;
In this step, insertion MBT automation debugging plug-in unit after automatized script generates, this plug-in unit is exactly script debugging core Heart technology, the design of this plug-in unit consider that the automation of facility environment parameter refreshes, the mapping of apparatus logic parameter and physical parameter, And the again automatic connection of service logic.
S4: selecting modified sentence in the script, retains in the buffer in the sentence and environment executed On the basis of, directly execute the modified sentence.
During actual script debugging, operation can be clicked directly on by mouse final election amended sentence Final election sentence can be only carried out, the assignment completed in the language and environment executed before is constant and protects in caching It stays, so that operational efficiency is significantly promoted.In this case, so that it may run the feelings of test suite and test script in endless full weight Under condition, the sentence of specified modification is run, refresh data and node parameter in facility environment.
As can be seen from the above description, the first above-mentioned automatized script based on model-driven provided by the embodiments of the present application Adjustment method generates service logic due to including: the pel using MBT;Generate automatized script;Script debugging plug-in unit is embedding Enter into MBT modeling tool;Select modified sentence in the script, the sentence and environment executed in the buffer On the basis of reservation, the modified sentence is directly executed, therefore the runing time of script and test suite can be shortened, thus Reduce the debug time entirely automated.
The second provided by the embodiments of the present application automatized script adjustment method based on model-driven, is above-mentioned first Further include following technical characteristic on the basis of automatized script adjustment method of the kind based on model-driven:
It is described that script debugging plug-in unit is embedded into MBT modeling tool are as follows:
The script debugging plug-in unit is embedded into the MBT modeling tool in a manner of once compiling Dynamic link library.
In this case, the risk that reports an error installed and run by hand by hand is just shielded, safety is improved.
The third automatized script adjustment method based on model-driven provided by the embodiments of the present application, is above-mentioned second Further include following technical characteristic on the basis of automatized script adjustment method of the kind based on model-driven:
The pel using MBT, generating service logic includes:
By the way of xml document, pel control logic node parameter the opening up to physical node parameter of the MBT is utilized Flutter mapping.
Physical node and logical point can be mapped using aforesaid way, physical node is presented in topological diagram.
The 4th kind of automatized script adjustment method based on model-driven provided by the embodiments of the present application, is in above-mentioned third Further include following technical characteristic on the basis of automatized script adjustment method of the kind based on model-driven:
The Topological Mapping of pel control logic node parameter to the physical node parameter using MBT includes:
Using dynamic link library, the script that many-to-one connection executes, while script execution failure or completion Discharge the dynamic link library.
Using aforesaid way, just solves and asked due to the how caused logical node of service node to physical node mapping is slow Topic, the above process are not take up memory source.
The 5th kind of automatized script adjustment method based on model-driven provided by the embodiments of the present application, is the above-mentioned 4th Further include following technical characteristic on the basis of automatized script adjustment method of the kind based on model-driven:
Before the pel using MBT, generation service logic, further includes:
The common unit of reading and writing and the forwarding for data is taken out using Python, wherein use proxy mode Realize the forwarding of the data.
It, can be across it should be noted that the automation framework and programming language of the compatible a variety of maturations of the Python Platform development whole flow process.
In conclusion traditional script debugging is first to run automatic test set, adjusted one by one again after initialization context variable Automatized script is tried, if necessary to modify script, needs entire script to rerun, if modifying test suite, it is necessary to Discharging entire resource, to rerun test suite time-consuming and laborious, and the above method provided by the embodiments of the present application has the advantage that Without reruning modified script, modified sentence is directly run;Without reruning modified test suite, directly Run the test suite sentence and map environment parameter of modification;Script debugging plug-in unit is embedded into MBT modeling tool, shields peace by hand It is low to consume memory using dynamic link library mode, runs the features such as fast for dress and the risk that reports an error of operation.
The first automatized script debugging apparatus based on model-driven provided by the embodiments of the present application is as shown in Fig. 2, Fig. 2 For the schematic diagram of the first automatized script debugging apparatus based on model-driven provided by the embodiments of the present application.The device packet It includes:
First generation unit 201 generates service logic for the pel using MBT, it should be noted that is based on mode The debugging of driving first has to the understanding based on business model, draws service logic using MBT pel abundant;
Second generation unit 202, for generating automatized script;
Embedded unit 203, for script debugging plug-in unit to be embedded into MBT modeling tool, this plug-in unit is exactly script debugging Core technology, the automation refreshing of the design consideration facility environment parameter of this plug-in unit, apparatus logic parameter and physical parameter are reflected It penetrates and the again automatic of service logic connects;
Execution unit 204 exists for selecting modified sentence in the script in the sentence and environment executed On the basis of retaining in caching, directly execute the modified sentence, can by mouse final election amended sentence, Final election sentence can be only carried out by clicking directly on operation, and the assignment completed in the language and environment executed before is constant And retain in caching, so that operational efficiency is significantly promoted.In this case, so that it may run test suite and survey in endless full weight In the case where training sheet, the sentence of specified modification is run, refresh data and node parameter in facility environment.
As can be seen from the above description, the first above-mentioned automatized script based on model-driven provided by the embodiments of the present application Debugging apparatus can shorten the runing time of script and test suite, to reduce the debug time entirely automated.
The second provided by the embodiments of the present application automatized script debugging apparatus based on model-driven, is above-mentioned first Further include following technical characteristic on the basis of automatized script debugging apparatus of the kind based on model-driven:
The embedded unit is specifically used for for the script debugging plug-in unit being embedded into a manner of once compiling Dynamic link library In the MBT modeling tool.In this case, the risk that reports an error installed and run by hand by hand is just shielded, peace is improved Quan Xing.
The third automatized script debugging apparatus based on model-driven provided by the embodiments of the present application, is above-mentioned second Further include following technical characteristic on the basis of automatized script debugging apparatus of the kind based on model-driven:
First generation unit is specifically used for by the way of xml document, utilizes the pel control logic section of the MBT Topological Mapping of the point parameter to physical node parameter.This makes it possible to which physical node and logical point are mapped, topological diagram is in Existing physical node.
The 4th kind of automatized script debugging apparatus based on model-driven provided by the embodiments of the present application, is in above-mentioned third Further include following technical characteristic on the basis of automatized script debugging apparatus of the kind based on model-driven:
First generation unit is specifically used for utilizing dynamic link library, many-to-one to connect the script executed, The dynamic link library is discharged while script execution failure or completion.Which solves due to the how caused logic of service node Node maps slow problem to physical node, is not take up memory source.
The 5th kind of automatized script debugging apparatus based on model-driven provided by the embodiments of the present application, is the above-mentioned 4th Further include following technical characteristic on the basis of automatized script debugging apparatus of the kind based on model-driven:
Further include:
Abstraction unit, for taking out the common unit of reading and writing and forwarding for data using Python, In, the forwarding of the data is realized using proxy mode.
It, can be across it should be noted that the automation framework and programming language of the compatible a variety of maturations of the Python Platform development whole flow process.
In conclusion the compatible a variety of automation frameworks of above-mentioned apparatus, compatible a variety of automatic programming language are broken completely The debugging mentality of previous automatized script, using the powerful advantages of model, where problematic just debugging where, where modification just adjusts Where is examination, does not need to rerun entire automatic test set and automatized script, time-consuming place is all cut.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest scope of cause.

Claims (8)

1. a kind of automatized script adjustment method based on model-driven characterized by comprising
Using the pel of MBT, service logic is generated;
Generate automatized script;
Script debugging plug-in unit is embedded into MBT modeling tool;
Modified sentence in the script is selected, on the basis of the sentence and environment executed retains in the buffer, Directly execute the modified sentence;
It is described that script debugging plug-in unit is embedded into MBT modeling tool are as follows:
The script debugging plug-in unit is embedded into the MBT modeling tool in a manner of once compiling Dynamic link library.
2. the automatized script adjustment method according to claim 1 based on model-driven, which is characterized in that the utilization The pel of MBT, generating service logic includes:
By the way of xml document, reflected using the topology of pel control logic node parameter to the physical node parameter of the MBT It penetrates.
3. the automatized script adjustment method according to claim 2 based on model-driven, which is characterized in that the utilization The Topological Mapping of pel control logic node parameter to the physical node parameter of MBT includes:
Using dynamic link library, the script that many-to-one connection executes discharges while script execution failure or completion The dynamic link library.
4. the automatized script adjustment method according to claim 3 based on model-driven, which is characterized in that in the benefit With the pel of MBT, before generating service logic, further includes:
The common unit of reading and writing and the forwarding for data is taken out using Python, wherein realize using proxy mode The forwarding of the data.
5. a kind of automatized script debugging apparatus based on model-driven characterized by comprising
First generation unit generates service logic for the pel using MBT;
Second generation unit, for generating automatized script;
Embedded unit, for script debugging plug-in unit to be embedded into MBT modeling tool;
Execution unit, for selecting modified sentence in the script, the sentence and environment executed in the buffer On the basis of reservation, the modified sentence is directly executed;
The embedded unit is specifically used for for the script debugging plug-in unit being embedded into a manner of once compiling Dynamic link library described In MBT modeling tool.
6. the automatized script debugging apparatus according to claim 5 based on model-driven, which is characterized in that described first Generation unit is specifically used for by the way of xml document, using the pel control logic node parameter of the MBT to physical node The Topological Mapping of parameter.
7. the automatized script debugging apparatus according to claim 6 based on model-driven, which is characterized in that described first Generation unit be specifically used for utilize dynamic link library, it is many-to-one connection execute the script, script execution failure or it is complete At while discharge the dynamic link library.
8. the automatized script debugging apparatus according to claim 7 based on model-driven, which is characterized in that further include:
Abstraction unit, for taking out the common unit of reading and writing and forwarding for data using Python, wherein adopt The forwarding of the data is realized with proxy mode.
CN201610820867.0A 2016-09-13 2016-09-13 A kind of automatized script adjustment method and device based on model-driven Active CN106445818B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610820867.0A CN106445818B (en) 2016-09-13 2016-09-13 A kind of automatized script adjustment method and device based on model-driven

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610820867.0A CN106445818B (en) 2016-09-13 2016-09-13 A kind of automatized script adjustment method and device based on model-driven

Publications (2)

Publication Number Publication Date
CN106445818A CN106445818A (en) 2017-02-22
CN106445818B true CN106445818B (en) 2019-05-10

Family

ID=58168806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610820867.0A Active CN106445818B (en) 2016-09-13 2016-09-13 A kind of automatized script adjustment method and device based on model-driven

Country Status (1)

Country Link
CN (1) CN106445818B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108170789A (en) * 2017-12-27 2018-06-15 郑州云海信息技术有限公司 A kind of classification storage method and relevant apparatus based on distributed file system
CN110209565B (en) * 2018-02-28 2021-08-13 华为技术有限公司 Metadata model debugging method and device
CN110286901B (en) * 2019-07-04 2023-05-30 广州广燃设计有限公司 CAD-based script generation method, system and storage medium
CN110543429B (en) * 2019-09-10 2023-05-16 深圳前海微众银行股份有限公司 Test case debugging method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425012A (en) * 2008-12-10 2009-05-06 深圳华为通信技术有限公司 Method and device for generating case script based on model automatization
CN102033743A (en) * 2010-09-02 2011-04-27 西安赛斐软件科技有限公司 System and method for expanding model driving development capability by applying plug-in
CN102053912A (en) * 2011-01-06 2011-05-11 中国工商银行股份有限公司 Device and method for automatically testing software based on UML (unified modeling language) graphs
CN104615541A (en) * 2015-02-10 2015-05-13 上海创景计算机系统有限公司 Simulation testing modeling system and method based on flow chart
CN105068929A (en) * 2015-08-06 2015-11-18 网易(杭州)网络有限公司 Test script generation method, test script generation device, testing method, testing device and testing system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425012A (en) * 2008-12-10 2009-05-06 深圳华为通信技术有限公司 Method and device for generating case script based on model automatization
CN102033743A (en) * 2010-09-02 2011-04-27 西安赛斐软件科技有限公司 System and method for expanding model driving development capability by applying plug-in
CN102053912A (en) * 2011-01-06 2011-05-11 中国工商银行股份有限公司 Device and method for automatically testing software based on UML (unified modeling language) graphs
CN104615541A (en) * 2015-02-10 2015-05-13 上海创景计算机系统有限公司 Simulation testing modeling system and method based on flow chart
CN105068929A (en) * 2015-08-06 2015-11-18 网易(杭州)网络有限公司 Test script generation method, test script generation device, testing method, testing device and testing system

Also Published As

Publication number Publication date
CN106445818A (en) 2017-02-22

Similar Documents

Publication Publication Date Title
CN101706753B (en) Unit testing framework and method based on Perl
CN106445818B (en) A kind of automatized script adjustment method and device based on model-driven
Mathur et al. Advancements in the V-Model
CN102402427B (en) A kind of update method of java application and device
CN106201642B (en) A kind of template automation compiling loading method and system based on NODEJS
CN112270149B (en) Verification platform automatic integration method and system, electronic equipment and storage medium
US8788239B2 (en) Methods, apparatus and articles of manufacture to test batch configurations
CN104679488A (en) Flow path customized development platform and method
US20150331406A1 (en) Programming auxiliary system of programmable controller and method thereof
CN103970659A (en) Android application software automation testing method based on pile pitching technology
Ferrari et al. Model-based development and formal methods in the railway industry
CN104125504B (en) Deployment method, device and system based on continuous integration
CN103327080A (en) Method and device for establishing control system of internet of things
US20110321013A1 (en) Interactive environment for test case generation associated with a computer code
CN106919398A (en) A kind of software distribution method and device
CN109739759A (en) A method of verifying Black-box testing Cases design integrity
CN109933521A (en) Automated testing method, device, computer equipment and storage medium based on BDD
CN105302549A (en) Multiple-language-supporting test process generating, debugging and executing system
CN105591779A (en) Method and device for inspecting network element
CN103176894A (en) Test data automatic derivative method and automatic derivative device facing database
CN103699478A (en) Test case generation system and test case generation method
CN104317580A (en) Integrated development environment for virtual test application (APP)
CN111580409B (en) Fault simulation test method for real-time embedded system
CN111142861B (en) Method and device for integrating structured comprehensive control system
CN104077225A (en) Script debugging method and script debugging device both based on JavaScript

Legal Events

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