Re: Differential Code Coverage report for Postgres - Mailing list pgsql-hackers

From Jacob Champion
Subject Re: Differential Code Coverage report for Postgres
Date
Msg-id CAOYmi+mybrn=kMQjAAm0i5+zifoAtPZdkA=diiFn4QwFoFaz7g@mail.gmail.com
Whole thread Raw
In response to Differential Code Coverage report for Postgres  (Nazir Bilal Yavuz <byavuz81@gmail.com>)
Responses Re: Differential Code Coverage report for Postgres
List pgsql-hackers
On Fri, Sep 5, 2025 at 12:09 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
> I have been working on generating differential code coverage for
> Postgres and was able to do so with this script [1]. The script checks
> out HEAD and the latest release branch (currently REL_18_STABLE), then
> generates a differential coverage report.

This is fantastic timing! Differential coverage will be incredibly
useful to have for some upcoming test patches I am writing. :) I will
take a look.

I think LCOV's display table is a bit confusing, especially in how
they've chosen to include unchanged code in their percentage count for
the differential, but I suppose I'll get used to it.

On Fri, Sep 5, 2025 at 3:39 AM Oreo Yang <oreo.yang@hotmail.com> wrote:
> It looks very cool.
> So our goal over 90%?

I think our goal should be to pin behavior that needs to be pinned,
and use coverage as a helpful indicator as to what is missing.

(There are many ways to write low-quality tests that cover a lot of
code. I don't think we should be chasing numbers; we should be saying
"oh, 25% in this section is really bad" and then remedying that. If
you do that over and over again, you get really high coverage numbers
organically as a result of your higher-quality tests.)

Thanks,
--Jacob



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Eager aggregation, take 3
Next
From: Andres Freund
Date:
Subject: Re: Differential Code Coverage report for Postgres