Just after the National Day is over, let's take a look at it. By the way, let's take a look at the use of some of the tools that can be used at work.
Codecover is a free white box testing tool that primarily tests code, branches, loops, and MC/DC coverage. Supports generating independent reports for each test case. Currently, the Supported languages are Java and Cobol. This article describes how to use codecover as a plug-in for myeclipse.
Official Website: http://codecover.org/index.html
1. Download and install
The codecover myeclipse plugin is installed using the standard Eclipse update Mechanic:
- Start myeclipse.
- From the main menu, select "help", "Software Updates", "Find and install ...".
3. In the upcoming dialog, select "search for new features to install" and click "" Next ".
4. The list containing known update sites will be displayed. Create a new update site by clicking on "New remote site..." and enter the following information:
Name: CodeCover Update Site URL: http://update.codecover.org/
Select the newly created site, if not already selected, and click "finish". eclipse will now contact the codecover Update site; this might take a moment depending on your network connection.
5. In the next dialog, you will see the list of features found on the Update site; for now, codecover consists of only one feature. Select it for installation and click "Next ".
6. after the download has finished, eclipse will ask you some questions about the license and installation, and prompt to restart the workbench. you shoshould confirm the restart as not all codecover features are guaranteed to work if you simply click "Apply changes ".
Now codecover for myeclipse is installed! You can proceed to the codecover eclipse walkthrough to learn how you can use it.
Ii. Use
1. Selecting the files to Instrument
Open the package explorer view. choose the Java classes and packages you want to instrument and open the context menu by right-clicking on the selected items. the menu item "use for coverage measurement" allows you to toggle the instrumentation state of the selected items.
After selection, there will be a mark before this class, such:
2. Enabling codecover for a Java Project
Open the properties of your project, e.g. by selecting the project in the package explorer and choosing the properties menu item of the Project menu. once the properties are visible, select the codecover tab. this tab contains a checkbox which you use to enable/disable codecover for the project.
3. Running a Java project with codecover
Select the codecover tab and click on the "run as"-"codecover measurement" checkbox. Click the run button to start the application.
Once the execution of the application is finished, the gathered coverage data will be shown in the coverage view.
4. Test sessions View
5. Coverage View
Last two view come from menu (Windows)-show view-Other: codecover
Finally, you can use the tool to view the corresponding code:
Here, codecover has been explained and its basic usage has been understood. We will learn more about it later.
Initial codecover experience