Skip to content

The Push for 90% Test Coverage #11885

@kshyatt

Description

@kshyatt

The testing situation right now

The latest Codecov run shows a test coverage percentage of 83.24%. This is amazing work by all, but now let's push for that beautiful green badge, following the great work at #9493. @ViralBShah asked us to open new issues rather than keep accumulating comments over there. There are many files in Julia which are poorly covered, but some are more target-rich than others. In particular, the files / folders with the most lines missed are:

  • base/multi.jl - 348 lines missed
  • base/pkg/entry.jl - 284 lines missed
  • base/linalg/lapack.jl - 293 52 lines missed
  • base/inference.jl - 229 lines missed
  • base/printf.jl - 234 lines missed
  • base/show.jl - 170 lines missed
  • base/LineEdit.jl - 199 lines missed
  • base/abstractarray.jl - 196 19 lines missed - claimed by @davidagold
  • base/REPL.jl - 184 lines missed
  • base/stream.jl - 169 lines missed
  • base/interactiveutil.jl - 163 lines missed - claimed by @Rory-Finnegan
  • base/string.jl - 139 lines missed - claimed by @ScottPJones
  • base/int.jl - 127 81 lines missed
  • libgit2 folder - 400 lines missed

To get to 90% coverage, we need to cover 3580 lines. If we focus on the above files, we can drastically improve their coverage and Julia's at once. I also like this set because there's a good spread across Julia functionality - linear algebra, strings, parallel processing, the REPL, etc.

Isn't That a Lot of Lines?

Yeah, it is. Luckily, we've already made great progress (we passed 80%!) thanks to a great group of new contributors. Spread out across a bunch of people, it's not so much work.

File specifics

lapack.jl is the file I know best. There are many functions wrapped in there that "can't" be tested right now because they require matrix storage formats that Julia doesn't support, like banded or RFP. But there are also functions that do complicated factorizations that can be difficult to test without a lot of domain expertise. Linear algebra experts welcome!

multi.jl, the file in the worst state, has many methods for starting/stopping/talking to workers that have not been tested at all. Maybe this is an issue with the buildbots that @tkelman or @staticfloat can clarify more?

In general the state of the REPL testing is quite poor. If someone would like to familiarize themselves with the REPL internals writing these tests would be a wonderful way to do so.

How you can help

If there's an area in the above list you have some expertise in or want to learn more about, feel free to "claim" the file and start testing the heck out of it! That's how I got involved in the linear algebra testing and it worked out pretty well 😉. The first set of tests was the hardest to write, but following the instructions in the OP of #9493 will get you most of the way there. You absolutely do not need to read the following 150+ comments! Following the Coveralls repo or the Codecov repo is a good way to track our progress, and you will be able to see your numbers go up.

If someone claims a file as their testing baby, I will check it off in the list above. If there's no checkbox, that file is up for grabs and in need of some awesome Julians, newbies or experienced, to write some tests for it!

We now have a Gitter chat-room: https://gitter.im/kshyatt/julia-coverage

"Help! I'm a first time contributor and I have no idea how to use Coveralls!"

Here's a step-by-step image guide to how I find things to test using Coveralls.

  1. Click on the latest build on the JuliaLang julia repo on Coveralls
    step1
  2. Coveralls by default doesn't show us a lot of files. Let's change that.
    step2
  3. Let's view 100 files per page. Since Julia base has about 220 files, we can capture all the ones in the worst state this way
    step3
  4. Now let's look at all the files in Julia, rather than just the ones changed in the latest merge
    step4
  5. lapack.jl here is in a bad state. Look at all those missed lines! Let's click on it and find something to test.
    step5
  6. Here's a line in red that's not tested. It's an error throw, which are often missed. Writing a test for this functionality should be pretty simple.
    step6

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIndicates a good issue for first-time contributors to JuliatestThis change adds or pertains to unit tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions