[go: up one dir, main page]

CN109408395A - Parsing test macro based on txt file - Google Patents

Parsing test macro based on txt file Download PDF

Info

Publication number
CN109408395A
CN109408395A CN201811329432.1A CN201811329432A CN109408395A CN 109408395 A CN109408395 A CN 109408395A CN 201811329432 A CN201811329432 A CN 201811329432A CN 109408395 A CN109408395 A CN 109408395A
Authority
CN
China
Prior art keywords
module
parsing
text
mark
variable
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
CN201811329432.1A
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.)
Flextronics Technology Suzhou Co Ltd
Original Assignee
Flextronics Technology Suzhou 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 Flextronics Technology Suzhou Co Ltd filed Critical Flextronics Technology Suzhou Co Ltd
Priority to CN201811329432.1A priority Critical patent/CN109408395A/en
Publication of CN109408395A publication Critical patent/CN109408395A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

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)
  • Stored Programmes (AREA)

Abstract

The parsing test macro based on txt file that the invention discloses a kind of, it include: profile service module, the text file read module of notepad for reading txt format, the text file execution module for parsing the content in notepad, the result report generation module for executing for obtaining implementing result and generating report, the text file execution module includes text key word parsing module, acquisition and the keyword response execution module for executing keyword.By the above-mentioned means, the present invention is based on the parsing test macros of txt file, directly in text content and process parsed and run, ultimately produce result report, it does not need to be edited in composing software, can be more convenient writing and modifying improves working efficiency.

Description

Parsing test macro based on txt file
Technical field
The present invention relates to software systems fields, more particularly to a kind of parsing test macro based on txt file.
Background technique
Currently, needing individually to develop a test program, and need user directly on programming software for each project Be compiled, debug and modify, but it is this operation have the shortcomings that it is very much:
1. each project needs to develop again, efficiency is reduced, and the development cycle is long;
2. needing to install programmed environment, there is copyright fee;
3. modification testing procedure will recompilate.
Summary of the invention
The parsing test macro based on txt file that the invention mainly solves the technical problem of providing a kind of has reliable The advantages that performance is high, easy to operate, easy to use, at the same the application of software systems and it is universal on have extensive market before Scape.
In order to solve the above technical problems, one technical scheme adopted by the invention is that:
A kind of parsing test macro based on txt file is provided comprising: profile service module, for reading txt format The text file read module of notepad, the text file execution module for parsing the content in notepad, for obtaining Implementing result simultaneously generates the result report generation module for executing report, and the text file execution module includes text key word solution Analysis module, acquisition and the keyword response execution module for executing keyword, the keyword response execution module includes: that annotation is rung It answers execution module, variable-definition and assignment response execution module, function response execution module, round robin execution module, compare Respond execution module, Response to selection execution module.
In a preferred embodiment of the present invention, the text key word parsing module include content of text obtain module, Keyword identification extraction module, keyword type judgment module.
In a preferred embodiment of the present invention, the keyword identification includes test item mark, annotation mark, variable It defines mark, variable assignments mark, function identification, circulation mark, compare mark, selection mark.
In a preferred embodiment of the present invention, when the text key word parsing module is resolved to annotation mark, then It is not handled, directly progress next step parsing.
In a preferred embodiment of the present invention, it is identified when the text key word parsing module is resolved to variable-definition, Then this variable is added in preset variable array.
In a preferred embodiment of the present invention, when the text key word parsing module is resolved to variable assignments mark When, then variable value opposite in variable array is updated.
In a preferred embodiment of the present invention, when the text key word parsing module is resolved to test item mark When, the title of test item is obtained, and be shown on system interface.
In a preferred embodiment of the present invention, the text key word parsing module is by row parsing text file.
The beneficial effects of the present invention are: directly in text content and process parsed and run, ultimately produce knot Fruit report, does not need to be edited in composing software, and can be more convenient writing and modifying improves working efficiency.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing, in which:
Fig. 1 is the structural schematic diagram of parsing test macro one preferred embodiment of the invention based on txt file;
The components in the drawings are labeled as follows: 1,.
Specific embodiment
The technical scheme in the embodiments of the invention will be clearly and completely described below, it is clear that described implementation Example is only a part of the embodiments of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, this field is common Technical staff's all other embodiment obtained without making creative work belongs to the model that the present invention protects It encloses.
Referring to Fig. 1, the embodiment of the present invention includes:
A kind of parsing test macro based on txt file, grammer support the formats such as C language, each test program, it is only necessary in text Text is inputted in this, is supported without programmed environment, debugging and modification parameter are improved, and convenience is stronger comprising: configuration text Part service module, the text file read module of notepad for reading txt format, for parsing the content in notepad Text file execution module, the result report generation module that report is executed for obtaining implementing result and generating, text text Part execution module includes text key word parsing module, acquisition and the keyword response execution module for executing keyword, the pass Keyword response execution module includes: that annotation response execution module, variable-definition and assignment response execution module, function response execute Module, round robin execution module compare response execution module, Response to selection execution module.
The text key word parsing module includes that content of text obtains module, keyword identification extraction module, keyword Type judging module, the keyword identification include test item mark, annotation mark, variable-definition mark, variable assignments mark Knowledge, circulation mark, compares mark, selection mark at function identification.
When the text key word parsing module is resolved to annotation mark, then it is not handled, directly carried out down The parsing of one step.
It identifies, then this variable is added in preset change when the text key word parsing module is resolved to variable-definition It measures in array.
When the text key word parsing module is resolved to variable assignments mark, then to variable opposite in variable array Numerical value is updated.
When the text key word parsing module is resolved to test item mark, the title of test item is obtained, and show Show on system interface.
The text key word parsing module is by row parsing text file.
After text file is opened with notepad, the first behavior Project name, this name may be displayed on platform interface On.The 3rd row of text file is to the 14th behavior defined variable and initializing variable, and rule is as C language.Band on the left of 15th row The expression annotation of two ##.17th row indicates to execute SN=GetLocalSN() function, indicate that the bar code for being swept into platform interface passes Into SN variable.19th row to the 33rd row indicates if ... else comparative structure.37th row indicate execute GPIB_Query this Function, indicates through GPIB read write command, read address be USB0::0x2A8D::0xB318::MY56280995::INSTR this The title of a instrument.Whether the 34th behavior judges to be saved in result comprising 34450 this character in 33 row return values In tempresult variable.
Platform contains the function of many industrial tests, such as serial communication, and GPIB communication is also integrated with many special letters Number, such as CRC algorithm, the functions such as the dialog box of pop-up with picture.
Text file execution module presses row analyzing script file, and whether distinguished according to the feature of every a line is annotation,
Variable-definition, variable assignments, function, circulation, multilevel iudge, switch(selection) structure etc., feature is as follows:
Annotation: a line starts then to indicate that the behavior annotates for ##, no longer does other movements.
Variable-definition, assignment, function: if there is equal sign in a line, according to the subsequent character meaning of equal sign come area
It is divided into assignment or function, if not having function keyword behind equal sign, for assignment, there is function keyword, then to hold Assignment after line function.
Function: if there is the keyword of function in a line, the function is executed.
Circulation: being loop body from the row if there is the keywords such as while in a line.
Compare: being comparing bulk from the row if there is if else keyword in a line.
Switch: if there is Switch in a line, the keywords such as case, default are then Switch body.
Beneficial effect the present invention is based on the parsing test macro of txt file is: directly to the content and process in text Parsed and run, ultimately produce result report, do not need to be edited in composing software, can be more convenient write And modification, improve working efficiency.
The above description is only an embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright description is applied directly or indirectly in other relevant technology necks Domain is included within the scope of the present invention.

Claims (8)

1. a kind of parsing test macro based on txt file characterized by comprising profile service module, for reading The text file read module of the notepad of txt format, is used the text file execution module for parsing the content in notepad In obtaining implementing result and generating the result report generation module for executing and reporting, the text file execution module includes that text closes Keyword parsing module, acquisition and the keyword response execution module for executing keyword, the keyword response execution module include: Annotation response execution module, variable-definition and assignment response execution module, function response execution module, round robin execute mould Block compares response execution module, Response to selection execution module.
2. the parsing test macro according to claim 1 based on txt file, which is characterized in that the text key word Parsing module includes that content of text obtains module, keyword identification extraction module, keyword type judgment module.
3. the parsing test macro according to claim 2 based on txt file, which is characterized in that the keyword identification Including test item mark, annotation mark, variable-definition mark, variable assignments mark, function identification, circulation mark, compare mark Know, selection mark.
4. the parsing test macro according to claim 3 based on txt file, which is characterized in that when the text is crucial When word parsing module is resolved to annotation mark, then it is not handled, directly progress next step parsing.
5. the parsing test macro according to claim 3 based on txt file, which is characterized in that when the text is crucial Word parsing module is resolved to variable-definition mark, then this variable is added in preset variable array.
6. the parsing test macro according to claim 3 based on txt file, which is characterized in that when the text is crucial When word parsing module is resolved to variable assignments mark, then variable value opposite in variable array is updated.
7. the parsing test macro according to claim 3 based on txt file, which is characterized in that when the text is crucial When word parsing module is resolved to test item mark, the title of test item is obtained, and be shown on system interface.
8. the parsing test macro according to claim 1 based on txt file, which is characterized in that the text key word Parsing module is by row parsing text file.
CN201811329432.1A 2018-11-09 2018-11-09 Parsing test macro based on txt file Pending CN109408395A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811329432.1A CN109408395A (en) 2018-11-09 2018-11-09 Parsing test macro based on txt file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811329432.1A CN109408395A (en) 2018-11-09 2018-11-09 Parsing test macro based on txt file

Publications (1)

Publication Number Publication Date
CN109408395A true CN109408395A (en) 2019-03-01

Family

ID=65472380

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811329432.1A Pending CN109408395A (en) 2018-11-09 2018-11-09 Parsing test macro based on txt file

Country Status (1)

Country Link
CN (1) CN109408395A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109698504A (en) * 2019-03-08 2019-04-30 张文韬 Calculation of tidal current analysis method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1501235A (en) * 2002-11-14 2004-06-02 深圳市中兴通讯股份有限公司上海第二 Man-Machine Command Realization Method Based on Plain Text Command Script File
CN103077064A (en) * 2012-12-31 2013-05-01 北京配天大富精密机械有限公司 Method and interpretation device for analyzing and executing program language
CN103177045A (en) * 2011-12-26 2013-06-26 中国移动通信集团广东有限公司 Text analysis method and text analysis device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1501235A (en) * 2002-11-14 2004-06-02 深圳市中兴通讯股份有限公司上海第二 Man-Machine Command Realization Method Based on Plain Text Command Script File
CN103177045A (en) * 2011-12-26 2013-06-26 中国移动通信集团广东有限公司 Text analysis method and text analysis device
CN103077064A (en) * 2012-12-31 2013-05-01 北京配天大富精密机械有限公司 Method and interpretation device for analyzing and executing program language

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109698504A (en) * 2019-03-08 2019-04-30 张文韬 Calculation of tidal current analysis method and system

Similar Documents

Publication Publication Date Title
US8875110B2 (en) Code inspection executing system for performing a code inspection of ABAP source codes
US8402438B1 (en) Method and system for generating verification information and tests for software
US8037450B2 (en) System and methods for tracing code generation in template engines
CN108614707A (en) Static code inspection method, device, storage medium and computer equipment
US8875103B2 (en) Method of testing multiple language versions of a software system using one test script
US20080244541A1 (en) Code translator and method of automatically translating modeling language code to hardware language code
CN104035873A (en) Method and device for generating testing codes
CN109101237A (en) The encryption Compilation Method and device of code
Di Lucca et al. Recovering use case models from object-oriented code: a thread-based approach
CN101183332A (en) Method and device for automatically generating testing datasets by program content
US8225286B2 (en) Debugging interpreted input
CN108694114A (en) Method and its system for detaching test case, test script and test data
Zhang et al. How effective are they? exploring large language model based fuzz driver generation
JP2000232516A (en) Method, creation module, server, control module, and storage means for creating validation rules
CN111694738B (en) Method for generating SQL test script
CN113312896A (en) Hardware description language VHDL standard inspection tool
CN112965909A (en) Test data, test case generation method and system, and storage medium
US20070061641A1 (en) Apparatus and method for generating test driver
CN105354035A (en) Method for compiling test case of web engineering
CN109408395A (en) Parsing test macro based on txt file
CN102014023A (en) Automated Test Method of Network Equipment Products Based on VB Script
US8239834B2 (en) Method and system of program development supporting
CN107703923B (en) Data coupling and control coupling automatic analysis method
CN112861138A (en) Software security analysis method and analysis device, electronic device, and storage medium
Curtis On language-agnostic abstract-syntax trees: student research abstract

Legal Events

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

Application publication date: 20190301