code-coverage

How to check code coverage with tests for methods with specified level of complexity in Java

你离开我真会死。 提交于 2019-12-19 15:06:32
问题 I want to be able to check test coverage of those of my methods that have complexity above some given level. Are there any plugins for Eclipse, Sonar, Hudson for that? Thanks! 回答1: I've found simpler solution. I can use a filter in SONAR http://docs.codehaus.org/display/SONAR/Filters where given metric can be used. 回答2: For good code coverage you should check out this tool. It's availiable for Eclipse. Emma Code Coverage 回答3: http://eclipse-metrics.sourceforge.net/ The Eclipse Metrics plugin

Basic vs. compound condition coverage

江枫思渺然 提交于 2019-12-19 11:36:22
问题 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

Gradle jacoco code coverage - Then publish/show in Jenkins

杀马特。学长 韩版系。学妹 提交于 2019-12-19 11:34:24
问题 I'm trying to setup code coverage for a Java application project. Project name : NewApp Project structure: src/java/** (source code) src/java-test (unit tests - Jnuit) test/it-test (integration test) test/at-tests (acceptance tests) tomcat/* (contain tomcat start/stop scripts) xx/.. etc folders which are required for a usual application. Gradle version : 1.6 Environment : Linux I have a running gradle build script that fetches application (NewApp) dependencies (i.e. service jars used by the

Determining which test cases covered a method

若如初见. 提交于 2019-12-19 10:43:10
问题 The current project I'm working on requires me to write a tool which runs functional tests on a web application, and outputs method coverage data, recording which test case traversed which method. Details: The web application under test will be a Java EE application running in a servlet container (eg. Tomcat). The functional tests will be written in Selenium using JUnit. Some methods will be annotated so that they will be instrumented prior to deployement into the test enviornment. Once the

TFS Build 2010 Code Coverage using NUnit

允我心安 提交于 2019-12-19 03:41:36
问题 I was wondering if any of you guys had any experience generating code coverage reports in TFS Build Server 2010 while running NUnit tests. I know it can be easily done with the packaged alternative (MSTest + enabling coverage on the testrunconfig file), but things are a little more involved when using NUnit. I've found some info here and there pointing to NCover, but it seems outdated. I wonder if there are other alternatives and whether someone has actually implemented this or not. Here's

Gradle jacoco coverage report with more than one submodule(s)?

蓝咒 提交于 2019-12-19 03:25:21
问题 Does anybody know how to configure a gradle file for java jacoco report that contain codecoverage of more than one gradle submodule? my current approach only shows codecoverage of the current submodule but not codecoverage of a sibling-submodul. I have this project structure - build.gradle (1) - corelib/ - build.gradle (2) - src/main/java/package/Core.java - extlib/ - build.gradle (3) - src/main/java/package/Ext.java - src/test/java/package/Integrationtest.java when i execute gradlew :extlib

SonarQube - integrationTest.exec - sonarRunner (Gradle) or “sonar-runner” command - showing 0.0% covereage

有些话、适合烂在心里 提交于 2019-12-19 03:15:22
问题 I'm successfully generating 2 .exec files by Jacoco within "build/jacoco" folder after running a Gradle based build and integration tests. Gradle command: "gradle clean build integrationTest" Once done, it generates the following .exec files under build/jacoco folder. test.exec integrationTest.exec Following is my sonar-project.properties file. When, I run "sonar-runner" from Linux prompt it completes but on SonarQube dashboard for this project, I see Unit test says some 34.5% but integration

Android Studio 3/Kotlin code coverage

孤街醉人 提交于 2019-12-18 21:19:11
问题 My android app is multi module project: include (android-app/kotlin-android)':application', (pure kotlin)':presentation', (pure kotlin)':domain', (android-library/kotin-android)':dataproviders' I'm using Junit/Mockito for tests and I have issue with generating code coverage for kotlin android modules only . Tested lines are visible for android studio. tested class in ui.viewmodel package: But, for pure kotlin (eg. domain, presentation) test coverage works fine: I'm using Android Studio 3.0

How to tell lcov to ignore lines in the source files

牧云@^-^@ 提交于 2019-12-18 19:28:29
问题 I am wondering if there is the possibility to tell lcov to ignore some lines in a source files, ie. do not report them as unvisited. I am looking for a solution that can be put in the code itself, like: int some_method(char some_var, char some_other_var) { if(some_var == 'A') { if(some_other_var == 'B') { /* do some real stuff here */ } else { LCOV_DO_NOT_REPORT_NEXT_LINE // **<-- this?? ** NOT_IMPLEMENTED("A*") } } else { NOT_IMPLEMENTED("*") } And the necessary background: A big piece of

What type of errors could my code still contain even if I have 100% code coverage?

拈花ヽ惹草 提交于 2019-12-18 19:01:18
问题 What type of errors could my code still contain even if I have 100% code coverage? I'm looking for concrete examples or links to concrete examples of such errors. 回答1: Having 100% code coverage is not that great as one may think of it. Consider a trival example: double Foo(double a, double b) { return a / b; } Even a single unit test will raise code coverage of this method to 100%, but the said unit test will not tell us what code is working and what code is not. This might be a perfectly