code-coverage

Java: measure code coverage for remote scripting tests

杀马特。学长 韩版系。学妹 提交于 2019-12-18 13:17:36
问题 We have an application which is deployed on JBoss 5.1, JDK 1.6. We also have scripts written in PowerShell for testing. These scripts access the application using a web-service. I would like to check the code coverage of the scripts. Any ideas? Most of the tools I saw are checking a JUnit test coverage and I don't see how we can use them. 回答1: AFAIK, all code coverage tools use the same concept (I'll omit the reporting and checking part): First instrument the code (i.e. place markers). Then

Use attribute to omit code from coverage analysis in Visual Studio

心不动则不痛 提交于 2019-12-18 12:57:07
问题 I have some classes that, for one reason or another, cannot be or need not be unit tested. I'd like to exclude these classes from my coverage metrics so that I can get a better feel for the coverage on the classes I actually care about. Right now I have to exclude the results after the fact. What I would like to do is use an attribute to mark those classes as excluded so that they aren't included to begin with. Is there any way to decorate a class with an attribute that will automatically

Code coverage for Protractor tests in AngularJS

◇◆丶佛笑我妖孽 提交于 2019-12-18 11:55:55
问题 I am running some e2e tests in my angularJS app with protractor (as recommended in the angularJS documentation). I've googled around and cannot find any information on how to measure coverage for my protractor tests. I think I'm missing something here... is there any way to get a code coverage report for protractor e2e tests? Or is it simply a feature for unit tests? 回答1: This is achievable using Istanbul. Here is the process, with some example configurations that I've extracted from our

What are some code coverage tools for Perl?

女生的网名这么多〃 提交于 2019-12-18 11:46:24
问题 Are there any good (and preferably free) code coverage tools out there for Perl? 回答1: Yes, Devel::Cover is the way to go. If you develop a module, and use Module::Build to manage the installation, you even have a testcover target: perl Build.PL ./Build testcover That runs the whole test suite, and makes a combined coverage report in nice HTML, where you can browse through your modules and watch their coverage. 回答2: As usual, CPAN is your friend: Have a look at Devel::Cover 回答3: As noted,

Is mutation testing useful in practice?

五迷三道 提交于 2019-12-18 10:47:12
问题 Do you have any examples of real life applications of mutation testing? Does it work better than simple test coverage tools? Or is it useless? What are the advantages/disadvantages of mutation testing in the real world? 回答1: The usefulness of unit tests is no longer discussed. They are essential in conception of a quality application. But, how can we assess their relevance? A code coverage indicator up to 100% doesn’t mean the code is 100% tested. This is just a view of executed code during

Is there a way to focus lcov code coverage reports to just one or two directories?

痴心易碎 提交于 2019-12-18 10:33:39
问题 I recently started using lcov to visualize my code coverage. It's a great tool. One thing I'm noticing is that it generates code coverage reports for all the files that I'm using - including those that I'm not interested in. For example, it will give me code coverage reports for boost and mysql++ files. Is there an easy way to force lcov to only generate coverage reports for specific files? I have tried using the -k parameter like so: /usr/bin/lcov -q -c -i -b . -d .obj -k src/ -k include/ -o

How do I exclude types and methods from being covered by dotCover in TeamCity?

孤者浪人 提交于 2019-12-18 10:13:07
问题 I've got an existing C# 4 project which I've checked the test coverage for by using TestDriven.Net and the Visual Studio coverage feature, i.e. Test With -> Coverage from the context menu. The project contains some code I don't want covered, and I've solved that by adding the [ExcludeFromCodeCoverage] for those types and methods. We've just upgraded TeamCity to 6.0.3, and I've added dotCover coverage to the NUnit build step. I've managed to remove coverage for external assemblies such as

generating code coverage report for android test project

匆匆过客 提交于 2019-12-18 09:06:57
问题 i am trying to get a coverage report for my android junit test project and following this guide to do so android update test-project -m <path to app project> -p <path to test project> worked fine. it generated a build.xml and updated project.properties, local.properties and proguard.cfg. but when I change directory to test project directory and enter command ant coverage it gives me this error. BUILD FAILED Target "coverage" does not exist in the project "My Project Test". Total time: 0

Why does kcov calculate incorrect code coverage statistics for Rust programs?

送分小仙女□ 提交于 2019-12-18 04:38:16
问题 I've tried to use kcov to get code coverage for a Rust library. I've followed this tutorial to build and use kcov. The coverage seems to work, however I'm facing a strange high coverage. Some files in the project gets a 100% coverage, even if they are actually not covered at all! This is a minimal project reproducing the problem: Cargo.toml [package] name = "mypackage" version = "0.1.0" authors = ["mbrt"] src/lib.rs pub mod subm; pub fn coverage1(i : bool) -> bool { if i { true } else { false

Code coverage tools in Java [closed]

爷,独闯天下 提交于 2019-12-17 23:25:38
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Are there any such code coverage tools in Java that give the different paths in the program. Basically the idea is to ensure that all loops and nested loops are covered during execution. That is to be able to ascertain if all the loops in a code base have been executed at least through one iteration. 回答1: