CN113934640A - Method and system for automatically testing software - Google Patents

Method and system for automatically testing software Download PDF

Info

Publication number
CN113934640A
CN113934640A CN202111325461.2A CN202111325461A CN113934640A CN 113934640 A CN113934640 A CN 113934640A CN 202111325461 A CN202111325461 A CN 202111325461A CN 113934640 A CN113934640 A CN 113934640A
Authority
CN
China
Prior art keywords
test
server
code
software
script
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
CN202111325461.2A
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.)
Hozon New Energy Automobile Co Ltd
Original Assignee
Hozon New Energy Automobile 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 Hozon New Energy Automobile Co Ltd filed Critical Hozon New Energy Automobile Co Ltd
Priority to CN202111325461.2A priority Critical patent/CN113934640A/en
Publication of CN113934640A publication Critical patent/CN113934640A/en
Pending legal-status Critical Current

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/3688Test management for test execution, e.g. scheduling of test suites
    • 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/368Test management for test version control, e.g. updating test cases to a new software version

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 a method and a system for automatically testing software, which save the test time and improve the test accuracy, thereby saving the resource overhead, improving the test efficiency and reducing the test cost. The technical scheme is as follows, and the system comprises: the version control system receives source codes submitted by software developers; the continuous integration server receives input from the version control system by using a pipeline script mechanism through a Jenkins server deployed on the continuous integration server, automatically performs code synchronization, compilation, downloading, static code check, dynamic code check and integration test, and feeds back test reports of all stages including compilation, static code check, dynamic code check and integration test stages; the hardware equipment tool is connected with the continuous integration server and the electronic control unit and interacts network data with the continuous integration server; and the electronic control unit runs the software codes and performs function control on the message data through the continuous integration server.

Description

Method and system for automatically testing software
Technical Field
The invention relates to a software testing technology, in particular to a method and a system for automatically testing a software code which is updated quickly and iteratively.
Background
With the rapid iterative update of automobile Electronic Control Unit (ECU) software, the workload of static code testing, dynamic code testing, integrated testing and the like is greatly increased, a large amount of resources such as manpower, time, hardware and the like are consumed by only depending on manual testing, and the efficiency and the quality of the testing cannot be ensured.
Disclosure of Invention
The following presents a simplified summary of one or more aspects in order to provide a basic understanding of such aspects. This summary is not an extensive overview of all contemplated aspects, and is intended to neither identify key or critical elements of all aspects nor delineate the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that is presented later.
The invention aims to solve the problems and provides a method and a system for automatically testing software, which can save the time consumed by testing and improve the accuracy of software testing, thereby saving the resource overhead, improving the testing efficiency and reducing the testing cost.
The technical scheme of the invention is as follows: the invention discloses a system for automatically testing software, which comprises a version control system, a continuous integration server, a hardware equipment tool and an electronic control unit, wherein:
a version control system configured to receive source code submitted from a software developer;
the continuous integration server is configured to receive input from the version control system by using a pipeline script mechanism through a Jenkins server deployed on the server, automatically perform code synchronization, compilation, downloading, static code check, dynamic code check and integration test, and feed back test reports of all stages including compilation, static code check, dynamic code check and integration test stages;
the hardware equipment tool is configured to be connected with the continuous integration server and the electronic control unit and interact network data with the continuous integration server;
and the electronic control unit is configured to run software codes and perform function control on the message data through the continuous integration server.
According to one embodiment of the software automatic testing system, data of the version control system are transmitted to the continuous integration server, and the hardware equipment tools are in bidirectional data connection with the continuous integration server and the electronic control unit respectively.
According to an embodiment of the system for software automated testing of the present invention, the version control system includes an open source version control system or a distributed version control system.
According to one embodiment of the system for software automated testing of the present invention, the network data of the hardware device tool interacting with the persistent integration server is CAN/CANFD data.
According to an embodiment of the system for software automation test of the present invention, the specific process configured by the persistent integration server includes:
automatically synchronizing source codes on a version control system through a pipeline script;
calling a compiling script of the code engineering, compiling the source code, and feeding back a result after compiling is completed;
downloading the compiled executable file to an electronic control unit through a hardware device tool;
calling an LDRA static code test script to perform static analysis on the codes, and feeding back a static analysis result;
calling a VectorCast dynamic testing tool to perform dynamic code analysis on the codes, and feeding back a dynamic analysis result;
and calling a Canoe integration test script to carry out integration test, and feeding back an integration test report.
The invention also discloses a software automatic testing method, which comprises the following steps:
step 1: a server of the version control system receives source codes submitted by software developers;
step 2: the continuous integration server receives input from a version control system by using a pipeline script mechanism through a Jenkins server deployed on the continuous integration server, automatically performs code synchronization, compilation, downloading, static code check, dynamic code check and integration test, and feeds back test reports of all stages including compilation, static code check, dynamic code check and integration test stages.
According to an embodiment of the method for automatically testing software, the version control system comprises an open source version control system or a distributed version control system.
According to an embodiment of the method for automatically testing software of the present invention, step 2 further includes:
the method comprises the steps that a Jenkins server deployed on a continuous integration server automatically synchronizes source codes on a version control system server, a compiling command is called to carry out automatic compiling and feed back a compiling result, and meanwhile a downloading script is called to download a compiled executable file into an electronic control unit;
calling a static code detection script by Jenkins deployed on the continuous integration server, executing a static code detection command on a source code, and feeding back a static test report so that a developer can prompt contents to repair errors of the code according to the static test report;
calling a dynamic code test script by Jenkins deployed on the continuous integration server, executing a dynamic code inspection command on a source code, and feeding back a dynamic test report so that a developer can repair errors of the code according to the prompt content of the dynamic test report;
and calling the integration test script by Jenkins deployed on the continuous integration server, executing an integration test command on the codes downloaded into the electronic control unit, and feeding back an integration test report so that a developer can repair errors of the codes according to the prompt content of the integration test report.
According to an embodiment of the software automation testing method, the static code testing script is an LDRA script written by Python, the dynamic code testing script is a VectorCast script, and the integrated testing script is a CAPL script in Canoe.
Compared with the prior art, the invention has the following beneficial effects: the method and the system realize the automatic test of the software by using the Jenkins server, the server automatically performs code synchronization, compiling, downloading, static code check, dynamic code check and integrated test, and feeds the test report of each stage back to developers in time, thereby covering the whole process of software development, overcoming the defects of low efficiency, low quality, high cost and the like of manual test, effectively improving the quality of project development and reducing the development cost.
Drawings
The above features and advantages of the present disclosure will be better understood upon reading the detailed description of embodiments of the disclosure in conjunction with the following drawings. In the drawings, components are not necessarily drawn to scale, and components having similar relative characteristics or features may have the same or similar reference numerals.
FIG. 1 illustrates a schematic diagram of one embodiment of a system for software automation testing of the present invention.
FIG. 2 illustrates a flow diagram of one embodiment of a method of software automation testing of the present invention.
Fig. 3 shows a schematic diagram of Jenkins technology used in the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments. It is noted that the aspects described below in connection with the figures and the specific embodiments are only exemplary and should not be construed as imposing any limitation on the scope of the present invention.
FIG. 1 illustrates the principles of one embodiment of the system for software automation testing of the present invention. Referring to fig. 1, the system of the present embodiment includes: a version Control system, a persistent integration Server (CI Server), a hardware device tool (e.g., hardware of a vector or hardware of a pca), and an Electronic Control Unit (ECU). The version control system in this embodiment comprises: an open source version control system (SVN, i.e., subversion) or a distributed version control system (Git).
The data transmission relationship among the modules is as follows: and the data of the version control system is transmitted to the continuous integration server, and the hardware equipment tool is in bidirectional data connection with the continuous integration server and the electronic control unit respectively.
The version control system receives source codes submitted by software developers and synchronizes the source codes to the continuous integration server through Jenkins scripts.
The continuous integration server receives input from a version control system by a Pipeline (Pipeline) script mechanism through a deployed Jenkins server, automatically performs code synchronization, compilation, downloading, static code check, dynamic code check and integration test, and feeds back test reports of all stages including compilation, static code check, dynamic code check and integration test. The function of the Jenkins server used in this embodiment is shown in fig. 3. The specific process of continuing the integration server is as follows.
Automatically synchronizing source codes on a version control system through a pipeline script;
calling a compiling script of the code engineering, compiling the source code, and feeding back a result after compiling is completed, for example, sending the result to a project group personnel through a mail group to inform the result;
downloading the compiled executable file to an electronic control unit through a hardware device tool (such as a Vector tool/a Pcan tool);
calling an LDRA (lightweight Data Research associates) static code test script to perform static analysis on a source code, and feeding back a static analysis result, for example, sending a static test report to a project group member by a mail group;
calling a VectorCast dynamic testing tool to perform dynamic source code analysis on the codes, and feeding back a dynamic analysis result, for example, sending a dynamic test report to a project group member in a group by an email;
and calling a Canoe integration test script to carry out integration test on the code downloaded into the ECU, and feeding back an integration test report, for example, sending the integration test report to a member of the project group by group through the mail.
And the hardware equipment tool is used for realizing the function of connecting the continuous integration server and the electronic control unit and carrying out the interaction of CAN/CAN FD network data with the continuous integration server.
The electronic control unit is used for realizing the function of running software codes and carrying out function control on the message data through the continuous integrated server.
FIG. 2 illustrates the flow of one embodiment of a method of software automation testing of the present invention. Referring to fig. 2, with reference to the platform system for software automation test shown in fig. 1, each step of the method of the embodiment is described in detail as follows.
Step 1: a server of a version control system receives source code submitted from a software developer.
The version control system in this embodiment comprises: an open source version control system (SVN, i.e., subversion) or a distributed version control system (Git).
Step 2: and the Jenkins server deployed on the continuous integration server automatically synchronizes codes on the version control system server, calls a compiling command to automatically compile, sends a compiling result to a project group member through a mail group, and calls a downloading script to download the compiled executable file to the electronic control unit.
And step 3: jenkins deployed on the continuous integration server calls a static code written by Python to detect an LDRA script, a static code check command is executed, automatic static analysis is carried out on a source code, a static test report is sent to a group member of a project group, and a developer receives a mail and then corrects the error of the code according to the report prompt content.
And 4, step 4: and calling a dynamic code test VectorCast script by Jenkins deployed on the continuous integration server, executing a dynamic code check command, automatically and dynamically analyzing a source code, sending a dynamic test report to the members of the project group in a group, and repairing errors of the code according to the report prompt content after a developer receives the mail.
And 5: jenkins deployed on the continuous integration server call a CAPL (communication Access Programming language) script in the integration test Canoe, execute an integration test command, perform integration test on codes downloaded into the ECU, send an integration test report to the members of the project group in a group, and after receiving an email, developers prompt the content to repair errors of the codes according to the report.
While, for purposes of simplicity of explanation, the methodologies are shown and described as a series of acts, it is to be understood and appreciated that the methodologies are not limited by the order of acts, as some acts may, in accordance with one or more embodiments, occur in different orders and/or concurrently with other acts from that shown and described herein or not shown and described herein, as would be understood by one skilled in the art.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The various illustrative logical blocks, modules, and circuits described in connection with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
In one or more exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software as a computer program product, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a web site, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk (disk) and disc (disc), as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk and blu-ray disc where disks (disks) usually reproduce data magnetically, while discs (discs) reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A system for software automated testing, the system comprising a version control system, a persistent integration server, hardware device tools, and an electronic control unit, wherein:
a version control system configured to receive source code submitted from a software developer;
the continuous integration server is configured to receive input from the version control system by using a pipeline script mechanism through a Jenkins server deployed on the server, automatically perform code synchronization, compilation, downloading, static code check, dynamic code check and integration test, and feed back test reports of all stages including compilation, static code check, dynamic code check and integration test stages;
the hardware equipment tool is configured to be connected with the continuous integration server and the electronic control unit and interact network data with the continuous integration server;
and the electronic control unit is configured to run software codes and perform function control on the message data through the continuous integration server.
2. The system for software automation test as claimed in claim 1, wherein the data of the version control system is transmitted to the persistent integration server, and the hardware device tool is in bidirectional data connection with the persistent integration server and the electronic control unit respectively.
3. The system for automated testing of software according to claim 1, wherein the versioning system comprises an open source versioning system or a distributed versioning system.
4. The system for automated testing of software of claim 1, wherein the network data of hardware device tool interaction with the persistent integration server is CAN/CANFD data.
5. The system for automated testing of software of claim 1, wherein the specific processes configured by the persistent integration server comprise:
automatically synchronizing source codes on a version control system through a pipeline script;
calling a compiling script of the code engineering, compiling the source code, and feeding back a result after compiling is completed;
downloading the compiled executable file to an electronic control unit through a hardware device tool;
calling an LDRA static code test script to perform static analysis on the codes, and feeding back a static analysis result;
calling a VectorCast dynamic testing tool to perform dynamic code analysis on the codes, and feeding back a dynamic analysis result;
and calling a Canoe integration test script to carry out integration test, and feeding back an integration test report.
6. A method for automatically testing software is characterized by comprising the following steps:
step 1: a server of the version control system receives source codes submitted by software developers;
step 2: the continuous integration server receives input from a version control system by using a pipeline script mechanism through a Jenkins server deployed on the continuous integration server, automatically performs code synchronization, compilation, downloading, static code check, dynamic code check and integration test, and feeds back test reports of all stages including compilation, static code check, dynamic code check and integration test stages.
7. The method for software automation testing according to claim 6, wherein the version control system comprises an open source version control system or a distributed version control system.
8. The method for the automated testing of software according to claim 6, wherein step 2 further comprises:
the method comprises the steps that a Jenkins server deployed on a continuous integration server automatically synchronizes source codes on a version control system server, a compiling command is called to carry out automatic compiling and feed back a compiling result, and meanwhile a downloading script is called to download a compiled executable file into an electronic control unit;
calling a static code detection script by Jenkins deployed on the continuous integration server, executing a static code detection command on a source code, and feeding back a static test report so that a developer can prompt contents to repair errors of the code according to the static test report;
calling a dynamic code test script by Jenkins deployed on the continuous integration server, executing a dynamic code inspection command on a source code, and feeding back a dynamic test report so that a developer can repair errors of the code according to the prompt content of the dynamic test report;
and calling the integration test script by Jenkins deployed on the continuous integration server, executing an integration test command on the codes downloaded into the electronic control unit, and feeding back an integration test report so that a developer can repair errors of the codes according to the prompt content of the integration test report.
9. The method for software automation testing according to claim 8, wherein the static code test script is a LDRA script written in Python, the dynamic code test script is a VectorCast script, and the integrated test script is a CAPL script in Canoe.
CN202111325461.2A 2021-11-10 2021-11-10 Method and system for automatically testing software Pending CN113934640A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111325461.2A CN113934640A (en) 2021-11-10 2021-11-10 Method and system for automatically testing software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111325461.2A CN113934640A (en) 2021-11-10 2021-11-10 Method and system for automatically testing software

Publications (1)

Publication Number Publication Date
CN113934640A true CN113934640A (en) 2022-01-14

Family

ID=79286060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111325461.2A Pending CN113934640A (en) 2021-11-10 2021-11-10 Method and system for automatically testing software

Country Status (1)

Country Link
CN (1) CN113934640A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116185815A (en) * 2022-11-17 2023-05-30 北京东方通科技股份有限公司 Software performance test simulation method and system
CN117354208A (en) * 2023-09-28 2024-01-05 广州翼辉信息技术有限公司 CI/CD-based automatic test method and system for CODESYS bus protocol stack

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116185815A (en) * 2022-11-17 2023-05-30 北京东方通科技股份有限公司 Software performance test simulation method and system
CN116185815B (en) * 2022-11-17 2023-12-08 北京东方通科技股份有限公司 Software performance test simulation method and system
CN117354208A (en) * 2023-09-28 2024-01-05 广州翼辉信息技术有限公司 CI/CD-based automatic test method and system for CODESYS bus protocol stack
CN117354208B (en) * 2023-09-28 2024-04-16 广州翼辉信息技术有限公司 Automatic CODESYS bus protocol stack testing method and system based on CI/CD

Similar Documents

Publication Publication Date Title
US20190108001A1 (en) Correction of code errors using machine learning
US20230244465A1 (en) Systems and methods for automated retrofitting of customized code objects
CN105446712B (en) Application program defect repairing method and device
CN108595342B (en) Unit testing method and device
CN113934640A (en) Method and system for automatically testing software
CN111488136A (en) Continuous integration and continuous delivery method, system, device and storage medium
CN104932973A (en) Version compatibility test method and apparatus
CN112131116B (en) Automatic regression testing method for embedded software
US10496379B2 (en) Facilitated production of code for software testing
JP2015011372A (en) Debug support system, method, program, and recording medium
CN104503772A (en) Operating system installation and test environment establishment method and device based on virtual machine
CN111966760A (en) Hive data warehouse-based test data generation method and device
CN110221840B (en) Function implementation method and device of application program, equipment and storage medium
CN110688112A (en) Automatic storage method and system for multi-project collinear development codes
CN114138633A (en) Method, device and equipment for testing software based on data driving and readable medium
CN110968339B (en) Method and device for front-end building tool and electronic equipment
CN101267645B (en) Automatic test method and system for service flow software development of W base station
CN116305118A (en) Method, device, electronic equipment and medium for static detection of increment codes
CN110321138B (en) Program updating and migration method and device
CN111142848A (en) Software program compiling method, software program executing method and software program compiling device
US20220318005A1 (en) Generation of software program repair explanations
CN114064467A (en) Resource analysis method and device, electronic equipment and storage medium
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
CN114416103A (en) Code compiling method and device, computer readable medium and electronic equipment
CN112241268A (en) Keil engineering compiling method, system and equipment

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
CB02 Change of applicant information

Address after: 314500 988 Tong Tong Road, Wu Tong Street, Tongxiang, Jiaxing, Zhejiang

Applicant after: United New Energy Automobile Co.,Ltd.

Address before: 314500 988 Tong Tong Road, Wu Tong Street, Tongxiang, Jiaxing, Zhejiang

Applicant before: Hezhong New Energy Vehicle Co.,Ltd.

CB02 Change of applicant information