All Questions

39
votes
7answers
32443 views

Mocking Java enum to add a value to test fail case

I have an enum switch more or less like this: public static enum MyEnum {A, B} public int foo(MyEnum value) { switch(value) { case(A): return calculateSomething(); case(B): retur...
81
votes
5answers
20383 views

Perl build, unit testing, code coverage: A complete working example

Most Stackoverflow answers that I have found in regards to the Perl build process and unit testing and code coverage simply point me to CPAN for the documentation there. There's absolutely nothing wr...
32
votes
6answers
27071 views

Code Coverage tools for PHP

Is there any code coverage tool available for PHP? I wish to check the code coverage of my code and API's written in PHP, but have not been able to lay my hands on any code coverage tool for PHP, as i...
47
votes
4answers
23619 views

Filter JaCoCo coverage reports with Gradle

Problem: I have a project with jacoco and I want to be able to filter certain classes and/or packages. Related Documentation: I have read the following documentation: Official jacoco site: http://...
132
votes
12answers
50538 views

How can I unit test a GUI?

The calculations in my code are well-tested, but because there is so much GUI code, my overall code coverage is lower than I'd like. Are there any guidelines on unit-testing GUI code? Does it even mak...
33
votes
6answers
15344 views

Generate gcda-files with Xcode5, iOS7 simulator and XCTest

Being inspired by the solution to this question I tried using the same approach with XCTest. I've set 'Generate Test Coverage Files=YES' and 'Instrument Program Flow=YES'. XCode still doesn't produc...
50
votes
6answers
36915 views

How to get code coverage using Android Studio?

I am developing apps using Android Studio. I was able to run the test code. But, I do not know how to get code coverage in android studio. I have already seen the following links. Android Gradle Code...
38
votes
3answers
7669 views

What is the branch in the destructor reported by gcov?

When I use gcov to measure test coverage of C++ code it reports branches in destructors. struct Foo { virtual ~Foo() { } }; int main (int argc, char* argv[]) { Foo f; } When I run...
58
votes
11answers
14319 views

Find unused code in a Rails app

How do I find what code is and isn't being run in production ? The app is well-tested, but there's a lot of tests that test unused code. Hence they get coverage when running tests... I'd like to ref...
13
votes
4answers
8737 views

Code coverage not showing results using Xcode + gcov

I have been trying to get the Code coverage working for iPhone simulator and always get a 0% coverage. Below are the configuration details and the steps that I have tried. Configuration Xcode 3.2.5/...

Previous Next