CN111723006A - Automatic test frame and industrial computer based on C # - Google Patents

Automatic test frame and industrial computer based on C # Download PDF

Info

Publication number
CN111723006A
CN111723006A CN202010446202.4A CN202010446202A CN111723006A CN 111723006 A CN111723006 A CN 111723006A CN 202010446202 A CN202010446202 A CN 202010446202A CN 111723006 A CN111723006 A CN 111723006A
Authority
CN
China
Prior art keywords
test
layer
instrument
interface
control layer
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
CN202010446202.4A
Other languages
Chinese (zh)
Other versions
CN111723006B (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.)
Sichuan Jiuzhou Electric Group Co Ltd
Original Assignee
Sichuan Jiuzhou Electric Group 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 Sichuan Jiuzhou Electric Group Co Ltd filed Critical Sichuan Jiuzhou Electric Group Co Ltd
Priority to CN202010446202.4A priority Critical patent/CN111723006B/en
Publication of CN111723006A publication Critical patent/CN111723006A/en
Application granted granted Critical
Publication of CN111723006B publication Critical patent/CN111723006B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Landscapes

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

Abstract

The invention discloses a C # based automatic test framework and an industrial personal computer. And the automatic test is completed by taking the control layer as the center and matching layer by layer through the layered design of the automatic test framework. The invention can shorten the test period, improve the test efficiency, stop human errors, reduce the number of testers and improve the cruising ability.

Description

Automatic test frame and industrial computer based on C #
Technical Field
The invention relates to the technical field of automatic testing, in particular to a C # based automatic testing framework and an industrial personal computer.
Background
In product research and development and production tests, tests on functions, performance interfaces and the like of products are required. With the increasingly complex test contents and the increasing test workload, the requirement on the test time is shorter and shorter, the manual test is difficult to meet the requirement, particularly in the multi-channel, multi-frequency point and multi-wave position test, the test parameters of the test items are more, the test time is longer, and before the product leaves the factory, due to time pressure, all the tests are often not completed in time. From the user and social perspective, the quality of products cannot be ignored, and the quality requirements of customers are higher and higher, and many human errors exist in manual testing.
However, most of the existing factories still adopt manual testing, one person is required to be responsible for operating the upper computer software of the equipment in the testing process, the setting steps are complicated, one person is responsible for operating the instrument and reading data for manual recording, and the requirement on testing personnel is high. Due to the fact that the number of test items is large, testing of all parameters is completed, time is long, recorded data are large, the testing process is complex, and human errors exist. In the existing automatic test system, all the processes are customized and depend on a fixed platform, so that the repeated utilization and the continuousness are avoided.
Disclosure of Invention
The invention aims to provide an automatic testing frame and an industrial personal computer based on C #, which can shorten the testing period, improve the testing efficiency, eliminate human errors, reduce the number of testing personnel and improve the cruising ability.
In order to solve the technical problems, the invention adopts a technical scheme that: providing an automatic test framework based on a C #, wherein the automatic test framework comprises an interface layer, a control layer, an instrument driving layer, an interface control layer and a test case layer which are realized through a C # code; the interface layer is used for providing a human-computer interaction interface, recording test information input on the human-computer interaction interface, responding to a starting option on the human-computer interaction interface to generate a test command, and displaying test data generated in the test process, wherein the test information comprises a test item, the connection relation of a test instrument and a tested device; the control layer is used for storing the test information according to the test command, dynamically creating a test item by utilizing reflection and adding the test item into the test case pool, binding an event of the test case layer and an event processing function of the control layer in an asynchronous mode, transmitting the connection relation of the test instrument and the connection relation of the tested equipment to the test item, starting an automatic test thread and starting to sequentially execute the test item in the test case pool; the test case layer is used for running a case execution method to call the instrument driving layer and the interface control layer in an automatic test thread and automatically storing test data generated in the test process in a result document, wherein the test case layer triggers an event processing function of the control layer when generating data in the test process; the instrument and meter driving layer is used for reading an instrument and meter command according to the connection relation of the test instrument and meter to carry out program control on the test instrument and meter when the test items in the test case pool are executed so as to realize connection and disconnection of the test instrument and meter and reading of test data; and the interface control layer is used for calling the interface control class to control the tested equipment according to the connection relation of the tested equipment when the test items in the test case pool are executed so as to realize the connection and disconnection of the tested equipment.
Preferably, the test case layer is further configured to use the XML file as an external input, and implement the replacement of the test item by reading a different XML file.
Preferably, the instrument command is encapsulated using an XML file.
Preferably, the result document is an Excel, Word or text document.
Preferably, the interface control layer comprises a serial port or a network port integrated with C #, and the interface control layer integrates CAN, 429 and 1553B interfaces.
In order to solve the technical problems, the invention adopts a technical scheme that: the industrial personal computer runs any one of the automatic test frames based on the C # when the test instrument is used for testing the tested equipment.
Preferably, the industrial personal computer is provided with a memory, and test data generated in the test process are also stored in the memory.
Different from the prior art, the invention has the beneficial effects that: the automatic test software is used for controlling the tested equipment and the test instrument and meter, the control layer is used as the center, the automatic test is completed layer by layer, the purposes of shortening the test period, improving the test efficiency, avoiding human errors, reducing the number of testers and improving the endurance capacity are achieved, and the automatic test software can be used for repeated work such as multi-frequency point, multi-channel and multi-wave position and the like and test with large data recording quantity. In practice, the same test content is found, manual test needs 2 persons for 24 hours, while the invention only needs 1 person for 4 hours, and the tester does not need any operation while automatic test, thus reducing the requirement on the tester.
Drawings
FIG. 1 is a schematic diagram of a C # based automated test framework according to an embodiment of the present invention;
FIG. 2 is a block diagram of an automated test system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, the automated testing framework based on C # of the embodiment of the present invention includes an interface layer 1, a control layer 2, a test case layer 3, an instrument driver layer 4, and an interface control layer 5, which are implemented by C # code. NETFramework programming language, which completely supports class and object-oriented programming, has consistent basic type set and perfect definition, and also supports functions of automatically generating XML documents and the like.
The interface layer 1 is used for providing a human-computer interaction interface, recording test information input on the human-computer interaction interface, responding to a starting option on the human-computer interaction interface to generate a test command, and displaying test data generated in the test process, wherein the test information comprises a test item, the connection relation of a test instrument and a tested device, and the connection relation of the tested device.
The man-machine interaction interface can be designed with options of starting, pausing, continuing, ending and the like, so that one-key starting test and other user requirements are realized, a corresponding test data header can be automatically generated according to the selection of the test items, and the test data is displayed in the test data header. In addition, the man-machine interaction interface can also be designed with a test result button which can be directly positioned to the test data stored after the test is finished.
And the control layer 2 is used for storing test information according to the test command, dynamically creating a test item by utilizing reflection and adding the test item into the test case pool, binding the event of the test case layer 3 and the event processing function of the control layer 2 in an asynchronous mode, transmitting the connection relation of the test instrument and the connection relation of the tested equipment to the test item, starting an automatic test thread and starting to sequentially execute the test item in the test case pool.
The control layer 2 is the core of the automated testing framework, and connects the interface layer 1, the test case layer 3, the instrument driving layer 4 and the interface control layer 5. When a user clicks a start button on the human-computer interaction interface, the interface layer 1 transmits the test information to the control layer 2, and the control layer 2 stores the test information. After the control layer 2 finishes the preparation work, an automatic test thread is started, the control layer 2 displays the test data on the human-computer interaction interface in real time, and the status bar information of the interface layer 1 can be updated.
And the test case layer 3 is used for running a case execution method to call the instrument driving layer 4 and the interface control layer 5 in an automatic test thread and automatically storing test data generated in the test process in a result document, wherein the test case layer 3 triggers an event processing function of the control layer 2 when generating data in the test process.
The test case layer 3 is also configured to use an XML file as an external input, and implement replacement of the test item by reading a different XML file. Because the test instruments, the judgment standards, the case execution methods, the interfaces and the like used by different test items are different, but each test item relates to the operations, a test case base class can be designed for the test case layer 3, wherein the test case base class comprises a case execution method, parameters needing to be transmitted, test instrument objects, entrustment events needing to transmit test data to the control layer 2 or the interface layer 1 and the like, each test item designs a C # class, the class is derived from the test case base class, the class has all member fields and functions of the base class, and the realization codes of the functions are rewritten in the definition of the derived class.
In the present embodiment, the result document may be Excel, Word, or text document.
And the instrument driving layer 4 is used for reading an instrument command according to the connection relation of the test instrument and the instrument to carry out program control on the test instrument when the test items in the test case pool are executed so as to realize connection and disconnection of the test instrument and the reading of test data.
Wherein the instrument commands may be encapsulated using XML files. Different instrument and meter commands are packaged by using XML files, and when test instruments and meters of different manufacturers are replaced, only the XML files need to be modified or replaced.
And the interface control layer 5 is used for calling the interface control class to control the tested equipment according to the connection relation of the tested equipment when the test items in the test case pool are executed so as to realize the connection and disconnection of the tested equipment.
The interface control layer 5 comprises a serial port or a network port integrated with C #, interfaces of CAN, 429 and 1553B are integrated with interface control types, and a plurality of interfaces CAN be controlled simultaneously.
The interface command of the tested equipment is determined according to the specific protocol of the product, and the testing instrument is selected according to the testing index. When a test instrument and a tested device are replaced, the whole automatic test framework is not affected. The automatic testing framework adopts a layered design mode, is convenient to maintain, can be repeatedly utilized and has high inheritance.
Through the mode, the automatic testing framework based on the C # language can shorten the testing period, improve the testing efficiency, stop human errors, reduce the number of testing personnel and improve the endurance, thereby not only ensuring the testing efficiency and the product quality, but also having the reutilization and the sustainability.
The invention also discloses an industrial personal computer, and the industrial personal computer is shown in figure 2 and is a schematic structural diagram of the automatic test system in the embodiment of the invention. The automatic test system comprises the industrial personal computer 100, the test instrument 200 and the tested device 300, wherein the industrial personal computer 100 runs the C # based automatic test framework of the embodiment when the test instrument 200 is used for testing the tested device 300. The industrial personal computer 100 has a memory, and test data generated during the test process is also stored in the memory.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (7)

1. The automated testing framework based on the C # is characterized by comprising an interface layer, a control layer, an instrument driving layer, an interface control layer and a testing case layer, wherein the interface layer, the control layer, the instrument driving layer, the interface control layer and the testing case layer are realized through C # codes;
the interface layer is used for providing a human-computer interaction interface, recording test information input on the human-computer interaction interface, responding to a starting option on the human-computer interaction interface to generate a test command, and displaying test data generated in the test process, wherein the test information comprises a test item, the connection relation of a test instrument and a tested device;
the control layer is used for storing the test information according to the test command, dynamically creating a test item by utilizing reflection and adding the test item into the test case pool, binding an event of the test case layer and an event processing function of the control layer in an asynchronous mode, transmitting the connection relation of the test instrument and the connection relation of the tested equipment to the test item, starting an automatic test thread and starting to sequentially execute the test item in the test case pool;
the test case layer is used for running a case execution method to call the instrument driving layer and the interface control layer in an automatic test thread and automatically storing test data generated in the test process in a result document, wherein the test case layer triggers an event processing function of the control layer when generating data in the test process;
the instrument and meter driving layer is used for reading an instrument and meter command according to the connection relation of the test instrument and meter to carry out program control on the test instrument and meter when the test items in the test case pool are executed so as to realize connection and disconnection of the test instrument and meter and reading of test data;
and the interface control layer is used for calling the interface control class to control the tested equipment according to the connection relation of the tested equipment when the test items in the test case pool are executed so as to realize the connection and disconnection of the tested equipment.
2. The C # based automated testing framework of claim 1, wherein the test case layer is further configured to use XML files as external input to enable replacement of test items by reading different XML files.
3. The C # based automated testing framework of claim 1, wherein the instrumentation commands are encapsulated using XML files.
4. The automated testing framework of claim 1, wherein the result document is an Excel, Word, or text document.
5. The automated test framework of claim 4, wherein the interface control layer comprises a serial or network port integrated with C #, and the interface control class integrates CAN, 429 and 1553B interfaces.
6. An industrial personal computer, characterized in that the industrial personal computer runs the C # based automated testing framework according to any one of claims 1 to 5 when testing a device under test with a testing instrument.
7. The industrial personal computer of claim 6, wherein the industrial personal computer has a memory, and test data generated during a test process is further stored in the memory.
CN202010446202.4A 2020-05-25 2020-05-25 Automatic test frame and industrial computer based on C # Active CN111723006B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010446202.4A CN111723006B (en) 2020-05-25 2020-05-25 Automatic test frame and industrial computer based on C #

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010446202.4A CN111723006B (en) 2020-05-25 2020-05-25 Automatic test frame and industrial computer based on C #

Publications (2)

Publication Number Publication Date
CN111723006A true CN111723006A (en) 2020-09-29
CN111723006B CN111723006B (en) 2022-03-08

Family

ID=72564903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010446202.4A Active CN111723006B (en) 2020-05-25 2020-05-25 Automatic test frame and industrial computer based on C #

Country Status (1)

Country Link
CN (1) CN111723006B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050183090A1 (en) * 1998-10-02 2005-08-18 Microsoft Corporation Tools and techniques for instrumenting interfaces of units of a software program
CN102158370A (en) * 2011-04-12 2011-08-17 瑞斯康达科技发展股份有限公司 Automated testing method and system
CN102377609A (en) * 2010-08-17 2012-03-14 盛科网络(苏州)有限公司 Platform-independent automatic test case and virtual test instrument
CN106646315A (en) * 2016-12-30 2017-05-10 福建利利普光电科技有限公司 Automatic testing system and automatic testing method for digital measuring instruments
CN107122301A (en) * 2017-04-27 2017-09-01 武汉斗鱼网络科技有限公司 Interface detection method and device
CN107341099A (en) * 2017-05-23 2017-11-10 烽火通信科技股份有限公司 The automatic test cases generation system and generation method of a kind of instrument arrangement
CN110865262A (en) * 2019-11-29 2020-03-06 广东电网有限责任公司 Universal test method, device and equipment for relay protection tester and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050183090A1 (en) * 1998-10-02 2005-08-18 Microsoft Corporation Tools and techniques for instrumenting interfaces of units of a software program
CN102377609A (en) * 2010-08-17 2012-03-14 盛科网络(苏州)有限公司 Platform-independent automatic test case and virtual test instrument
CN102158370A (en) * 2011-04-12 2011-08-17 瑞斯康达科技发展股份有限公司 Automated testing method and system
CN106646315A (en) * 2016-12-30 2017-05-10 福建利利普光电科技有限公司 Automatic testing system and automatic testing method for digital measuring instruments
CN107122301A (en) * 2017-04-27 2017-09-01 武汉斗鱼网络科技有限公司 Interface detection method and device
CN107341099A (en) * 2017-05-23 2017-11-10 烽火通信科技股份有限公司 The automatic test cases generation system and generation method of a kind of instrument arrangement
CN110865262A (en) * 2019-11-29 2020-03-06 广东电网有限责任公司 Universal test method, device and equipment for relay protection tester and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
TAEKSU KIM 等: ""Concolic Testing Framework for Industrial Embedded Software"", 《2014 21ST ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE》 *
赵文琦: ""面向WEB的自动测试框架的设计与实现"", 《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》 *
陈智嘉: ""仪器仪表自动测试系统的架构"", 《华章》 *

Also Published As

Publication number Publication date
CN111723006B (en) 2022-03-08

Similar Documents

Publication Publication Date Title
US8881105B2 (en) Test case manager
TWI221923B (en) Electronic test system and method
CN110232014A (en) Operation flow automated testing method, device, controller and medium
CN110362483A (en) Performance data acquisition method, device, equipment and storage medium
CN110703741A (en) Multifunctional communication debugging equipment
CN101853155A (en) Method and device for automatically sending AT command
CN113760956A (en) Universal engine calibration system based on ASAP standard
US6581169B1 (en) Method and device for automatic computer testing on a plurality of computers through a local area network
Dzida Standards for user-interfaces
CN102231127B (en) System and method for detecting BIOS (Basic Input Output System) wrong information display
CN107064703A (en) A kind of high-voltaghe compartment automatic testing method and its system
CN111723006B (en) Automatic test frame and industrial computer based on C #
CN112579438B (en) Multifunctional automatic test tool and test method
CN104123104B (en) Daily record control system and method
CN116599864A (en) Communication test system, method, equipment and storage medium for automatic interface generation and use case modular development
CN108877806B (en) Test verification system for test instruction type voice control system
CN100570576C (en) A kind of method of testing of embedded system and system
US20090059000A1 (en) System and method for capturing debug information using a peripheral device
JP2004003960A (en) Programable system equipped with gravimetric apparatus, method of programming such a system and software executing the method
CN112027111A (en) Real-time acquisition and display method and system for aircraft bus data
CN101887087B (en) Automatic test system and operating method and instrument control device thereof
CN110335637B (en) Method and device for testing storage equipment and equipment
CN105824684B (en) A kind of implementation method of multi-mode big data software simulator
CN102854875B (en) Automobile air conditioner controller testing method and system
CN117573200B (en) Dynamic configurable equivalent device system and flow configuration method

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