In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
In modern professional software testing centers, with the iteration of the project, a large number of automated test cases are usually built for each system, but it is very difficult to start a full automated test triggered by CI, which makes it pass at a large rate. Test engineers often need to invest a lot of money and spend a lot of energy on automating use case failure troubleshooting, but the probability of finding effective BUG is very low. In the repeated investigation of fruitless, mental exhaustion, almost despair of automation, regard it as a chicken rib, useless, a pity to abandon, let the testing center have a great headache.
How do you make automation use cases work as well as they should, making QA work less onerous? In order to solve this problem, nebula testing has carried out the research and development of seamless docking between accurate testing and automated testing. After a large number of enterprises' implementation and verification, the data flow of accurate testing can finally be connected to automated testing without feeling, which greatly expands the advantages of automated testing and thoroughly improves the deficiency of automated test change management.
The introduction of this technical solution is like adding "precision testing" eyes and wings to automated testing, with a variety of leap functions in an instant. For example:
1) automatic test cases are automatically associated with source code
2) synchronous intelligent regression use case selection
3) effectively reduce the scope of automated test execution
4) immediate analysis of the set of test cases that need to be maintained
5) automatically track the execution code path of each test case
6) when the automation execution is finished, it can help directly locate the code error point of the automation use case.
7) analyze the automated test case set, such as cluster analysis, and minimum use case set analysis, etc.
8) give guidance on the optimization of the test case set.
9) give the overall coverage information of the test case set.
10) assist in the effective addition of the use case set
11) incremental code coverage analysis and so on.
This paper focuses on the nebula precision testing product and unit test framework JUnit as an example.
Unit testing is generally tested by writing test cases: core class methods, exception handling, business logic, and so on. After realizing the seamless docking of Junit unit testing and accurate testing, the real testing adequacy can be basically ensured. Because when running unit test cases, the corresponding test cases will be automatically generated in the precision test system, and the code coverage of each unit test will be recorded in detail in the precision test system. Because precision testing comes with the characteristics of test case and code traceability and coverage visualization, you can have a clear view of the adequacy of the current unit tests.
The following figure is an architecture diagram of seamless docking of precision testing and Junit unit testing to achieve automated testing.
The main feature of this scheme is that it makes full use of the inheritance characteristics of the JUnit framework, and all the communication and control logic necessary for accurate testing can be realized through the base class. That is, for all the original automated test suites, only one inheritance to the encapsulated ParentTest is needed. That is, the docking with the nebula precision testing platform can be realized without any changes to the implementation code of the original test case. After the docking is completed, during the running of the JUnit test, the test case is automatically created in the nebula precision test system, and the code coverage information of each automated test case is automatically recorded.
The following is a description of the main methods of the ParentTest extension base class, which mainly extends the annotation methods of the Junit framework itself:
@ Before: initialization methods are executed once for each test method, before each test method, @ After: release resources, execute after each test method, @ BeforeClass: execute before all test methods in the current class, @ AfterClass: execute after all test methods in the current class. The execution order of a unit test case for a JUnit4 is:
@ BeforeClass-> @ Before-> @ Test-> @ After-> @ AfterClass
So you can customize this feature in different annotated code, customize a common class, and run the same method when other unit tests inherit from that class. By adding login versions in different annotations, creating test cases and starting, ending test cases and logging out version commands, and sending them to TTFront components to realize interaction with TT, it does not affect the test program and test results of the unit test itself.
After receiving the command, TTfront logs in the corresponding version and records the user name. After the test case is created, the coverage data corresponding to the test case is collected in real time through the software oscilloscope when the test case is running, and this part of the data is matched to the test case through the user name. You can see the test case and the corresponding function coverage and code coverage of the unit test in the TT client.
As long as the class inherits from the encapsulated ParentTest class when creating the unit test, it can be seamlessly docked with TT to achieve automated testing.
The implementation case and effect diagram of the docking of Junit unit test and TT:
1. Inherit from the ParentTest class when creating test cases
2. Modify the project, version, user password and TT server IP in ParentTest
3. Corresponding to the package introduced by the modification (take the mvn project as an example), the JavaPaser package mainly contains references to the instrumentation code and the libraries required by the TT processing logic required by the ParentTest class.
Package the tested code through TT. Note that the Junit automation test case code does not need instrumentation, but only the business logic code of the Junit test.
4. Start the unit test. During the execution of the test case, open the TT client oscilloscope component, display the coverage waveform collected in real time, and see that the test case is automatically established in the TT system. TT client effect diagram (generate the corresponding test case and the coverage of the test case)
The above describes how the accurate testing system seamlessly connects with the existing automated testing framework. With the exception of Junit, other automated testing frameworks can be implemented with reference to this idea (you can try it for free if you log on to the nebula website www.teststars.cc offline Enterprise Test Center). After the accurate test system is docked with automation, it can make the automatic test execution in the black box state that can not be seen clearly become traceable. Based on the powerful test analysis system of accurate testing, the automated test execution and planning process can be continuously optimized. This scheme can effectively solve the industry problem of high input-output ratio of automated testing.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.