uProxy-p2p icon indicating copy to clipboard operation
uProxy-p2p copied to clipboard

Code coverage of uProxy

Open willscott opened this issue 12 years ago • 9 comments

It sounds like there isn't a clear sense of how well tested the uProxy code base is. It seems like it would be very uncomfortable from a security perspective if we published binaries without feeling like uProxy was adequately tested - and I don't think we can know that without coverage.

Karma should give us this.

willscott avatar Oct 22 '14 02:10 willscott

you already filed an issue https://github.com/uProxy/uproxy/issues/61

ryscheng avatar Oct 22 '14 02:10 ryscheng

Replaced with this one, which I think is more accurate.

willscott avatar Oct 22 '14 02:10 willscott

Code coverage is a good thing; but it falls far short of being any kind of metric for security. You need to specify and test the properties you want of your interfaces.

iislucas avatar Oct 23 '14 05:10 iislucas

Code coverage is still an important metric. We need to know what our coverage is in order to improve the coverage. At some point we should start caring more about unit tests and this has to be a convention. On Oct 23, 2014 1:23 AM, "Lucas Dixon" [email protected] wrote:

Code coverage is a good thing; but it falls far short of being any kind of metric for security. You need to specify and test the properties you want of your interfaces.

— Reply to this email directly or view it on GitHub https://github.com/uProxy/uproxy/issues/491#issuecomment-60194088.

salomegeo avatar Oct 23 '14 06:10 salomegeo

I've started doing some code coverage work in uproxy-networking. See https://github.com/uProxy/uproxy-networking/pull/176

ryscheng avatar Jan 07 '15 03:01 ryscheng

The test runner (e.g. karma or grunt-contrib-jasmine + istanbul) needs to be TypeScript aware in order to report numbers in terms of TypeScript lines. This is not the case. I've only found one test runner that can do that, which we may consider using https://github.com/mmanela/chutzpah

Apparently the TypeScript guys just use standard JS code coverage tools, which is what I use in the pull request, testing the code coverage of the resulting JavaScript http://stackoverflow.com/questions/17026959/code-coverage-for-typescript "On the TypeScript team, we just use regular code coverage tools on the compiled JavaScript. We've found this to be more than sufficient, since usually for code coverage you are looking at total coverage % (which doesn't change significantly) or are deep-diving at expression-level (which also doesn't change significantly)."

ryscheng avatar Jan 07 '15 03:01 ryscheng

I also tried using Coveralls.io, which would give us a badge and service to check our coverage results. I think we need to do some further investigation, but I was not able to get it to work with our current jasmine setup (over the JS files) because Coveralls cannot find the "source". In this case, the test source is the generated JavaScript files, which is missing from the GitHub repo, where I believe it looks for it. Again, a related problem to our code coverage tools needing to be TypeScript aware

ryscheng avatar Jan 07 '15 03:01 ryscheng

Done for code covered by unit tests in generic UI, generic core, and Chrome app/extension. https://github.com/uProxy/uproxy/pull/795 (See the pull request for details + stats) Chrome app has the lowest coverage, and needs unit tests. (Issue here: https://github.com/uProxy/uproxy/issues/808)

Firefox specific code at the moment is primarily set-up code. Since there's no logic outside of this 'glue,' we can consider calculating FF code coverage when FF integration tests are run, rather than unit tests.

lucyhe avatar Jan 26 '15 21:01 lucyhe

Added a "Unit Testing" subheading to the Coding Guide and also a "Code Coverage" section to the testing Q/A doc.

lucyhe avatar Jan 28 '15 20:01 lucyhe