CN108121658B - Method for testing LINUX end tested software based on WINDOWS end testing tool - Google Patents
Method for testing LINUX end tested software based on WINDOWS end testing tool Download PDFInfo
- Publication number
- CN108121658B CN108121658B CN201711228114.1A CN201711228114A CN108121658B CN 108121658 B CN108121658 B CN 108121658B CN 201711228114 A CN201711228114 A CN 201711228114A CN 108121658 B CN108121658 B CN 108121658B
- Authority
- CN
- China
- Prior art keywords
- linux
- windows
- tested software
- test
- testing
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
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 for testing LINUX end tested software based on WINDOWS end testing tool, firstly configuring file sharing unit and remote access unit at LINUX end, then modifying configuration file at LINUX end to make WINDOWS end computer able to run command on LINUX end computer, mapping network disk at WINDOWS end through resource manager to make WINDOWS end testing tool able to access LINUX end tested software and testing result file through hard disk character.
Description
Technical Field
The invention relates to a method for testing a LINUX end tested software based on a WINDOWS end testing tool, which is suitable for unit testing of C language embedded software running in a LINUX environment.
Background
Software unit testing is a fundamental item of software testing. In the fields with higher safety requirements such as aerospace and aviation, higher requirements are provided for software unit tests (for example, on the basis of meeting functional correctness, statement coverage and branch coverage reach 100 percent and the like).
At present, the software unit testing tools are more in types, but only support one operation environment, namely, the software unit testing tools operate in a WINDOWS environment or a LINUX environment. Due to reasons of environment universality and the like, most of software unit testing tools used by each unit at present are based on WINDOWS operating environment, and unit testing tools based on LINUX environment are less used. However, in engineering practice, some tested software can only be compiled in the LINUX environment, and unit testing of the software requires purchasing of a unit testing tool of an individual LINUX environment, which requires additional expenditure support and a certain purchasing period.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: in order to overcome the defects of the prior art, a method for testing the tested software of the LINUX terminal based on a WINDOWS terminal testing tool is provided, so that the tested software under the LINUX environment can be subjected to unit testing and coverage rate analysis at the WINDOWS terminal.
The technical solution of the invention is as follows:
a method for testing LINUX end tested software based on WINDOWS end testing tool, the testing tool comprises a compiling unit, a test input unit and an expected result setting unit, and the method comprises the following steps:
(1) configuring a file sharing unit at the LINUX end so that the file of the LINUX end can be accessed from the WINDOWS end; a remote access unit is configured at the LINUX end, so that the command of the LINUX end can be remotely executed from the WINDOWS end;
(2) setting a configuration file for specifying an ip address and a user name of a computer which can be remotely accessed at a LINUX end, so that a WINDOWS end computer which is consistent with the ip address and the user name set in the configuration file can execute an instruction on the LINUX end computer;
(3) mapping a path of storing the tested software in the LINUX end to a network disk at the WINDOWS end through a resource manager, so that a WINDOWS end testing tool can access the tested software of the LINUX end and a testing result file generated after the tested software is executed through a network disk character;
(4) setting test input data through a test input unit of a WINDOWS end test tool according to the requirements of a design document of tested software, setting an expected test result of the tested software according to the requirements of the design document of the tested software through an expected result setting unit, modifying a compiling unit of the WINDOWS end test tool, adding an ip address and a user name of a LINUX end computer which can be remotely accessed on the basis of an original compiling unit, forming a modified compiling unit, and enabling the WINDOWS end test tool to remotely execute a compiling execution instruction of the LINUX end;
(5) reading the tested software of the LINUX end by using a WINDOWS end testing tool through the network disk sign, calling the modified compiling unit to remotely execute the compiling execution instruction of the LINUX end, compiling the tested software and the test input data, generating a test result file at the LINUX end, reading the test result file from the WINDOWS end testing tool through the network disk sign, comparing the test result file with the expected test result in the step 4, and if the test result file is not consistent with the expected test result, indicating that the tested software has defects; if the two are consistent, entering step 6;
(6) and (3) analyzing the test result file read in the step (5) by using a WINDOWS end test tool, analyzing statement coverage and branch coverage, if the coverage of the statement coverage and the branch coverage do not reach 100%, entering the step (5), adding new test input data according to the requirement of the design document of the tested software, if the coverage of the statement coverage and the branch coverage reach 100%, indicating that the tested software meets the requirement, and if the coverage of the statement coverage and the branch coverage do not reach 100%, indicating that the tested software has defects.
And 6, when new test input data is added, inputting according to the requirement of the design document of the tested software on the range of the test input data.
And 6, when new test input data is added, inputting data beyond the range requirement of the test input data in the design document of the tested software.
The compiling unit in step 4 can be selectively configured according to the compiler used by the software under test, so as to ensure that the compiler used by the test tool is consistent with the compiler used by the software under test.
And (4) analyzing the accumulated values of statement coverage and branch coverage by using a test tool, wherein the statement coverage and the branch coverage in the step 6 reach 100%, and all statements and branches in the tested software are required to be executed.
Compared with the prior art, the invention has the advantages that:
(1) the invention solves the problem of performing unit test on the tested software of the LINUX terminal based on the WINDOWS environment testing tool, can access the tested software and the testing result file of the LINUX terminal from the WINDOWS environment testing tool through configuration, and implement remote access on the LINUX terminal, has the characteristics of simple configuration, no influence on the basic flow of the test and the like, and provides a simple, convenient and practical method for expanding the application range of the existing testing tool;
(2) the invention can remotely execute the compiling execution instruction of the LINUX end from the WINDOWS end testing tool by modifying the compiling unit of the WINDOWS end testing tool, the test data input process and the expected result setting process are both carried out at the WINDOWS end, and the requirements of statement coverage rate and branch coverage rate are satisfied on the basis of verifying the functional correctness of the tested software;
(3) the method can expand the application range of WINDOWS end testing tools, and the cross-platform thought and method adopted by the method can be expanded to the scenes that other WINDOWS end software needs to access the files of the LINUX end or run the programs of the LINUX end, and has no influence on the original testing process.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
As shown in FIG. 1, the method for testing LINUX end software under test based on WINDOWS end testing tool of the present invention comprises modifying LINUX end remote access configuration file by configuration file sharing unit and remote access unit, mapping LINUX end to store the tested software path as network disk, setting test input data and expected result data, modifying compiling unit of WINDOWS end testing tool, reading LINUX end software under test by network disk character, remotely executing LINUX end compiling execution instruction by modifying compiling unit, reading test result file by network disk character, comparing test result file with expected test result, analyzing test result file by statement coverage and branch coverage, etc. The content of the compiling and executing instruction is to call a compiler to compile and execute the tested software and generate a test result file.
The standard unit test process in WINDOWS environment is as follows: the method comprises the steps of reading tested software by using a testing tool, setting test input data and expected result data, running a compiling execution instruction to compile and execute the test input data and the tested software to obtain a test result file, comparing the test result file with an expected test result, and analyzing statement coverage and branch coverage of the test result file. The content of the compiling and executing instruction is to call a compiler to compile and execute the tested software and generate a test result file.
In the process, the source code of the software to be tested and the test result file are both positioned at the LINUX end, so that the problem of how to read the LINUX end file from the WINDOWS end is firstly solved; secondly, the problem of how to compile the execution instruction from the WINDOW end to the LINUX end needs to be solved. The above problem can be solved by configuring the file sharing unit and the remote access unit at the LINUX side.
Configuration file sharing unit and remote access unit
Firstly, the problem of reading the LINUX side files from the WINDOWS side needs to be solved, which is accomplished by configuring the file sharing unit (installing and running the file sharing unit software at the LINUX side).
Secondly, the problem that a test tool at the WINDOWS end executes a compiling and executing instruction at the LINUX end needs to be solved, a remote access unit (remote access unit software is installed and operated at the LINUX end) needs to be configured firstly, and a configuration file used for remote access at the WINDOWS end is modified on the basis.
The process of modifying the remote access profile is as follows:
and modifying the rhosts file at the LINUX end to enable the computer at the WINDOWS end to run the RSH command on the LINUX end computer, wherein the specific method is that the following codes are added in the rhosts file: IP address root (user name) of a WINDOWS end computer; .
Modifying WINDOWS end test tool compiling unit
After the configuration file sharing unit and the remote access unit are configured, the compiling unit of the WINDOWS terminal testing tool needs to be modified, and the specific mode is as follows: adding an ip address and a user name of a LINUX end computer for remote access on the basis of the original compiling unit to form a modified compiling unit: the method aims to enable a WINDOWS terminal testing tool to run the compiling and executing instruction of the LINUX terminal through remote access.
Testing by using WINDOWS end testing tool after compiling unit is modified
After the configuration is completed, a WINDOWS terminal testing tool after the compiling unit is modified is used for carrying out unit testing according to the standard unit testing process, and the specific process is as follows: reading tested software from a WINDOWS end testing tool, setting test input data and expected result data, running a compiling execution instruction to compile the test input data and the tested software to obtain a test result file, comparing the test result file with an expected test result, and analyzing statement coverage and branch coverage of the test result file.
The invention can remotely access and operate the compiling execution instruction of the LINUX end from the WINDOWS end testing tool by modifying the compiling unit of the WINDOWS end testing tool, the test data input process and the expected result setting process are carried out at the WINDOWS end, and the requirements of statement coverage rate and branch coverage rate are satisfied on the basis of verifying the functional correctness of the tested software;
the method can expand the application range of WINDOWS end testing tools, and the cross-platform thought and method adopted by the method can be expanded to the scenes that other WINDOWS end software needs to access the files of the LINUX end or run the programs of the LINUX end, and has no influence on the original testing process.
Those skilled in the art will appreciate that those matters not described in detail in the present specification are well known in the art.
Claims (5)
1. The method for testing the LINUX end tested software based on the WINDOWS end testing tool comprises a compiling unit, a test input unit and an expected result setting unit, and is characterized by comprising the following specific steps of:
(1) configuring a file sharing unit at the LINUX end so that the file of the LINUX end can be accessed from the WINDOWS end; a remote access unit is configured at the LINUX end, so that the command of the LINUX end can be remotely executed from the WINDOWS end;
(2) setting a configuration file for specifying an ip address and a user name of a computer which can be remotely accessed at a LINUX end, so that a WINDOWS end computer which is consistent with the ip address and the user name set in the configuration file can execute an instruction on the LINUX end computer;
(3) mapping a path of storing the tested software in the LINUX end to a network disk at the WINDOWS end through a resource manager, so that a WINDOWS end testing tool can access the tested software of the LINUX end and a testing result file generated after the tested software is executed through a network disk character;
(4) setting test input data through a test input unit of a WINDOWS end test tool according to the requirements of a design document of tested software, setting an expected test result of the tested software according to the requirements of the design document of the tested software through an expected result setting unit, modifying a compiling unit of the WINDOWS end test tool, adding an ip address and a user name of a LINUX end computer which can be remotely accessed on the basis of an original compiling unit, forming a modified compiling unit, and enabling the WINDOWS end test tool to remotely execute a compiling execution instruction of the LINUX end;
(5) reading the tested software of the LINUX end by using a WINDOWS end testing tool through the network disk sign, calling the modified compiling unit to remotely execute the compiling execution instruction of the LINUX end, compiling the tested software and the test input data, generating a test result file at the LINUX end, reading the test result file from the WINDOWS end testing tool through the network disk sign, comparing the test result file with the expected test result in the step 4, and if the test result file is not consistent with the expected test result, indicating that the tested software has defects; if the two are consistent, entering step 6;
(6) and (5) analyzing the test result file read in the step (5) by using a WINDOWS end test tool, analyzing statement coverage and branch coverage, if the coverage of the statement coverage and the branch coverage does not reach 100%, entering the step (5), adding new test input data according to the requirement of the design document of the tested software, and if the coverage of the statement coverage and the branch coverage reaches 100%, indicating that the tested software meets the requirement.
2. The method for testing the tested software of the LINUX terminal based on the WINDOWS terminal testing tool according to claim 1, wherein: and 6, when new test input data is added, inputting according to the requirement of the design document of the tested software on the range of the test input data.
3. The method for testing the tested software of the LINUX terminal based on the WINDOWS terminal testing tool according to claim 1, wherein: and 6, when new test input data is added, inputting data beyond the range requirement of the test input data in the design document of the tested software.
4. The method for testing the tested software of the LINUX terminal based on the WINDOWS terminal testing tool according to claim 1, wherein: the compiling unit in step 4 can be selectively configured according to the compiler used by the software under test, so as to ensure that the compiler used by the test tool is consistent with the compiler used by the software under test.
5. The method for testing the tested software of the LINUX terminal based on the WINDOWS terminal testing tool according to claim 1, wherein: and (4) analyzing the accumulated values of statement coverage and branch coverage by using a test tool, wherein the statement coverage and the branch coverage in the step 6 reach 100%, and all statements and branches in the tested software are required to be executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711228114.1A CN108121658B (en) | 2017-11-29 | 2017-11-29 | Method for testing LINUX end tested software based on WINDOWS end testing tool |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711228114.1A CN108121658B (en) | 2017-11-29 | 2017-11-29 | Method for testing LINUX end tested software based on WINDOWS end testing tool |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108121658A CN108121658A (en) | 2018-06-05 |
CN108121658B true CN108121658B (en) | 2020-11-20 |
Family
ID=62228635
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711228114.1A Active CN108121658B (en) | 2017-11-29 | 2017-11-29 | Method for testing LINUX end tested software based on WINDOWS end testing tool |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108121658B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109376525B (en) * | 2018-09-14 | 2020-11-03 | 网宿科技股份有限公司 | Prompting method of Linux server, Linux server and computer readable storage medium |
CN112416773B (en) * | 2020-11-23 | 2024-10-01 | 通号万全信号设备有限公司 | Cross-platform data visualization method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103631704A (en) * | 2012-08-23 | 2014-03-12 | 上海斐讯数据通信技术有限公司 | Automatic testing system and method of communication equipment |
CN104978275A (en) * | 2015-07-16 | 2015-10-14 | 北京航空航天大学 | DO-178C software test process orientated object verification and evidence model extracting method |
CN105487974A (en) * | 2015-11-25 | 2016-04-13 | 普华基础软件股份有限公司 | Software stability test method |
CN106161143A (en) * | 2016-07-22 | 2016-11-23 | 浪潮电子信息产业股份有限公司 | A kind of network performance test method based on ARM server and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8955036B2 (en) * | 2012-04-11 | 2015-02-10 | Mcafee, Inc. | System asset repository management |
-
2017
- 2017-11-29 CN CN201711228114.1A patent/CN108121658B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103631704A (en) * | 2012-08-23 | 2014-03-12 | 上海斐讯数据通信技术有限公司 | Automatic testing system and method of communication equipment |
CN104978275A (en) * | 2015-07-16 | 2015-10-14 | 北京航空航天大学 | DO-178C software test process orientated object verification and evidence model extracting method |
CN105487974A (en) * | 2015-11-25 | 2016-04-13 | 普华基础软件股份有限公司 | Software stability test method |
CN106161143A (en) * | 2016-07-22 | 2016-11-23 | 浪潮电子信息产业股份有限公司 | A kind of network performance test method based on ARM server and device |
Non-Patent Citations (1)
Title |
---|
《windows访问Linux共享的文件》;zhuifeng1024;《csdn博客》;20140825;第2-5页 * |
Also Published As
Publication number | Publication date |
---|---|
CN108121658A (en) | 2018-06-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10691419B2 (en) | Reconstructing a high level compilable program from an instruction trace | |
US11151018B2 (en) | Method and apparatus for testing a code file | |
CN102831060B (en) | Modification influence analysis based regression test case updating method of part software | |
CN104834600B (en) | A kind of method for testing Android application controls | |
KR101706425B1 (en) | Apparatus and method for unit test of code | |
US20150026664A1 (en) | Method and system for automated test case selection | |
US20160170864A1 (en) | Integrated automated test case generation for safety-critical software | |
US9952837B1 (en) | Reusable component in a modeling environment | |
CN108345532A (en) | A kind of automatic test cases generation method and device | |
CN103793326A (en) | Assembly test method and device | |
CN107015841B (en) | Preprocessing method for program compiling and program compiling device | |
CA2956364A1 (en) | System and method for coverage-based automated test case augmentation for design models | |
CN106155903B (en) | Apparatus and method for system design verification | |
CN104268310A (en) | Method for calling UVM verification environment through special graphical interface | |
CN111338925A (en) | Applet test method, device and system, electronic equipment and storage medium | |
CN108121658B (en) | Method for testing LINUX end tested software based on WINDOWS end testing tool | |
CN106775842A (en) | A kind of method of the dex subpackages that can customize | |
US20210389977A1 (en) | System migration support apparatus, system migration support method and program | |
TW201907304A (en) | Code tracking for a microcontroller program | |
Jagannatha et al. | Comparative study on automation testing using selenium testing framework and QTP | |
US9710360B2 (en) | Optimizing error parsing in an integrated development environment | |
Nghiem | MLE+: a Matlab-EnergyPlus co-simulation interface | |
CN115407997A (en) | Agile development application method and system based on low codes | |
Tao et al. | An Approach to Mobile Application Testing Based on Natural Language Scripting. | |
CN113360373A (en) | Test method for full traversal of Activity page of mobile application |
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 |