# Test coverage

- Thread: https://externals.io/message/128419
- Original archive: https://news-web.php.net/php.internals/128419
- Started by Vinicius Dias on 2025-08-07T15:20:03+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #128419 — Vinicius Dias — 2025-08-07T15:20:03+00:00

URL: https://externals.io/message/128419#128419

Hello, folks. If this is not the place to ask, I'm sorry.

I would like to know how or where I can find the code coverage for
php-src to see if there is any uncovered code I might be able to
contribute with new tests.

Since gcov.php.net doesn't exist anymore, I was not able to find
anything related to it anywhere. I even tried generating a coverage
report locally with `lcov --capture --directory . --output-file
coverage.info` after running `make test`, but I got no luck with it.

Thank you in advance for your help.

---

## #128421 — Hans Krentel — 2025-08-07T15:40:37+00:00

URL: https://externals.io/message/128419#128421 · In reply to: #128419

> Hello, folks. If this is not the place to ask, I'm sorry.
 > 
 > I would like to know how or where I can find the code coverage for
 > php-src to see if there is any uncovered code I might be able to
 > contribute with new tests.
 > 
 > Since gcov.php.net doesn't exist anymore, I was not able to find
 > anything related to it anywhere. I even tried generating a coverage
 > report locally with `lcov --capture --directory . --output-file
 > coverage.info` after running `make test`, but I got no luck with it.
 > 
 > Thank you in advance for your help.
 > 

I don't know, but I found the .github folder quite well organized when I'm 
exploring in such directions and perhaps you can gather something in there 
lcov related.

Otherwise a quick server over the PHP repositories on Github is also a good 
starting point if some documentation / scripts etc. is in a separate 
repository.

Let me know if you spot something, I'm also interested in the testing 
documentation and the phpqa docs recently went into php-src (docs) in 
April, this sounds as if this could belong together.

Best

-- hakre

---

## #128422 — Ilija Tovilo — 2025-08-07T15:44:14+00:00

URL: https://externals.io/message/128419#128422 · In reply to: #128419

Hi Vinicius


>
> I would like to know how or where I can find the code coverage for
> php-src to see if there is any uncovered code I might be able to
> contribute with new tests.

It lives here:

https://app.codecov.io/github/php/php-src

However, it seems it's currently borked. The nightly job succeeded, so
I'm not immediately sure what's wrong. I'll put it on my list, unless
somebody beats me to it.

Ilija

---

## #128423 — thomas.pakkanen@posteo.de — 2025-08-07T16:03:14+00:00

URL: https://externals.io/message/128419#128423 · In reply to: #128422

Hi Vinicius,

as Ilija mentioned you can see here an overall view on the current 55% 
line coverage in PHP. I guess its "line coverage" (a less strong code 
coverage type in comparison to types like "branch coverage", "MC/DC" or 
wonderful "path coverage"):
https://app.codecov.io/github/php/php-src?search=&trend=all%20time

More important than high line coverage would be to collect the 
requirements of features in a project, which should be tested plus 
negative variants of the reuirements. So, high code coverage is fine, 
but high test coverage would be more helpful. :)

Here some sloppy explanations:

Code coverage:
Percentage of how many lines of code are covered by automated tests.

Test coverage:
Percentage of how many defined test cases covered real requirements.

Requirement coverage:
Percentage of how many reuirements are well defined and how many are 
missing.

Be ware of:
100% line coverage does not mean anything other that 100% of the lines 
of a project a "covered" by "any" automated tests, Your project still 
includes bugs, missing features, security problems and crashes. So 
additional coverage types like input value coverage, path coverage, 
MC/DC and other helps to have more confidents in the correctness of the 
project. :)

Best regards,
Thomas

Am 07.08.2025 17:44 schrieb Ilija Tovilo:
> Hi Vinicius
> 
> On Thu, Aug 7, 2025 at 5:20 PM Vinicius Dias <carlosv775@gmail.com> 
> wrote:
> > […]
> 
> It lives here:
> 
> https://app.codecov.io/github/php/php-src
> 
> However, it seems it's currently borked. The nightly job succeeded, so
> I'm not immediately sure what's wrong. I'll put it on my list, unless
> somebody beats me to it.
> 
> Ilija

---

## #128452 — Ilija Tovilo — 2025-08-12T12:40:15+00:00

URL: https://externals.io/message/128419#128452 · In reply to: #128422

Hi Vinicius


>
> Hi Vinicius
>
> 
> > […]
>
> It lives here:
>
> https://app.codecov.io/github/php/php-src
>
> However, it seems it's currently borked. The nightly job succeeded, so
> I'm not immediately sure what's wrong. I'll put it on my list, unless
> somebody beats me to it.

Looks like whatever issue there was fixed itself. I'm happy to review
any patches improving coverage.

There are some inaccuracies with tracking, i.e. some executed lines
are marked as red. This happens often for macros that insert branches
that are never taken (and aren't intended to be taken).

We also don't care about the failure paths of the Z_PARAM_ macros.
These are tested sufficiently, so we don't need to repeat the same
test for every function.

Thanks!
Ilija
