CN106021109A - Automatic frame model for program structure analysis - Google Patents

Automatic frame model for program structure analysis Download PDF

Info

Publication number
CN106021109A
CN106021109A CN201610339516.8A CN201610339516A CN106021109A CN 106021109 A CN106021109 A CN 106021109A CN 201610339516 A CN201610339516 A CN 201610339516A CN 106021109 A CN106021109 A CN 106021109A
Authority
CN
China
Prior art keywords
test
program
module
model
analysis
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
CN201610339516.8A
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.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry 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 Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN201610339516.8A priority Critical patent/CN106021109A/en
Publication of CN106021109A publication Critical patent/CN106021109A/en
Pending legal-status Critical Current

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/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses an automatic frame model for program structure analysis. The model comprises the following five basic modules: a syntax analyzer being a complete compiling module, wherein a processed object is a standard language subset; a strategy allocator, used for designing a test model according to a test method to be adopted to support a specific test activity; an instruction generator, used for calculating a test work to be processed when a program is dynamically executed, generating a test processing module, inserting the test processing module in a source program, constructing a tested program containing test information, and submitting the tested program to a simulation execution module to be executed; a test case generator, used for repeatedly carrying out the test activity according to the preparation condition of the test; and an instruction simulation executor, used for providing a simulation execution environment in the test frame. Compared with the prior art, the automatic frame model for program structure analysis can complete an automatic test process of the program, can reduce manual work and improve the automation degree of the test, is high in practicality and is easy to promote.

Description

A kind of towards the analysis automated frame model of program structure
Technical field
The present invention relates to computer software testing technical field, a kind of practical, towards the analysis automated frame model of program structure.
Background technology
Software test is the work that a cost is huge.Traditional manual testing's technology not only to expend substantial amounts of human resources, also need to the test period grown very much, the inefficiency of test, and depend critically upon the personal experience of tester, even if the simplest program is possibly also owing to individual thinking custom causes the omission of test.Automatic test technology then can make up these problems.Automatic test is complete, a tight test process, uses test rule and evaluation criteria accurately, it is to avoid the careless omission that tester's experience judges, and the deviation that inertial thinking is caused.Along with research and the exploitation of corresponding automatic testing instrument of automatic test technology, automatic test technology can be effectively improved the efficiency of test, reduces the loaded down with trivial details duplication of labour, it is ensured that the repeatability of test.For Experience of Software Testing Work that is loaded down with trivial details and that repeat in a large number, the solution that automatic test technology tester the most just is expected.
Software testing technology develops into certain stage, increase along with software system scale, software test complexity increases, traditional measuring technology is own through being difficult in adapt to the requirement of software development process, require that the powerful development potentiality having breakthrough development, automation software testing technology to show conventional testing techniques makes the important content of software test research.How to improve the performance of automation software testing, the function of extension automation software testing, improve practicality and the reliability of software product of automation software testing, be the subject matter of automation software testing needs solution.
Based on this, the present invention provides a kind of towards the analysis automated frame model of program structure, use the different research methoies such as evolutionary computation, discovery learning and finite-state automata, various technology and realization to software test automation improve and innovate, to improving the automaticity of software test and ensureing that the effectiveness of test automatically has great realistic meaning and researching value.
Summary of the invention
The technical assignment of the present invention is for above weak point, it is provided that a kind of practical, towards the analysis automated frame model of program structure.
A kind of towards the analysis automated frame model of program structure, this model includes following five basic modules:
Syntax analyzer, is a complete collector, handled to as if the subset of standard language;
Strategy distributor, designs the test model support to concrete test activity according to method of testing to be taken, carries out the arrangement of test activity simultaneously for different test targets;
Instruction generator, under the control of Test Strategy, for different Test Strategies, test job to be processed during calculation procedure Dynamic Execution, generate test processes module to be inserted in source program, constitute the tested program of self-contained test information, submit to emulate module and run;
Test case generator, is a relatively independent module, and test activity is repeated according to the complete situation of test;
Command simulation executor, this module provides and emulate environment within a test frame, it is achieved the function of program dynamic operation and detection.
First syntax analyzer carries out morphological analysis to double source program, use finite automata that the morphological rule represented by regular expression is identified, i.e. by the identification of finite automata, each variable in program is identified, and variable location carries out record, for follow-up test processes analysis.
Described syntax analyzer completes the structural analysis to tested program, is tested Program Generating abstract syntax tree automatically, after traveling through this syntax tree, generates adjacency matrix and then the calculation procedure Control flow path of program, it is provided that use to follow-up test activity.
Test program is supplied to command simulation maker in three location representation modes and processes by instruction generator, corresponding, the intermediate code of the three location representation that this instruction generator is generated by command simulation executor explains execution, to realize the function of program dynamic operation and detection.
Described test case generator is in automatic testing process, completes the process to input data, is called when needed, is manually entered the input data performing to provide necessity into program with simulation.
Above-mentioned model passes through the syntax analyzer parsing to program structure, using and embedding source code mode is that tested program inserts test probe, by running the tested program with test probe under the analog simulation environment that command simulation executor provides, complete the automatic testing process to program.
The test processes embedding source code mode refers to: after resolving program control structure, configuration according to Test Strategy, test processes process to be realized in program control flow is carried out precomputation and definition, for needing the operation node carrying out testing and monitoring to add processing module;So, when program runs to specific test processes module by normal control flow, controlling to be handed over to test processes module, the control stream information that oneself is run by module is analyzed and tests, and generates corresponding test report, then the control program of returning is continued executing with.
The one of the present invention, towards the analysis automated frame model of program structure, has the advantage that
The one of the present invention is towards the analysis automated frame model of program structure, use the different technology such as evolutionary computation, discovery learning and finite-state automata, various technology and realization to software test automation improve and innovate, to improving the automaticity of software test and ensureing that the effectiveness of test automatically has great realistic meaning and researching value;The automatic testing process to program can be completed, it is possible to reduce hand labor, improve the automaticity of test, practical, it is easy to promote.
Accompanying drawing explanation
Accompanying drawing 1 is the automaton model figure of identifier.
Accompanying drawing 2 is the structural representation of the present invention.
Accompanying drawing 3 performs flow chart for procedure simulation.
Detailed description of the invention
Below in conjunction with the accompanying drawings and specific embodiment the invention will be further described.
As shown in accompanying drawing 1, Fig. 2, the present invention provides a kind of towards the analysis automated frame model of program structure, automatic test model for C language structural analysis, model is based on collector, and by the parsing to program structure, using and embedding source code mode is that tested program inserts test probe, by running the tested program with test probe under analog simulation environment, complete the automatic testing process to program, it is possible to reduce hand labor, improve the automaticity of test.
The realization of this model is an integrated self-organizing environment, the test activity automatically such as main supporter test, automatic generating test case, functional test and continuous loop test.The realization of test activity have employed source code Embedded test probe technique and realizes, the tissue of model, mainly includes 5 basic modules, such as Fig. 2.
One, syntax analyzer.
Syntax analyzer is really a complete collector, handled to as if the subset of standard language.Syntax analyzer first double source program carries out morphological analysis, and the morphological rule represented by regular expression is identified by main use finite automata.
Such as letter and number is expressed as:
letter=[a-zA-Z]
digit=[0-9]
The regular expression of identifier can table be: identifier=letter (letter}digit) *.The rule that the most legal identifier is to be met is must can to connect thereafter any number of letter or number with beginning of letter.It is designed with limiting automat for identification marking symbol and is represented by Fig. 1.
By the identification of finite automata, each variable in program can be identified by this module, and variable location carries out record, for follow-up test processes analysis.Collector completes the structural analysis to tested program, is the aforesaid abstract syntax tree of tested Program Generating automatically, after traveling through this syntax tree, generates adjacency matrix and then the calculation procedure Control flow path of program, it is possible to provide use to follow-up test activity.
Two, strategy distributor.
Test activity is behavior targetedly, and specific test is often supported more weak by general frame model, thus is difficult to play the performance of test.In Test Strategy, method of testing and technology that white-box testing and Black-box Testing are used have the biggest difference.Use strategy distributor can design the test model support to concrete test activity according to method of testing to be taken, can be the arrangement that carries out test activity of different test targets simultaneously.Strategy distributor makes test model have well adapting to property, to the performance important role effectively playing test automatically.
Three, instruction generator.
Test for program structure needs the control stream information of accurate assurance program, in automatic test course, needs these automatic information collectings and analysis.The outside monitor mode of use program dynamic state of run realizes complexity, and owing to needing all states safeguarded and detect in program process, can cause bigger test processes expense.The Embedded test processes of source code can avoid this problem, after program control structure is resolved, according to the configuration of Test Strategy, test processes process to be realized in program control flow can be carried out precomputation and definition, for needing the operation node carrying out testing and monitoring to add processing module.So, when program runs to specific test processes module by normal control flow, controlling to be handed over to test processes module, the control stream information that oneself is run by module is analyzed and tests, and generates corresponding test report, then the control program of returning is continued executing with.
Instruction generator is under the control of Test Strategy, for different Test Strategies, test job to be processed during calculation procedure Dynamic Execution, generate test processes module and be inserted in source program, constitute the tested program of self-contained test information, submit to emulate module and run.The test model of the design employs independent simulation process module, can provide processing routine for module after instruction generator, and this mode can provide the bigger support to test.This means that test processes module can even is that non-standard features, as long as simulation performs module and can recognize and provide support, can perform in the present context.
The test program that embedded in test processes module is supplied to simulation execution module in three location representation modes and processes by instruction generator.
Four, test case generator.
Test case generator is a relatively independent module, and under auto-testing-framework model herein, test activity, according to the complete situation of test, can be repeated.The Dynamic Execution of program realizes the most under certain circumstances, can accept the data input of user or external environment condition during execution, and these input data can directly affect the execution behavior of program.In automatic testing process, in order to reduce artificial intervention as far as possible, the process of input data is implemented as an independent module, is called when needed, is manually entered the input data performing to provide necessity into program with simulation.
Five, command simulation executor.
This module provides and emulate environment within a test frame, the intermediate code of three location representation of aforementioned generation is explained execution, it is achieved the function of program dynamic operation and detection.
Complete the structural analysis to tested program, and arrange test probe after, it is possible to for tested Automatic Program structure test case drive execution carry out dynamic test.Auto-testing-framework model herein has been tested programming emulates module, and the intermediate code with test detecting probe information can perform under the emulation module in test frame, in conjunction with aforesaid automatic test-adequacy criteria, can complete the process automatically tested.
Fig. 3 is the algorithm flow graph model of simulation run module, and its particular content is:
First initialization directive emulates the simulated environment that device provides;
Then test case is generated by test case generator;
Utilizing the test test information collected of probe to detect whether meeting testing standard, after reaching set branch's coverage test standard, automatic testing process stops.
Above-mentioned detailed description of the invention is only the concrete case of the present invention; the scope of patent protection of the present invention includes but not limited to above-mentioned detailed description of the invention; suitably change that it is done by a kind of claims towards the analysis automated frame model of program structure of any present invention of meeting and any described technical field those of ordinary skill or replace, all should fall into the scope of patent protection of the present invention.

Claims (7)

1. one kind towards the analysis automated frame model of program structure, it is characterised in that this model includes following five basic modules:
Syntax analyzer, is a complete collector, handled to as if the subset of standard language;
Strategy distributor, designs the test model support to concrete test activity according to method of testing to be taken, carries out the arrangement of test activity simultaneously for different test targets;
Instruction generator, under the control of Test Strategy, for different Test Strategies, test job to be processed during calculation procedure Dynamic Execution, generate test processes module to be inserted in source program, constitute the tested program of self-contained test information, submit to emulate module and run;
Test case generator, is a relatively independent module, and test activity is repeated according to the complete situation of test;
Command simulation executor, this module provides and emulate environment within a test frame, it is achieved the function of program dynamic operation and detection.
One the most according to claim 1 is towards the analysis automated frame model of program structure, it is characterized in that, first syntax analyzer carries out morphological analysis to double source program, use finite automata that the morphological rule represented by regular expression is identified, i.e. by the identification of finite automata, each variable in program is identified, and variable location carries out record, for follow-up test processes analysis.
One the most according to claim 2 is towards the analysis automated frame model of program structure, it is characterized in that, described syntax analyzer completes the structural analysis to tested program, automatically it is tested Program Generating abstract syntax tree, after this syntax tree is traveled through, the adjacency matrix of generation program and then calculation procedure Control flow path, it is provided that use to follow-up test activity.
One the most according to claim 1 is towards the analysis automated frame model of program structure, it is characterized in that, test program is supplied to command simulation maker in three location representation modes and processes by instruction generator, corresponding, the intermediate code of the three location representation that this instruction generator is generated by command simulation executor explains execution, to realize the function of program dynamic operation and detection.
One the most according to claim 1 is towards the analysis automated frame model of program structure, it is characterized in that, described test case generator is in automatic testing process, complete the process to input data, it is called when needed, is manually entered the input data performing to provide necessity into program with simulation.
One the most according to claim 1 is towards the analysis automated frame model of program structure, it is characterized in that, above-mentioned model passes through the syntax analyzer parsing to program structure, using and embedding source code mode is that tested program inserts test probe, by running the tested program with test probe under the analog simulation environment that command simulation executor provides, complete the automatic testing process to program.
One the most according to claim 6 is towards the analysis automated frame model of program structure, it is characterized in that, the test processes embedding source code mode refers to: after resolving program control structure, configuration according to Test Strategy, test processes process to be realized in program control flow is carried out precomputation and definition, for needing the operation node carrying out testing and monitoring to add processing module;So, when program runs to specific test processes module by normal control flow, controlling to be handed over to test processes module, the control stream information that oneself is run by module is analyzed and tests, and generates corresponding test report, then the control program of returning is continued executing with.
CN201610339516.8A 2016-05-20 2016-05-20 Automatic frame model for program structure analysis Pending CN106021109A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610339516.8A CN106021109A (en) 2016-05-20 2016-05-20 Automatic frame model for program structure analysis

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610339516.8A CN106021109A (en) 2016-05-20 2016-05-20 Automatic frame model for program structure analysis

Publications (1)

Publication Number Publication Date
CN106021109A true CN106021109A (en) 2016-10-12

Family

ID=57096672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610339516.8A Pending CN106021109A (en) 2016-05-20 2016-05-20 Automatic frame model for program structure analysis

Country Status (1)

Country Link
CN (1) CN106021109A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109800174A (en) * 2019-01-31 2019-05-24 北京八分量信息科技有限公司 A kind of the emulation inspection method and device of block chain intelligence contract
CN110135150A (en) * 2019-05-10 2019-08-16 上海红神信息技术有限公司 A kind of program operation control method and system
CN114756474A (en) * 2022-04-27 2022-07-15 苏州睿芯集成电路科技有限公司 Method and device for generating random vector in CPU verification and electronic equipment
CN110427313B (en) * 2019-07-30 2023-05-30 上海工程技术大学 System and method for testing transaction function of automatic ticket vending machine

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050278781A1 (en) * 2004-06-14 2005-12-15 Lionic Corporation System security approaches using sub-expression automata
CN1877531A (en) * 2006-06-30 2006-12-13 浙江大学 Embedded compiled system scanner accomplishing method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050278781A1 (en) * 2004-06-14 2005-12-15 Lionic Corporation System security approaches using sub-expression automata
CN1877531A (en) * 2006-06-30 2006-12-13 浙江大学 Embedded compiled system scanner accomplishing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨振兴等: "基于宿主嵌入式软件白盒覆盖测试系统的设计", 《燕山大学学报》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109800174A (en) * 2019-01-31 2019-05-24 北京八分量信息科技有限公司 A kind of the emulation inspection method and device of block chain intelligence contract
CN110135150A (en) * 2019-05-10 2019-08-16 上海红神信息技术有限公司 A kind of program operation control method and system
CN110427313B (en) * 2019-07-30 2023-05-30 上海工程技术大学 System and method for testing transaction function of automatic ticket vending machine
CN114756474A (en) * 2022-04-27 2022-07-15 苏州睿芯集成电路科技有限公司 Method and device for generating random vector in CPU verification and electronic equipment
CN114756474B (en) * 2022-04-27 2023-07-21 苏州睿芯集成电路科技有限公司 Method and device for generating random vector in CPU verification and electronic equipment

Similar Documents

Publication Publication Date Title
Chen et al. Challenges and trends in modern SoC design verification
Green et al. SIMR: An R package for power analysis of generalized linear mixed models by simulation
Bringmann et al. Model-based testing of automotive systems
CN106021109A (en) Automatic frame model for program structure analysis
JP2672711B2 (en) How to test and debug computer programs
US20090248390A1 (en) Trace debugging in a hardware emulation environment
CN108984403A (en) The verification method and device of FPGA logical code
CN104156311B (en) A kind of embedded type C language target code level unit test method based on CPU emulator
CN106411635A (en) Formal analysis and verification method for real-time protocol
CN103092747B (en) A kind of checking controlling program and method of testing and system
CN107533473A (en) Efficient wave for emulation generates
CN105893707B (en) A kind of SOC chip module verification and power consumption analysis method
CN105975664A (en) Assessment method for chip power consumption assessment platform
US20200074040A1 (en) Hierarchical expression coverage clustering for design verification
CN113778616A (en) Electric power Internet of things terminal virtualization analog simulation platform and simulation method
CN106933572B (en) Measurement model based on LLVM intermediate representation program slice
CN102520984B (en) Computing method for worst time of object software in specified hardware environment
CN102662829B (en) Processing method and apparatus for complex data structure in code static state testing
CN108710568A (en) Detection method, computer equipment and the storage medium of static code defect
Pereira Energyware engineering: techniques and tools for green software development
CN107145381A (en) The MIPS cpu test instruments of face the practice teaching
CN107317811B (en) Method for realizing analog PLC
CN107942733A (en) Model system
Smith et al. A more agile approach to embedded system development
CN112380133A (en) Method and device for simulating instruction set simulator by using function library

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20161012

WD01 Invention patent application deemed withdrawn after publication