In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to understand the coverage of C++Test, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
For users and scholars who are exposed to C++Test testing, it is important to fully understand how C++Test works, so let's first talk about what C++Test is, the so-called C++Test: you can simply type the corresponding values in the automatically generated test case framework of C++Test.
In addition, if the method under test needs to call a function that does not exist or cannot be accessed at that time, C++Test can automatically generate a stub function; this can test interaction with external resource operations and does not contain any hidden weaknesses. Instead of actually calling these functions, C++Test calls the stub function and returns the value provided by the stub function.
If you need to control the return value used, you can create a pile call table, life input / output relationship. You can also add user-defined pile functions. For example, if you want to use the original function and the function is defined in a different file, or if you want to simulate the behavior of the original function, and the ability to replace it with a simple function to automatically generate the test driver and stub function of the Cmax Cobb + class is unique to C++Test.
Only C++Test can automatically test the Cmax Candle + class (once it can be compiled) without any user intervention. So that you can automatically detect code errors as soon as possible, and find and correct them in the easiest, most economical and fastest way. Without such automation tools, a large amount of time and resource consumption will lose the potential benefits and practical significance of unit testing.
Static test
C++Test embeds more than 700 specifications of Effective C++ (epcc), More Effective C++ (mepcc), meyer-klaus (mk) and Universal Code Standard (ucs), which can be customized by users.
At the same time, it also integrates some specifications accumulated by parasoft. In static testing, C++Test will scan the code in detail to verify whether there is any conflict with these specifications, and find some simple or low-level errors as soon as possible to avoid the spread of integration brought by them.
White-box testing
C++Test provides an effective and efficient way to perform white-box testing. C++Test fully automates all white-box testing processes and automatically generates and executes well-designed test cases. Automatically marks any run failures and displays them in a simple graphical structure. Then these test cases are saved automatically, which can be easily used in future regression testing.
Because C++Test can automatically generate stubs or allow you to add your own stubs, it can test classes that reference external objects. In other words, C++Test can run any class or set of classes and automatically generate and execute a set of test cases designed to find as many errors as possible. C++Test allows you to customize the generation of white-box test cases and at what level (projects, files, classes, or methods) to execute tests.
Black box test
C++Test reduces the burden of black-box testing by automating most of the operations of such tests. In particular, there are two ways to automate the * phase of black box testing-- creating test cases:
Helps you set up the results of each test case.
You can simply enter the test case input and then let C++Test run the test case and automatically determine the actual output. If the result is correct, no other action is required. If the result is incorrect, you can enter the expected output. This is faster and easier than manually entering the results of each test case. Automatically generate a core set of test cases.
C++Test automatically designs a set of broad-spectrum white-box test cases. When using these test cases to test in a black box, you simply observe the actual output and then enter the expected value for any incorrect results.
When you need to enter or modify test cases.
You can simply type the corresponding values in the automatically generated test case framework of C++Test. This will significantly speed up the process of creating test cases. In addition to most of the steps to automate the creation of black box test cases, C++Test fully automates the remaining black box test steps. By pressing a key, you can run one or a group of projects, files, classes, or methods. C++Test then automatically executes all test cases, reports all input / output relationships, and marks any test cases whose actual output is inconsistent with expectations or that causes the program to crash.
regression testing
C++Test fully automates all steps related to regression testing. When you test a class, automatically save its tests and test parameters. When you need to perform regression tests, you can open the appropriate projects and files and run all the original white-box and black-box test cases; C++Test will automatically run exactly the same test cases and parameters and inform you of any problems found. This means that you can immediately know whether any errors have been introduced in the changes.
Monitor test coverage
To help you measure the validity of the set of test cases currently in use, and to provide you with information to achieve the highest possible coverage, C++Test automatically monitors test coverage. C++Test follows the test coverage in real time, and then creates a comprehensive test coverage report.
The coverage window graphically shows the lines of code that are currently being executed, the lines that have been executed, and the number of times each line has been executed. Therefore, it indicates not only whether a line of code has been tested, but also how thoroughly it has been tested. This information is very helpful in determining which code requires additional tests.
On how to understand the coverage of C++Test to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.