CN105117335A - Method for automated verification and regression test of software unit - Google Patents
Method for automated verification and regression test of software unit Download PDFInfo
- Publication number
- CN105117335A CN105117335A CN201510530834.8A CN201510530834A CN105117335A CN 105117335 A CN105117335 A CN 105117335A CN 201510530834 A CN201510530834 A CN 201510530834A CN 105117335 A CN105117335 A CN 105117335A
- Authority
- CN
- China
- Prior art keywords
- test
- case
- software unit
- file
- source code
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The present invention relates to a method for automated verification and regression test of a software unit. The method comprises the following steps of: 1) in a use-case design process, constructing a test use-case set; and 2) in a use-case execution process, using the constructed test use-case set to automatically test the software unit. Compared with prior art, the method for automated verification and regression test of the software unit has the advantages of making full use of software/ hardware resources, improving work efficiency and the like.
Description
Technical field
The present invention relates to a kind of software unit testing technology, especially relate to a kind of automatic Verification for software unit and regression testing method.
Background technology
Software unit testing is the process checking minimum testable unit and verify, very large workload proportion is occupied in whole software test procedure, and unit regression test activity fills often wheel software iterative development process, is an important component part in SDLC.At present, existing a lot of unit test tool on market, such as, supports the C++Test of C/C++ language, VisualUnit, TestBed etc.; Support the JUnit etc. of Java language.By these instruments, although no longer need to write a large amount of pile functions and driving function, the process of unit testing is obtained simplify largely, but this is also the independent execution of test case one by one, only can be called as semi-automatic test, still can greatly affect regression tested efficiency, even can not meet the particular/special requirement automatically performed night.In addition, the difference of different tester institutes environment for use, also can reduce the maintainability of script.
Summary of the invention
Object of the present invention be exactly in order to overcome above-mentioned prior art exist defect and a kind of automatic Verification for software unit and regression testing method are provided, be intended to overcome prior art automaticity low, the inefficient problem of regression test and defect, realize supporting Automation regression testing easily.
Object of the present invention can be achieved through the following technical solutions:
For automatic Verification and the regression testing method of software unit, it is characterized in that, comprise the following steps:
1) case designing process, for building test use cases;
2) use-case implementation, utilizes the test use cases built, automatically tests software unit.
Described step 1) case designing process is specially:
With detailed design document, test source code and last round of test use cases are input, relatively detailed design document and test case is verified by key search, and whether the instrument exact p-value use-case utilizing robotization to return meets source code design, with this checkout case designing whether rationally and source code design whether consistent with detailed design document.
Whether described checkout case designing is reasonable and whether source code design is consistent with detailed design document is specially:
Whether parameter limit testing is complete;
Whether global variable exports and checks;
Whether source code parameter effective range is consistent with detailed design document.
If when test case does not meet design, carry out redesigns test case, until test after consistency checking passes through, form final test use cases.
Described use-case implementation is specially:
First, by Python script, traversal carries out each catalogue at the test case file place of unit testing, according to test case file name, generates and the test case one map information file of a pair;
Then, according to map information and the source file catalogue to be measured of the test case generated, test file is exported by Python script;
Finally, perform test file, unit testing is carried out to tested object, outputs test result.
If use-case execution failure or coverage rate do not reach the requirement of regulation, analytical test result, feeds back to tester or developer modifies.
Compared with prior art, the present invention has the following advantages:
1) make full use of software and hardware resources, increase work efficiency;
Replace mechanical artificial regression test work with automated test tool, not only can make full use of hardware resource, meet the requirement that unit regression test work can automatically perform at night, also make employee can the efficiency utilization working time, improve speed measuring with software.
In addition, no matter in product iterative development, coding change rate is how many, and Automation regression testing all can one-touchly complete, and after confirming the correctness of product code, also substantially increases work efficiency.
2) ensure the stability of test environment, strengthen the maintainability of test script;
Uniform machinery is tested automatically, ensures that each test case uses identical test environment, thus improve the maintainability of script, make it not rely on test environment.
3) integrity of test case is ensured, and the consistance of detailed design and code;
Detailed design document, test source code and test use cases consistency verification method one-touchly can find code and the test case of amendment in unit regression test, and inconsistent between detailed design, can also save the work of comparison code.
4) product test, maintenance cost is reduced;
In progressive or iteratively faster are developed, the exception that the continuous issue of redaction makes regression test carry out is frequent, and what automatic test can be more effective and strong completes unit regression test, reduces test and the maintenance cost of product
Accompanying drawing explanation
Fig. 1 is particular flow sheet of the present invention;
Fig. 2 is the process flow diagram of use-case implementation of the present invention;
Fig. 3 is the structural representation that the present invention realizes the device of Automation regression testing.
Embodiment
Below in conjunction with the drawings and specific embodiments, the present invention is described in detail.
Embodiment
If Fig. 1 is the process flow diagram of this method, perform two stages by case designing and use-case and form, be described as follows:
One, the case designing stage:
With detailed design document, test source code and last round of test use cases are input, relatively detailed design document and test case is verified by key search, and whether the instrument exact p-value use-case utilizing robotization to return meets source code design, with this can checkout case designing whether rationally and source code design whether consistent with detailed design document, as: whether parameter limit testing is complete, whether global variable exports and checks, whether source code parameter effective range is consistent with detailed design document etc.Above as being found defect, feed back to tester or developer respectively as required, then tester is according to the amended detailed design document of developer and test source code, redesigns test case, amendment is until test after consistency checking passes through, forms final test use cases.
Two, the use-case execute phase:
Utilize above-mentioned test use cases, automatically perform test script, output test result.Do not reach the requirement of regulation if any use-case execution failure or coverage rate, analytical test result, feeds back to tester or developer modifies.Wherein, the method for robotization recurrence is as shown in Figure 2:
First, by Python script, traversal carries out each catalogue at the test case file place of unit testing, according to test case file name, generates and the test case one map information file of a pair; Then, according to map information and the source file catalogue to be measured of the test case generated, test file is exported by Python script; Finally, perform test file, unit testing is carried out to tested object, outputs test result.
Fig. 3 is the structural drawing that this method realizes the device of Automation regression testing, comprising:
Traversal Unit: for traveling through each catalogue of the test case file carrying out unit testing, according to test case file name, generates and test case map information file one to one.
Generate test file unit: according to the map information of the test case generated, export test file
Test execution unit: according to test file, carries out unit testing to measurand, outputs test result.
The method has been applied to Casco Signal Ltd. TSP trackside security platform product, ECID computer interlock driver sub-system, in the unit regression test of the project software iterative development processes such as iTS intelligence train monitoring system.
From software iterative development process, after using this invention, unit regression tested efficiency is greatly improved, and has saved the time of iterative development.Use from the angle of test, no longer need the artificial regression test of machinery, energy flower is just very being improved speed measuring with software itself by tester.
Claims (6)
1., for automatic Verification and the regression testing method of software unit, it is characterized in that, comprise the following steps:
1) case designing process, for building test use cases;
2) use-case implementation, utilizes the test use cases built, automatically tests software unit.
2. a kind of automatic Verification for software unit according to claim 1 and regression testing method, is characterized in that, described step 1) case designing process is specially:
With detailed design document, test source code and last round of test use cases are input, relatively detailed design document and test case is verified by key search, and whether the instrument exact p-value use-case utilizing robotization to return meets source code design, with this checkout case designing whether rationally and source code design whether consistent with detailed design document.
3. a kind of automatic Verification for software unit according to claim 2 and regression testing method, is characterized in that, whether described checkout case designing is reasonable and whether source code design is consistent with detailed design document is specially:
Whether parameter limit testing is complete;
Whether global variable exports and checks;
Whether source code parameter effective range is consistent with detailed design document.
4. a kind of automatic Verification for software unit according to Claims 2 or 3 and regression testing method, it is characterized in that, if when test case does not meet design, carry out redesign test case, until test after consistency checking passes through, forms final test use cases.
5. a kind of automatic Verification for software unit according to claim 1 and regression testing method, is characterized in that, described use-case implementation is specially:
First, by Python script, traversal carries out each catalogue at the test case file place of unit testing, according to test case file name, generates and the test case one map information file of a pair;
Then, according to map information and the source file catalogue to be measured of the test case generated, test file is exported by Python script;
Finally, perform test file, unit testing is carried out to tested object, outputs test result.
6. a kind of automatic Verification for software unit according to claim 1 and regression testing method, it is characterized in that, if use-case execution failure or coverage rate do not reach the requirement of regulation, analytical test result, feeds back to tester or developer modifies.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510530834.8A CN105117335B (en) | 2015-08-26 | 2015-08-26 | A kind of automatic Verification and regression testing method for software unit |
HK16104680.9A HK1216681A1 (en) | 2015-08-26 | 2016-04-25 | An automatic verification and regression testing method for software unit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510530834.8A CN105117335B (en) | 2015-08-26 | 2015-08-26 | A kind of automatic Verification and regression testing method for software unit |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105117335A true CN105117335A (en) | 2015-12-02 |
CN105117335B CN105117335B (en) | 2017-11-10 |
Family
ID=54665333
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510530834.8A Active CN105117335B (en) | 2015-08-26 | 2015-08-26 | A kind of automatic Verification and regression testing method for software unit |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105117335B (en) |
HK (1) | HK1216681A1 (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107168883A (en) * | 2017-07-26 | 2017-09-15 | 成都科来软件有限公司 | A kind of API data automated testing method |
CN107391379A (en) * | 2017-07-28 | 2017-11-24 | 武汉斗鱼网络科技有限公司 | Interface automatic test approach and device |
CN107480532A (en) * | 2017-08-02 | 2017-12-15 | 四川长虹电器股份有限公司 | Regression testing method based on vulnerability scanning |
CN109614324A (en) * | 2018-12-03 | 2019-04-12 | 北京云测网络科技有限公司 | A kind of method for generating test case and device |
CN110096425A (en) * | 2018-12-10 | 2019-08-06 | 厦门市美亚柏科信息股份有限公司 | A kind of automated testing method based on QT development mode, device and storage medium |
CN111078561A (en) * | 2019-12-18 | 2020-04-28 | 深圳前海环融联易信息科技服务有限公司 | Interface automation test method and device, computer equipment and storage medium |
CN112131116A (en) * | 2020-09-25 | 2020-12-25 | 中国直升机设计研究所 | Automatic regression testing method for embedded software |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103049367A (en) * | 2011-10-11 | 2013-04-17 | 神州数码信息***有限公司 | Automatic testing method for software |
US20130151906A1 (en) * | 2011-12-08 | 2013-06-13 | International Business Machines Corporation | Analysis of Tests of Software Programs Based on Classification of Failed Test Cases |
CN104536896A (en) * | 2015-01-12 | 2015-04-22 | 牟永敏 | Regression test case selecting and ranking method and system oriented to function call path |
-
2015
- 2015-08-26 CN CN201510530834.8A patent/CN105117335B/en active Active
-
2016
- 2016-04-25 HK HK16104680.9A patent/HK1216681A1/en unknown
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103049367A (en) * | 2011-10-11 | 2013-04-17 | 神州数码信息***有限公司 | Automatic testing method for software |
US20130151906A1 (en) * | 2011-12-08 | 2013-06-13 | International Business Machines Corporation | Analysis of Tests of Software Programs Based on Classification of Failed Test Cases |
CN104536896A (en) * | 2015-01-12 | 2015-04-22 | 牟永敏 | Regression test case selecting and ranking method and system oriented to function call path |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107168883A (en) * | 2017-07-26 | 2017-09-15 | 成都科来软件有限公司 | A kind of API data automated testing method |
CN107168883B (en) * | 2017-07-26 | 2020-07-14 | 成都科来软件有限公司 | API data automatic testing method |
CN107391379A (en) * | 2017-07-28 | 2017-11-24 | 武汉斗鱼网络科技有限公司 | Interface automatic test approach and device |
CN107480532A (en) * | 2017-08-02 | 2017-12-15 | 四川长虹电器股份有限公司 | Regression testing method based on vulnerability scanning |
CN109614324A (en) * | 2018-12-03 | 2019-04-12 | 北京云测网络科技有限公司 | A kind of method for generating test case and device |
CN109614324B (en) * | 2018-12-03 | 2022-02-08 | 北京云测信息技术有限公司 | Test case generation method and device |
CN110096425A (en) * | 2018-12-10 | 2019-08-06 | 厦门市美亚柏科信息股份有限公司 | A kind of automated testing method based on QT development mode, device and storage medium |
CN110096425B (en) * | 2018-12-10 | 2022-07-15 | 厦门市美亚柏科信息股份有限公司 | QT development mode-based automatic testing method and device and storage medium |
CN111078561A (en) * | 2019-12-18 | 2020-04-28 | 深圳前海环融联易信息科技服务有限公司 | Interface automation test method and device, computer equipment and storage medium |
CN112131116A (en) * | 2020-09-25 | 2020-12-25 | 中国直升机设计研究所 | Automatic regression testing method for embedded software |
CN112131116B (en) * | 2020-09-25 | 2023-06-27 | 中国直升机设计研究所 | Automatic regression testing method for embedded software |
Also Published As
Publication number | Publication date |
---|---|
HK1216681A1 (en) | 2016-11-25 |
CN105117335B (en) | 2017-11-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105117335A (en) | Method for automated verification and regression test of software unit | |
CN109960643B (en) | Code testing method and device | |
CN106528100B (en) | System and method for model-based techniques and processes for safety-critical software development | |
US20150026664A1 (en) | Method and system for automated test case selection | |
US9946628B2 (en) | Embedding and executing trace functions in code to gather trace data | |
US10108531B2 (en) | Transferring application software from a physical to a virtual computer system | |
CN111066304A (en) | Edge device and associated network utilizing microservices | |
CN102968371B (en) | The method of test JAVA API unit component and device | |
CN103793326A (en) | Assembly test method and device | |
Inoue et al. | Experience of finding inconsistently-changed bugs in code clones of mobile software | |
US20130290075A1 (en) | Localization quality assurance of localized software | |
CN105138461A (en) | Interface testing method and device for application program | |
CN102368216A (en) | Process implementation method based on automatic project building | |
WO2021036697A1 (en) | Commissioning method and apparatus, device and storage medium | |
US20150135164A1 (en) | Integrated Software Testing Management | |
CN107451058B (en) | Software development method and device | |
CN102866950A (en) | Performance testing method and testing tool for virtual server | |
US20170322869A1 (en) | Transferring Application Software Between Virtual Machines | |
CN112131116A (en) | Automatic regression testing method for embedded software | |
CN106933572B (en) | Measurement model based on LLVM intermediate representation program slice | |
CN111611154B (en) | Regression testing method, device and equipment | |
CN108170588B (en) | Test environment construction method and device | |
CN110968339B (en) | Method and device for front-end building tool and electronic equipment | |
CN116303371A (en) | Cross-architecture data computing method and device, electronic equipment and storage medium | |
CN104102496A (en) | Development method for bank self-service system cross-browser plugin based on WINDOWS platform |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 1216681 Country of ref document: HK |
|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: GR Ref document number: 1216681 Country of ref document: HK |