test-coverage

Code Coverage Reporting with Visual Studio 2013 Professional for native C++

跟風遠走 提交于 2019-12-04 06:33:22
This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 5 years ago . Learn more . Using the C++ unit testing framework with Visual Studio 2013 Professional, one can write unit tests and run them from within the IDE, but in order to generate any coverage reports, apparently, one needs to have the Premium or Ultimate edition of Visual Studio. Is it possible to get code coverage reports with the Professional edition, preferably without installing any third party tools? If not, what alternate options exist for people who are not

How to measure Golang integration test coverage?

試著忘記壹切 提交于 2019-12-03 10:57:42
I am trying to use go test -cover to measure the test coverage of a service I am building. It is a REST API and I am testing it by spinning it up, making test HTTP requests and reviewing the HTTP responses. These tests are not part of the packages of the services and go tool cover returns 0% test coverage. Is there a way to get the actual test coverage? I would expect a best-case scenario test on a given endpoint to cover at least 30-50% of the code for specific endpoint handler, and by adding more tests for common error to improve this further. I was pointed at the -coverpkg directive, which

Jacoco code coverage in Android Studio with flavors

∥☆過路亽.° 提交于 2019-12-02 22:44:53
I've been trying to run Jacoco test coverage for quiet some time now. I've tried several possible solutions reported in these topics: Android test code coverage with JaCoCo Gradle plugin How do I get a jacoco coverage report using Android gradle plugin 0.10.0 or higher? Im running the tests in a emulatated device using genymotion. Here is what i added to build.gradle: apply plugin: 'jacoco' android{ jacoco { version "0.7.1.201405082137" } buildTypes{ debug{ testCoverageEnabled = true } } } jacoco { toolVersion "0.7.1.201405082137" } To run it i use something like ./gradlew clean ./gradlew

Oauth Model Concern Test Coverage Stubs

天涯浪子 提交于 2019-12-02 11:32:46
I am trying to figure out the best way to reach 100% test coverage on this class. I have outlined my full spec and I am hoping someone can point me in the right direction. My assumption is stubbing the Oauth2 request would do this, but I can not seem to make that work. I'm using Rails 4. Spec RSpec.describe 'AppOmniAuthentication', type: :concern do let(:klass) { User } let(:user) { create(:user) } let(:user_oauth_json_response) do unfiltered_oauth_packet = load_json_fixture('app_omni_authentication_spec') unfiltered_oauth_packet['provider'] = unfiltered_oauth_packet['provider'].to_sym

Basic vs. compound condition coverage

↘锁芯ラ 提交于 2019-12-01 12:37:14
I'm trying to get my head around the differences between these 2 coverage criteria and I can't work out how they differ. I think I'm failing to understand exactly what decision coverage is. My software testing textbook states that compound decision coverage can be costly (2 n combinations for n basic conditions). I would have thought basic condition coverage would be costlier. Consider a && b && c && d && e . My understanding is that in basic condition coverage, each of these atomic variables have to have the value TRUE and FALSE in a test case for the test case to be have basic condition

Sonarqube API single class test coverage

会有一股神秘感。 提交于 2019-12-01 09:25:19
I am trying to retrieve the unit test code coverage for individual classes through the SonarQube API (Sonar version 4.1.2). Everything is working fine, and I can see the metrics okay when I go directly to the sonar dashboard and go to the coverage tab for a class: 93.9% by unit tests Line coverage: 97.9% (285/291) Branch coverage: 85.0% (113/133) Can anyone tell me the correct call to retrieve this same/similar information through the sonar API interface please? I've already had a look at the documentation at http://docs.sonarqube.org/display/SONAR/Metric+definitions and can get test coverage

Sonarqube API single class test coverage

▼魔方 西西 提交于 2019-12-01 07:14:24
问题 I am trying to retrieve the unit test code coverage for individual classes through the SonarQube API (Sonar version 4.1.2). Everything is working fine, and I can see the metrics okay when I go directly to the sonar dashboard and go to the coverage tab for a class: 93.9% by unit tests Line coverage: 97.9% (285/291) Branch coverage: 85.0% (113/133) Can anyone tell me the correct call to retrieve this same/similar information through the sonar API interface please? I've already had a look at the

Android Gradle Jacoco: offline instrumentation for integration tests

折月煮酒 提交于 2019-11-30 14:03:07
问题 we are building an Android app which is tested by using Appium. Now I would like to see the test coverage of our Appium tests. I think this is possible, because Jacoco supports offline instrumentation (http://www.eclemma.org/jacoco/trunk/doc/offline.html). And even the documentation of the jacoco gradle plugin says: While all tasks of type Test are automatically enhanced to provide coverage information when the java plugin has been applied, any task that implements JavaForkOptions can be

XCode 5.1 Unit Test Coverage Analysis Fails On Files Using Blocks

霸气de小男生 提交于 2019-11-30 06:18:58
问题 Today I was tasked with adding unit test coverage analysis to our code base. Today is also the day iOS 7.1 is released along with XCode 5.1. From the release notes: The gcov tool for code coverage testing has been reimplemented. The new version uses the llvm-cov tool from the LLVM project. It is functionally equivalent to the old version for all significant features. The location of gcov within Xcode has also moved, use xcrun to invoke it. If you find problems, please file bug reports. For

Differences between Line and Branch coverage

霸气de小男生 提交于 2019-11-29 19:30:12
I use the Cobertura Maven plugin for one of my project. But I have a question about the generated report: What is the difference between line and branch coverage? Kane Line coverage measures how many statements you took (a statement is usually a line of code, not including comments, conditionals, etc). Branch coverages checks if you took the true and false branch for each conditional (if, while, for). You'll have twice as many branches as conditionals. Why do you care? Consider the example: public int getNameLength(boolean isCoolUser) { User user = null; if (isCoolUser) { user = new John(); }