test-coverage

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

Test coverage for if statement with logical or (||) - with Java's short circuiting, what's the forth condition JaCoCo wants me to cover?

坚强是说给别人听的谎言 提交于 2019-12-13 13:12:41
问题 This is probably a rather simple question, but I'm at a loss... I have an if statement like the following: if(TheEnum.A.equals(myEnum) || TheEnum.B.equals(myEnum)) TheEnum can be A , B , C , ... G (more than just 4 options). JaCoCo (SONAR) tells me that there are four conditions I can cover here. Which ones are those? Isn't the entire set I can test for in this instance essentially if(true || not_evaluated) => true if(false || true) => true if(false || false) => false I'm pretty sure I can't

Jacoco 0.8.2 and Android Gradle plugin 3.2.0 test coverage

为君一笑 提交于 2019-12-11 18:18:34
问题 I just tracked down an issue I'm having with partial coverage reports due to Android Gradle plugin 3.2.0 Jacoco is only generating coverage reports for less than 10% of my project. If I revert back to 3.1.4, it behaves as expected. Is there any known issue with AGP 3.2.+ and JaCoCo test coverage? 回答1: In absence of Minimal, Complete, and Verifiable example that demonstrates steps to reproduce your difficulty, one can only guess. Simple search in bugtracker of Android Gradle Plugin by word

Cover report from Common Test when using rebar

懵懂的女人 提交于 2019-12-11 03:28:31
问题 I have an Erlang application that uses Rebar, and has tests written using Common Test. I'd like to see the test coverage report for these tests, so I included the following line in my rebar.config file: {cover_enabled, true}. However, the "Coverage log" link in the Common Test report just leads to a page that says "Cover tool is not used". How can I get it to use the cover tool and give me a cover report when running the tests? 回答1: The cover_enabled setting in rebar.config is necessary but

In data flow coverage, does returning a variable use it?

喜欢而已 提交于 2019-12-10 23:15:57
问题 I have a small question in my mind. I researched it on the Internet but no-one is providing the exact answer. My question is: In data flow coverage criteria, say there is a method which finally returns variable x . When drawing the graph for that method, is that return statement considered to be a use of x ? 回答1: Yes, a return statement uses the value that it returns. I couldn't find an authoritative reference that says so in plain English either, but here are two arguments: A return

Android Multi Module Project With TestCoverageEnabled Throws Data Binding Errors

守給你的承諾、 提交于 2019-12-10 20:42:51
问题 I have a multi module project which is structured something like this. Here is the code to play around with this error: https://github.com/ajitsing/MultiModuleAndroid Root |- App Module (Application, Data binding enabled) |- Lib Module (Library, Data binding enabled) Main module depends on the Lib module. Lib module contains all the android tests. When I run the androidTests of just lib module with testCoverageEnabled it throws some weird data binding error. All these error are for custom

Chutzpah coverage result smaller than 100% (due to private methods?)

限于喜欢 提交于 2019-12-06 07:54:19
I use Chutzpah to test my JavaScript test coverage. Here is an example for the coverage result when I run a single test file referenceFigureEdit.spec.js : I would expect the coverage to be 100% but it is only 91.07%. Clicking on the first line I can inspect my tested code in detail. Lines that are "not covered by the test" are highlighted: Question A : How can I tell Chutzpah that those methods have actually been executed or tell Chutzpah to not include those lines in the coverage result? Are there some restrictions on where/when code has to be executed to be part of the successful coverage? I

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

巧了我就是萌 提交于 2019-12-06 02:58:46
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 5 years ago . 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

Protractor coverage not generating report

孤者浪人 提交于 2019-12-05 07:28:56
问题 Backend of our app is in PHP and for frontend we are using AngularJs . We successfully managed to run e2e tests on local as well as on production server using protractor . After writing loads of e2e tests for our app, we started looking for its coverage similar to that of unit testing. After searching for lot, luckily we find https://www.npmjs.com/package/grunt-protractor-coverage , exactly what we wanted. I took help from http://lkrnac.net/blog/2014/04/measuring-code-coverage-by-protractor/

How to measure Golang integration test coverage?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 16:56:13
问题 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