On 02/07, Cédric Krier wrote: > On 07 Feb 12:34, Sharoon Thomas wrote: > > On 02/06, Sergi Almacellas Abellana wrote: > > > I also managed to run coverage to ensure that module coverage is over a > > > specific % (75% on my case, but can be customized per module). Patch is > > > here[3] (and here[4] is run by default). The output is also available on > > > drone [5]. Do you think this is also interesting to add? > > > > Coverage % could be a vanity metric but we have been trying to achieve > > 100% coverage for critical modules and a significantly high coverage > > for others. This has certainly improved the quality of the code and if > > the tests are written well (not just for the sake of coverage) there are > > hardly any maintenance issues. > > Base on what? Where do you find a correlation between coverage and > quality? How do you achieve "not just for the sake of coverage"? Which > threshold is it?
Statement coverage testing is a good measure of what **isn't** being tested in your code. Knowing what is tested and what is not by a test suite and seeing if a patch reduces code coverage is important to maintaining the quality of the codebase. I hope you remember that there were branches of code in the ModelSQL.write which could never be reached when we tested for coverage. > > What the point of having failure like that: > > https://coveralls.io/r/openlabs/nereid-webshop This is not a failure. Shows us in a pull-request if the patch reduces code coverage significantly. As your link shows minor fluctuations are fine. We aren't relegious about 100% coverage. > https://travis-ci.org/openlabs/nereid-webshop/jobs/49836710 Those have to be fixed. Flake8 had an update today. Flake8 gives us a coding style to follow that most python programmers can follow. It is not what Cedrik thinks is beautiful or I think is beautiful. > As usual you are just following to mass without thinking exactly what it > implies and what it brings. I'd prefer "Tested code that works" and "Tested code that breaks" to "Untested code that works". Without coverage you have no way of knowing which part is tested to begin with. If preferring to know which part of the code is tested is "mass thinking", I guess I am with the mass and not with you. PS: I don't intend on changing how you think about this. This is a public mailing list and my mail only explains why we use coverage and flake8 to provide better quality software to our customers. If you think these tools don't help you in improving software quality, so be it. Thanks & Regards Sharoon Thomas
pgpUhAOEHpoeT.pgp
Description: PGP signature