CN108595317A - A kind of embedded automated testing method of safety computer of rail transit - Google Patents

A kind of embedded automated testing method of safety computer of rail transit Download PDF

Info

Publication number
CN108595317A
CN108595317A CN201711467138.2A CN201711467138A CN108595317A CN 108595317 A CN108595317 A CN 108595317A CN 201711467138 A CN201711467138 A CN 201711467138A CN 108595317 A CN108595317 A CN 108595317A
Authority
CN
China
Prior art keywords
case
test
scene
test case
variant
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.)
Granted
Application number
CN201711467138.2A
Other languages
Chinese (zh)
Other versions
CN108595317B (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.)
Hefei Gocom Information & Technology Co Ltd
Original Assignee
Hefei Gocom 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 Hefei Gocom Information & Technology Co Ltd filed Critical Hefei Gocom Information & Technology Co Ltd
Priority to CN201711467138.2A priority Critical patent/CN108595317B/en
Publication of CN108595317A publication Critical patent/CN108595317A/en
Application granted granted Critical
Publication of CN108595317B publication Critical patent/CN108595317B/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/3668Software testing
    • G06F11/3696Methods or tools to render software testable
    • 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
    • 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/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The present invention relates to a kind of embedded automated testing methods of safety computer of rail transit, including:(1)Automatic generating test case step, test case read step and test case execute step.The present invention is in such a way that interface control is come design test case, substitute traditional design test case by the way of script, so that the ease for use of test software, expansibility and ease for maintenance will be greatly improved, the amount of labour and know-how of tester is not only greatly reduced, while also greatly having helped the test and upgrading of product.The present invention is on the basis of solving the problems, such as this, additionally provide the storage mode of simple Test Sample Design file, use text file or database, user is stored, inquires and deleted by the test case of interface, the programming mode that background program is quoted using application program reference and control, make program function modularization, facilitates subsequent maintenance and upgrading.

Description

A kind of embedded automated testing method of safety computer of rail transit
Technical field
The present invention relates to software testing technology fields, and in particular to a kind of embedded automation of safety computer of rail transit Test method.
Background technology
Automatic test field of today is just continued to develop towards information-based, intelligent, networking, can be developed a set of easy It is more and more important with, easy care, the easily test software platform of extension and lower coupling.Traditional testing scheme is all to use to write The mode of test script is tested, and function of application is simple, and intermodule coupling is strong, uses the side of script edit use-case Case is easy to occur that format is lack of standardization or mistake, the case where in turn resulting in compile error, or even can not execute test, therefore uses foot The design test case has designer certain programming requirements, ease for use weaker.The relevant industrial circle packet of track The industry that the relationships such as subway, high ferro, urban rail, magnetic suspension focus on big public safety is included, generally there is stringent security requirement, institute Before being taken into use, to there is the test system of a set of high quality most important.
Invention content
The purpose of the present invention is to provide a kind of embedded automated testing methods of safety computer of rail transit, pass through boundary Face control carrys out design test case, avoids the scheme using script edit use-case from being easy to occur format lack of standardization or wrong and make At compile error, or even the case where test can not be executed occur.
To achieve the above object, present invention employs following technical schemes:
A kind of embedded automated testing method of safety computer of rail transit, includes the following steps:
(1) automatic generating test case step, including:
(11) the control value at setting platform case designing interface;
(12) automatic reading platform design interface data, the data type are variant;
(13) variant of interface data type is converted into character string;
(14) character string is stored into text file or database;
(2) test case read step, including:
(21) from text file or database, the data of the character string forms of use-case are read;
(22) character string of data type is converted into variant;
(23) variant value is integrally copied to the case designing interface display of the platform and port is set, and pass through communication terminal Mouth is sent to measurand;
(3) test case executes step, including:
(31) when program starts, scene title will be surveyed and example title on probation imports Tree control;
(32) it creates an individual event and triggers thread, what the time use-case trigger signal of run timing device and communication came Use-case event is triggered apart from use-case trigger signal;
(33) if possessing triggering use-case event in Tree control, and the scene at place is selected, then in Tree control into Line flag simultaneously counts;If triggering use-case event is not present or place scene is not selected, ignores the trigger request, prepare to connect Receive next trigger request;
(34) use-case is obtained according in scene name and the use-case name of label to the text file or database of use case storage It is worth character string, and character string is converted to specified variant value;
(35) the variant value in (34) is sent to equipment under test;
(36) acquisition by the data information of side apparatus and unpacks the information in real time, passes through interface display;
Further, in the step (36), the variant value by DIO boards or serial ports and Ethernet be sent to by Measurement equipment.
Further, the test case function includes:Load function, load use-case, registration scene, registration use-case, note Sale place scape nullifies use-case, setting use-case, starts test, stops test and check use-case function.
Further, the storage mode of the test case is to carry out whole number using entire use-case interface as object According to format conversion, transformed data are string format, are stored in text file or database.
As shown from the above technical solution, the embedded automatic test side of safety computer of rail transit of the present invention Method substitutes traditional design test case by the way of script in such a way that interface control is come design test case so that Ease for use, expansibility and the ease for maintenance of test software will be greatly improved, and the labor of tester is not only greatly reduced Momentum and know-how, while also greatly having helped the test and upgrading of product.The present invention on the basis of solving the problems, such as this, The storage mode for additionally providing simple Test Sample Design file passes through interface using text file or database to user The test case of design is stored, inquired and is deleted.Program background program is quoted using application program reference and control Programming mode makes program function modularization, facilitates subsequent maintenance and upgrading.
Description of the drawings
Fig. 1 is the automatic generating test case flow chart of the present invention;
Fig. 2 is the test case read step of the present invention;
Fig. 3 is that the test case of the present invention executes step.
Specific implementation mode
The present invention will be further described below in conjunction with the accompanying drawings:
The embedded automated testing method of a kind of safety computer of rail transit as shown in Figs. 1-3, includes the following steps:
S1:Automatic generating test case step, including:
S11:The control value at platform case designing interface is set;
S12:Automatic reading platform design interface data, the data type are variant;
S13:The variant of interface data type is converted into character string;
S14:It will be in character string storage to text file or database;The storage mode be using entire interface as object, Overall data format conversion is carried out, transformed data are string format, are stored in text file or database.Check use-case When configuration, the string content in text file or database is being subjected to inverse conversion, is being integrally arranged interface control.
S2:Test case read step, including:
S21:From text file or database, the data of the character string forms of use-case are read;
S22:The character string of data type is converted into variant;
S23:Variant value is integrally copied to the case designing interface display of the platform and port is set, and passes through communication terminal Mouth is sent to measurand;
S3:Test case executes step, including:
S31:When program starts, scene title will be surveyed and example title on probation imports Tree control;
S32:It creates an individual event and triggers thread, what the time use-case trigger signal of run timing device and communication came Use-case event is triggered apart from use-case trigger signal;
S33:Tree control is built, test case is imported into Tree control, if possessing triggering use-case event in Tree control, And the scene at place is selected, then is marked and counts in Tree control;If triggering use-case event is not present or place Scene is not selected, then ignores the trigger request, prepares to receive next trigger request;
S34:The use-case is obtained according in scene name and the use-case name of label to the text file or database of use case storage It is worth character string, and character string is converted to specified variant value;
S35:Variant value in S35 is sent to equipment under test by DIO boards or serial ports and Ethernet;S35:In real time The input quantity of the DIO boards on equipment under test, or the data from serial ports and Ethernet are acquired, and the information is unpacked, Then it is shown on homophony program interface.
The test case of the present embodiment is unfolded centered on use-case, including use-case design, store, check, deleting With execute etc. functions, concrete function it is as follows:
Load function:When program initialization, all program module titles of the program under certain relative path are obtained, And be loaded into the menu of homophony program, it prepares for subsequent feature operation.
Load use-case:When program initialization, obtain in case designing file of the program under certain relative path Scene name and use-case name, are loaded into Tree control, functional for load to provide data source;
Register scene:Define a certain measurement condition of test, such as launch train, train braking, train storage etc.;
It is as follows to register scene concrete operation step:Dialog box is popped up, input needs the new scene title registered;The module journey Sequence will open the ini file under certain relative directory;Search for whether the new scene name had been registered in ini file;New field Jing Mingruo is not registered, then ini file is written in new scene name, and update TEE contents;If new scene name had been registered, It prompts the use-case to be registered, please re-enter, EP (end of program).
Register use-case:Define a series of test process in some test scene, as different moments to some relay into Row control sends instruction etc., use-case name format includes " T+ numbers " and " D+ by network or serial communication to system under test (SUT) Number " indicates that train operation certain time (T+ numbers) or certain distance (D+ numbers) execute the use-case respectively;
Register use-case specific steps:Dialog box is popped up, input needs the new use-case title registered;The modular program will be opened The ini file under certain relative directory;Search for whether the new use-case name had been registered;If not being registered, new use-case name is write Enter ini file, and updates TEE contents;If being registered, the use-case is prompted to be registered, please re-enter;Program knot Beam.
Nullify scene:Some scene and its all use-cases are deleted, the test of the scene is no longer carried out after showing;Specific step Suddenly it is:Dialog box is popped up, input needs the scene deleted;The modular program will open the ini file under certain relative directory;It deletes Specified scene and use-cases all below;EP (end of program).
Nullify use-case:Some use-case in some scene is deleted, the test of the use-case is no longer carried out after showing;Specific steps For:Dialog box is popped up, input needs the use-case name of the given scenario deleted under one's name;The modular program will be opened in certain relative directory Lower ini file;Delete given scenario use-case name under one's name;EP (end of program).
Use-case is set:Value in test case is set, in the case where condition meets, executes the use-case content;Setting is used Example the specific steps are:First choice in Tree control by choosing the use-case path for obtaining and being arranged, i.e. scene name and use-case name;So Homophony program reference is obtained afterwards, and the use-case control that homophony program front panel is obtained by the reference is quoted;Drawn by use-case control With the variant value for obtaining all use-case controls;Variant value is converted into character string again;Then the modular program will be opened in certain phase To ini file under catalogue;The character string is written in the ini file;Ini file is closed, then is provided with, EP (end of program).
Check use-case:By clicking the use-case title in Tree control, then it can be seen that the value of the use-case, checks use-case Whether setting meets the requirements;
First choice in Tree control by choosing the use-case path for obtaining and being arranged, i.e. scene name and use-case name;Then the mould Block program will open the ini file under certain relative directory;Search the string value of use-case under the scene;Close ini file;Then Convert the string value to variant value;Obtain homophony program reference;The use-case of homophony program front panel is obtained by the reference Control is quoted;The variant value of all use-case controls is set by the reference of use-case control;EP (end of program).
Start to test:According to the test content configured in Tree control, automatic test is then executed, it is unattended, Test is completed to be automatically stopped, and specific testing procedure is:
(1) homophony program reference is obtained;
(2) by the reference of homophony program, the reference of the control use-case of homophony program is obtained;
(3) from the reference of control use-case, the reference of Tree control is selected;
(4) it is quoted, remove control label and counted by Tree control;
(5) statistics need to survey minimum time period and the use-case sum of scene;
(6) global variable Start=T is set, and timer starts to execute;
(7) enter test, judge whether test regulations are completed or global variable Start=FIf executing (8), no execution (15)
(8) timer brings into operation, and reaches the minimum period, then trigger event;
(9) it searches and whether there is the use-case in RREE controls, and the scene where it is selected, if so, (10) are executed, if No execution (7);
(10) ini file under specified relative path is opened;
(11) string value of the use-case is obtained;
(12) ini file is closed;
(13) string value of use-case is converted to the variant value of use-case control, DIO boards and communication is set;
(14) use-case counts+1, returns (7)
(15) test terminates.
Stop test:Global variable Start=F is set, that is, terminates automatic test.
The present invention each function module background program be all application program reference and interface control reference by way of into Row write, when call when, function module background program call automatically homophony program front panel control and text file or Database is operated, and realizes that the non-coupling modularized design of program, all functional modules program are write all in accordance with which.It is main It debugs at runtime, automatically the function of search modular program under some relative path, and function module program name is loaded Into the menu of homophony program, homophony program is by these function module programs of menu call, when demand change or Function Extension When, only it need to change function module program itself.Between eliminating function module program, homophony program and called function mould Coupling between block program.Homophony program can search for use-case text file or database automatically in initialization, obtain checkout area Scape title and test case title, are shown with tree structure in Tree control.There is radio box before Tree control Scene name, Conveniently before test, project that needs to be tested is configured.The use-case text file or database are stored in homophony Under some relative path of program.
Program of the present invention can search for the title of current all functional modules automatically, and be automatically loaded into menu, Convenient for the upgrading and maintenance of down-stream.Other than loading function, in initialization, program also loads what the past defined automatically Test scene and test case, are loaded into Tree control, are convenient for the operation of down-stream.It before test, can be certainly By configuration testing scheme, then test scene of arbitrarily arranging in pairs or groups is tested according to the scene of selection.This testing scheme so that survey Ease for use, expansibility and the ease for maintenance of examination software will be greatly improved, and the labour of tester is not only greatly reduced Amount and know-how, while also greatly having helped the test and upgrading of product.
Embodiment described above is only that the preferred embodiment of the present invention is described, not to the model of the present invention It encloses and is defined, under the premise of not departing from design spirit of the present invention, technical side of the those of ordinary skill in the art to the present invention The various modifications and improvement that case is made should all be fallen into the protection domain of claims of the present invention determination.

Claims (4)

1. a kind of embedded automated testing method of safety computer of rail transit, which is characterized in that include the following steps:
(1)Automatic generating test case step, including:
(11)The control value at platform case designing interface is set;
(12)Automatic reading platform design interface data, the data type are variant;
(13)The variant of interface data type is converted into character string;
(14)It will be in character string storage to text file or database;
(2)Test case read step, including:
(21)From text file or database, the data of the character string forms of use-case are read;
(22)The character string of data type is converted into variant;
(23)Variant value is integrally copied to the case designing interface display of the platform and port is set, and is sent out by PORT COM Give measurand;
(3)Test case executes step, including:
(31)When program starts, scene title will be surveyed and example title on probation imports Tree control;
(32)It creates an individual event and triggers thread, the distance that the time use-case trigger signal of run timing device and communication come Use-case trigger signal triggers use-case event;
(33)If possessing triggering use-case event in Tree control, and the scene at place is selected, then into rower in Tree control Remember and counts;If triggering use-case event is not present or place scene is not selected, ignore the trigger request, prepares under receiving One trigger request;
(34)According to obtaining the use-case value word in scene name and the use-case name of label to the text file or database of use case storage Symbol string, and character string is converted to specified variant value;
(35)It will(34)In variant value be sent to equipment under test;
(36)Acquisition by the data information of side apparatus and unpacks the information in real time, passes through interface display.
2. the embedded automated testing method of safety computer of rail transit according to claim 1, it is characterised in that:Institute State step(36)In, the variant value is sent to equipment under test by DIO boards or serial ports and Ethernet.
3. the embedded automated testing method of safety computer of rail transit according to claim 1, it is characterised in that:Institute Stating test case function includes:Function is loaded, load use-case, registration scene, registration use-case, scene is nullified, nullifies use-case, setting Use-case starts test, stops test and checks use-case function.
4. the embedded automated testing method of safety computer of rail transit according to claim 1, it is characterised in that:Institute The storage mode for the test case stated is to carry out overall data format conversion using entire use-case interface as object, transformed Data are string format, are stored in text file or database.
CN201711467138.2A 2017-12-28 2017-12-28 Embedded automatic testing method for rail transit safety computer Active CN108595317B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711467138.2A CN108595317B (en) 2017-12-28 2017-12-28 Embedded automatic testing method for rail transit safety computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711467138.2A CN108595317B (en) 2017-12-28 2017-12-28 Embedded automatic testing method for rail transit safety computer

Publications (2)

Publication Number Publication Date
CN108595317A true CN108595317A (en) 2018-09-28
CN108595317B CN108595317B (en) 2021-06-11

Family

ID=63633446

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711467138.2A Active CN108595317B (en) 2017-12-28 2017-12-28 Embedded automatic testing method for rail transit safety computer

Country Status (1)

Country Link
CN (1) CN108595317B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124883A (en) * 2019-11-15 2020-05-08 苏州浪潮智能科技有限公司 Test case library introduction method, system and equipment based on tree form
CN112925296A (en) * 2021-01-29 2021-06-08 华南理工大学 Graphical vehicle-mounted network diagnosis method based on artificial intelligence

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030227480A1 (en) * 2002-06-11 2003-12-11 Polk George Allyn Method and apparatus for testing embedded examples in GUI documentation
US20080270996A1 (en) * 2007-04-25 2008-10-30 Samsung Electronics Co., Ltd. Apparatus and method for automatically extracting interface of embedded software
CN101571802A (en) * 2009-06-19 2009-11-04 北京航空航天大学 Visualization automatic generation method of embedded software test data and system thereof
CN101833498A (en) * 2009-07-31 2010-09-15 北京伟晨豪嘉科技有限责任公司 Automatic detection system of embedded type system based on testing script technique
CN101968770A (en) * 2010-11-01 2011-02-09 北京航空航天大学 Reusable embedded software testing and developing method and system
CN102141961A (en) * 2011-03-25 2011-08-03 株洲南车时代电气股份有限公司 Method and system for testing vehicle-mounted software of train
CN102968368A (en) * 2012-08-30 2013-03-13 中国人民解放军63928部队 Embedded test use case design and generation method for traversal scene state diagram
CN103995777A (en) * 2014-05-29 2014-08-20 上海科梁信息工程有限公司 Automatic embedded software block box testing system and method
CN104182341A (en) * 2014-08-22 2014-12-03 上海斐讯数据通信技术有限公司 Scene cleaning method and script testing method of automated testing platform

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030227480A1 (en) * 2002-06-11 2003-12-11 Polk George Allyn Method and apparatus for testing embedded examples in GUI documentation
US20080270996A1 (en) * 2007-04-25 2008-10-30 Samsung Electronics Co., Ltd. Apparatus and method for automatically extracting interface of embedded software
CN101571802A (en) * 2009-06-19 2009-11-04 北京航空航天大学 Visualization automatic generation method of embedded software test data and system thereof
CN101833498A (en) * 2009-07-31 2010-09-15 北京伟晨豪嘉科技有限责任公司 Automatic detection system of embedded type system based on testing script technique
CN101968770A (en) * 2010-11-01 2011-02-09 北京航空航天大学 Reusable embedded software testing and developing method and system
CN102141961A (en) * 2011-03-25 2011-08-03 株洲南车时代电气股份有限公司 Method and system for testing vehicle-mounted software of train
CN102968368A (en) * 2012-08-30 2013-03-13 中国人民解放军63928部队 Embedded test use case design and generation method for traversal scene state diagram
CN103995777A (en) * 2014-05-29 2014-08-20 上海科梁信息工程有限公司 Automatic embedded software block box testing system and method
CN104182341A (en) * 2014-08-22 2014-12-03 上海斐讯数据通信技术有限公司 Scene cleaning method and script testing method of automated testing platform

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
DMITRY EFANOV等: "Testing of relay-contact circuits of railway signalling and interlocking", 《IEEE》 *
周汉清等: "嵌入式软件仿真测试环境实时脚本技术的研究", 《航空标准化与质量》 *
赵伟慧: "基于场景的列控车载设备测试用例自动生成方法研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124883A (en) * 2019-11-15 2020-05-08 苏州浪潮智能科技有限公司 Test case library introduction method, system and equipment based on tree form
CN111124883B (en) * 2019-11-15 2023-01-10 苏州浪潮智能科技有限公司 Test case library introduction method, system and equipment based on tree form
CN112925296A (en) * 2021-01-29 2021-06-08 华南理工大学 Graphical vehicle-mounted network diagnosis method based on artificial intelligence

Also Published As

Publication number Publication date
CN108595317B (en) 2021-06-11

Similar Documents

Publication Publication Date Title
CN106649103B (en) A kind of method and system of Android application program Automated Black Box Testing
CN104793076B (en) Intelligent Auto-Test System and method of testing
CN103529377B (en) The Auto-Test System of intelligent transformer substation digital protection device and method
CN107562969B (en) Method and device for integrating aero-engine control system software
CN112100080B (en) Control testing method and device, terminal equipment and computer readable storage medium
CN106326107B (en) Non-intrusion type embedded software abnormal based on simulated environment handles verification method
CN104699613B (en) A kind of spacecraft-testing demand automatic creation system and its method
CN111782539B (en) Test diagnosis integrated development platform based on domestic operating system
CN112765020A (en) Automatic testing method of computer interlocking system
CN107944193A (en) Avionics semi-matter simulating system
CN103605556A (en) Virtual test subject integrally-constructing system and method
CN104915287B (en) Unit test method and system
CN106201891A (en) A kind of model automatization method of testing and device
CN108984393A (en) A kind of unit testing code automatic generation method and device
CN111176984A (en) Signal-oriented automatic test implementation method
CN108595317A (en) A kind of embedded automated testing method of safety computer of rail transit
CN107080945A (en) Method, device and the electronic equipment of artificial intelligence behavior in test game
CN110286882B (en) Foreground system design and verification method based on model detection
Grenning Applying test driven development to embedded software
Pang et al. Automatic model generation of IEC 61499 function block using net condition/event systems
CN114239459B (en) Processing method, device, equipment and medium for FPGA prototype design file
CN109828922A (en) A kind of General Purpose Automatic Test engine and application method based on the real-time technique of compiling of Python
CN115794624A (en) Closed-loop testing method and system for single automation device of intelligent substation
CN108286972A (en) The intelligent error-checking method and device and hybrid navigation system of data in navigation electronic map
Zheng et al. A Close-Loop Conformance Testing System of IEC 61850.

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
GR01 Patent grant
GR01 Patent grant