CN110990286A - BDD-based unit test system - Google Patents

BDD-based unit test system Download PDF

Info

Publication number
CN110990286A
CN110990286A CN201911272155.XA CN201911272155A CN110990286A CN 110990286 A CN110990286 A CN 110990286A CN 201911272155 A CN201911272155 A CN 201911272155A CN 110990286 A CN110990286 A CN 110990286A
Authority
CN
China
Prior art keywords
utp
test
bdd
unit
utpjunit
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
CN201911272155.XA
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.)
Ctrip Computer Technology Shanghai Co Ltd
Original Assignee
Ctrip Computer Technology Shanghai 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 Ctrip Computer Technology Shanghai Co Ltd filed Critical Ctrip Computer Technology Shanghai Co Ltd
Priority to CN201911272155.XA priority Critical patent/CN110990286A/en
Publication of CN110990286A publication Critical patent/CN110990286A/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/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/3676Test management for coverage analysis
    • 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/3692Test management for test results analysis

Abstract

The invention discloses a BDD-based unit test system, which comprises a UTPJunit component, a UTP Idea plug-in and a UTP unit test platform; the UTPJunit component is used for managing the test cases and collecting the test information; the UTP Idea plug-in is used for generating a unit test case template of a UTPJUnit style; the invention integrates the prior technologies, so that testers can conveniently realize unit testing, and the statistics and the result check of the code coverage rate of the integrated test are realized.

Description

BDD-based unit test system
Technical Field
The invention belongs to the technical field of unit testing, and particularly relates to a BDD (behavior driven development) -based unit testing system.
Background
Currently, unit testing is performed in the software development process by writing and performing verification locally by developers. The requirement personnel, the testing personnel and the project related personnel have no knowledge of the compiling quality and the execution result of the unit test, so that team cooperation is not facilitated, the development quality is checked, the omission is made, the testing quality is difficult to guarantee, and the efficiency is low.
Disclosure of Invention
The invention aims to overcome the defect of low efficiency of unit testing in the prior art and provides a BDD-based unit testing system.
The invention solves the technical problems through the following technical scheme:
the invention provides a BDD-based Unit Test system, which comprises a UTPJunit component, a UTP Idea plug-in and a UTP (Unit Test Case specificities) Unit Test platform, wherein the UTP Idea plug-in is connected with a Unit Test Case description;
the UTPJunit component is used for managing the test cases and collecting the test information;
the UTP Idea plug-in is used for generating a unit test case template of a UTPJUnit style;
the UTP unit test platform is used for managing, executing and analyzing unit test cases.
Preferably, the UTP unit testing platform implements a requirement document in Markdown syntax format through the BDD module, and transforms the requirement document into a unit test case.
Preferably, the UTP unit test platform supports online viewing, editing and generating test cases.
Preferably, the UTP unit test platform supports distributed execution.
Preferably, the UTP unit testing platform supports report parsing of at least one unit testing framework of Junit, TestNg, UtpJunit.
Preferably, the UTP unit testing platform includes a server and a plurality of execution machines.
Preferably, the UTP Idea plug-in is used to generate test cases for plain Junit.
Preferably, the UTP Idea plug-in is also used for generating a test case of the Spring MVC project.
Preferably, the UTP Idea plug-in is also used to generate jmoclit-based test cases.
Preferably, the UTPJunit component is further configured to collect results of case execution to generate Json and Html format test reports.
The positive progress effects of the invention are as follows: the invention integrates the prior technologies, so that a tester can conveniently realize unit testing and integrate the statistics of the code coverage rate and the result check of the testing. Through the automatic combination with the API and the UI, the omission of the test cases can be checked, the coverage of the test cases on the functions is perfected, and the quality of the tested system is improved.
Drawings
FIG. 1 is a schematic structural diagram of a BDD-based unit testing system according to a preferred embodiment of the invention.
Fig. 2 is a schematic structural diagram of a UTP unit test platform of the BDD-based unit test system according to a preferred embodiment of the present invention.
Detailed Description
The present invention is further illustrated by the following preferred embodiments, but is not intended to be limited thereby.
The embodiment provides a BDD-based unit testing system, and referring to fig. 1, the BDD-based unit testing system includes a utpjunction component 201, a UTP Idea plug-in 202, and a UTP unit testing platform 203. The UTPJunit component 201 is used for managing test cases and collecting test information; the UTP Idea plug-in 202 is used for generating a unit test case template of a UTPJUnit style; the UTP unit test platform 203 is used to manage, execute, and analyze unit test cases.
In specific implementation, the UTPJunit component 201 is a Jar package developed by Java, and the Junit is extended based on agile development conditions, so that test cases can be managed and test information can be collected conveniently.
UTPJunit component 201 is used for custom annotation of UTPJunit. Through the self-defined annotation, the description of the unit test case can be enriched, and further, an enriched test report can be generated. The custom annotations are as follows: @ Author, which is applicable to classes and methods for marking writers of test cases; @ Module, the annotation applies to the class, is used for marking the Module to which the test case belongs; @ DisplayName, which is applicable to classes and methods, for defining the name of a class or method; @ Direction, the annotation applies to methods for marking the tested method corresponding to the test case, requiring the use of the full path of the method, such as: com.example.demo.test.count; @ Feature, which is only applicable to methods, is used to describe the corresponding function (requirement) of the test method; @ Scenario, which is only applicable to methods, is used to describe the scene corresponding to the test method.
The UTPJunit component 201 is also used for custom Runner of UTPJunit. In order to cooperate with the use of the custom annotation, a custom Runner must be written, and through the written Runner, the results of the execution of the use case can be collected, and a Json and Html format test report can be generated.
IntelliJ IDEA is a relatively popular Java program Integrated Development Environment (IDE). The UTP Idea plug-in 202 is used for the IDE, and can assist in generating a unit test case template with UTPJUnit style, thereby improving the efficiency of writing unit tests.
The UTP Idea plug-in 202 is used for generating a test case of a common Junit, a test case of a Spring MVC project, and a test case based on a jmoclit.
The UTP unit test platform 203 is a continuous integrated platform that integrates unit test case design, authoring, management, execution and analysis.
UTP unit test platform 203 supports Behavior Driven Development (BDD). Behavior-driven development is an agile software development technology, focuses on design, and needs to be converted into test cases capable of driving development by products/development/test together at the beginning of requirement definition. The UTP unit testing platform 203 can allow a requirement or tester to write a requirement document in a Markdown syntax format on line through the BDD module, convert the requirement document into a unit test case through a tool provided by the platform, and then develop and write a service code by driving writing the unit test case.
Referring to fig. 2, the UTP unit testing platform 203 includes a server 231 and several execution machines 232.
The UTP unit test platform 203 supports online application code viewing, editing and case generation. Typically, developers or testers view and write unit test cases through local IDE. The BDD-based unit test system of this embodiment enhances the writing and generation of unit test cases by the UTP unit test platform 203. In order to further improve the efficiency of checking and writing unit tests, the UTP unit testing platform 203 also provides functions of checking, editing and generating test cases online.
The UTP unit test platform 203 supports unit test case execution. There are various ways in which the UTP unit test platform 203 triggers the execution of use cases. In the platform, application click execution active triggering can be selected. And the test case can also be integrated with a Gitlab and a release platform to perform continuous integration to trigger the unit test case execution. The UTP unit testing platform 203 supports distributed execution, and when too many applications of the unit test case need to be executed, multiple execution machines can be configured to perform horizontal expansion.
UTP unit test platform 203 is also used to output test reports. The UTP unit testing platform 203 supports report parsing of various unit testing frameworks (Junit, TestNg, UtpJunit).
The UTP unit testing platform 203 is a distributed system in which the host site Web system can be deployed on one Windows server, and the UTP unit testing execution client can be deployed on multiple servers. The user accesses the UTP unit testing platform 203 home site through a browser to perform various operations related to unit testing.
The UTP unit test platform 203 provides BDD document writing, test case generation, CI trigger case execution, code browsing, application code analysis, test report viewing, and the like.
The user accesses to the UTP unit testing platform 203, first selects the application to be created, and then configures the application parameters according to the own needs. After configuration is finished, a user can design and write test case description in the BDD, then a unit test case template is generated, and the user writes case content according to specific services. After the case writing is finished, the user can actively trigger or CI triggers the execution of the unit test, and the user can check the test execution report after the test execution is finished.
The BDD-based unit test system of the embodiment enables testers to conveniently realize unit test and count and check the code coverage rate of the integrated test through integration of multiple existing technologies. Through the automatic combination with the API and the UI, the omission of the test cases can be checked, the coverage of the test cases on the functions is perfected, and the quality of the tested system is improved.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.

Claims (10)

1. A BDD-based unit test system is characterized by comprising a UTPJunit component, a UTP Idea plug-in and a UTP unit test platform;
the UTPJunit component is used for managing the test cases and collecting the test information;
the UTP Idea plug-in is used for generating a unit test case template of a UTPJUnit style;
the UTP unit test platform is used for managing, executing and analyzing unit test cases.
2. The BDD-based unit test system of claim 1, wherein the UTP unit test platform implements a requirements document in Markdown syntax format via a BDD module and packages the requirements document into the unit test cases.
3. The BDD-based unit testing system of claim 1, wherein the UTP unit testing platform supports online viewing, editing and generating test cases.
4. The BDD-based unit testing system of claim 1, wherein the UTP unit testing platform supports distributed execution.
5. The BDD-based unit testing system of claim 1, wherein the UTP unit testing platform supports report parsing of at least one unit testing framework of Junit, TestNg, UtpJunit.
6. The BDD-based unit testing system of claim 1, wherein the UTP unit testing platform includes a server and a number of execution machines.
7. A BDD-based unit testing system as claimed in claim 1 wherein the UTP Idea plug-in is used to generate generic Junit test cases.
8. The BDD-based unit test system of claim 7, wherein the UTP Idea plug-in is further configured to generate test cases for a Spring MVC project.
9. The BDD-based unit test system of claim 8, wherein the UTP Idea plug-in is further configured to generate jmoclit-based test cases.
10. The BDD-based unit testing system of claim 1, wherein the UTPJunit component is further configured to collect results of use case execution to generate Json and Html formatted test reports.
CN201911272155.XA 2019-12-12 2019-12-12 BDD-based unit test system Pending CN110990286A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911272155.XA CN110990286A (en) 2019-12-12 2019-12-12 BDD-based unit test system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911272155.XA CN110990286A (en) 2019-12-12 2019-12-12 BDD-based unit test system

Publications (1)

Publication Number Publication Date
CN110990286A true CN110990286A (en) 2020-04-10

Family

ID=70092764

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911272155.XA Pending CN110990286A (en) 2019-12-12 2019-12-12 BDD-based unit test system

Country Status (1)

Country Link
CN (1) CN110990286A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111638877A (en) * 2020-06-01 2020-09-08 山东汇贸电子口岸有限公司 Visual rapid development method for Web project

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140101640A1 (en) * 2012-10-05 2014-04-10 Software Ag White-box testing systems and/or methods for use in connection with graphical user interfaces
CN107562626A (en) * 2017-08-31 2018-01-09 国家电网公司 A kind of method that encapsulation Selenium and Sikuli realizes Web automatic tests
CN109254907A (en) * 2018-08-03 2019-01-22 挖财网络技术有限公司 A kind of interface testing report-generating method and system based on Java
CN109684226A (en) * 2018-12-29 2019-04-26 携程计算机技术(上海)有限公司 Java code coverage rate statistical system
CN109933521A (en) * 2019-01-23 2019-06-25 平安科技(深圳)有限公司 Automated testing method, device, computer equipment and storage medium based on BDD

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140101640A1 (en) * 2012-10-05 2014-04-10 Software Ag White-box testing systems and/or methods for use in connection with graphical user interfaces
CN107562626A (en) * 2017-08-31 2018-01-09 国家电网公司 A kind of method that encapsulation Selenium and Sikuli realizes Web automatic tests
CN109254907A (en) * 2018-08-03 2019-01-22 挖财网络技术有限公司 A kind of interface testing report-generating method and system based on Java
CN109684226A (en) * 2018-12-29 2019-04-26 携程计算机技术(上海)有限公司 Java code coverage rate statistical system
CN109933521A (en) * 2019-01-23 2019-06-25 平安科技(深圳)有限公司 Automated testing method, device, computer equipment and storage medium based on BDD

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
付雪梅: ""基于SOA接口自动化功能测试系统设计与实现"" *
谢非: ""携程分布式云存储系统的设计与实现"" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111638877A (en) * 2020-06-01 2020-09-08 山东汇贸电子口岸有限公司 Visual rapid development method for Web project

Similar Documents

Publication Publication Date Title
Memon An event‐flow model of GUI‐based applications for testing
KR101132560B1 (en) System and method for automatic interface testing based on simulation for robot software components
Palviainen et al. The reliability estimation, prediction and measuring of component-based software
Marchetto et al. A case study-based comparison of web testing techniques applied to AJAX web applications
CN102981958B (en) Method for testing software and proving installation
De Lucia et al. Improving behavioral design pattern detection through model checking
US7865779B2 (en) Server side logic unit testing
Roehm et al. Monitoring user interactions for supporting failure reproduction
Marchetto et al. Reajax: a reverse engineering tool for ajax web applications
Antoniol et al. Understanding web applications through dynamic analysis
Sarma et al. Model-based testing in industry: a case study with two MBT tools
Grieskamp et al. Model-based quality assurance of Windows protocol documentation
Gao et al. Testing coverage analysis for software component validation
Wendel et al. Provenance of software development processes
Cai et al. Synthesizing client load models for performance engineering via web crawling
CN104317580A (en) Integrated development environment for virtual test application (APP)
Paiva et al. Towards the integration of visual and formal models for GUI testing
CN110990286A (en) BDD-based unit test system
Xu et al. Testing aspect‐oriented programs with finite state machines
Hryszko et al. Bottlenecks in software defect prediction implementation in industrial projects
Sulír et al. Generating method documentation using concrete values from executions
Rodrigues et al. A model driven approach for software systems reliability
CN115470152B (en) Test code generation method, test code generation device, and storage medium
dos Santos et al. Using model transformation to generate graphical counter-examples for the formal analysis of xUML models
Amalfitano et al. Dynaria: A tool for ajax web application comprehension

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200410