From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by sourceware.org (Postfix) with ESMTPS id 6C6363857829 for ; Tue, 23 Mar 2021 21:02:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6C6363857829 Received: by mail-io1-xd2b.google.com with SMTP id z136so19234967iof.10 for ; Tue, 23 Mar 2021 14:02:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to; bh=Sr+PCCKDpdTOWXNRWlgFjuMW+SKID08TCM6OK4Wu00I=; b=RyxnKAEkGbvRRUrzlp1dDuTD8+zELGj2ubemGXCRuXTWWxW2g0gPs3dCJj+oRjT3ws 33HNsXzDdWfpNSm28fbA+6k0CaEJqEeVIgx4clogMbtSrQxgwOUTUHX+KE3ylipiM/qY Q+ISP9I9h2W+glS0Fgi6UE6XConwwKFoHI5nm+I7Vb9KKtb2RNUB6B9x2tdIz9UiYWnT c5kB911OvVaTaJG8Gd+509F0bWj7Bma178NaC1mZ/Sr7lJJWrY/xtdlpxIhdtneCX+i8 e5oO6WyVVtS2lWEId+x2ozmN5EKyZajPAn4eoWsPiJuOsKO8njPDXD112wfMZ8R4BxPh 9X6w== X-Gm-Message-State: AOAM533siMhutC/gcxaezT9dzsJWdGj0NbUW7BVSxJ4EyDAsFSwkCrlo ZGR74hQ9yv/pGIenFK6pLvrfjvaJ8XDGgzuprsw= X-Google-Smtp-Source: ABdhPJyvzyiKdI/3k/YjFcVUakJWQ6hLiXKfon0PVvvPiFV75uJO+OrREdG4HPeUxAU2izKaJX3Y4sJvdCj6xEHoK/I= X-Received: by 2002:a02:4c8:: with SMTP id 191mr6297425jab.27.1616533341960; Tue, 23 Mar 2021 14:02:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: noloader@gmail.com From: Jeffrey Walton Date: Tue, 23 Mar 2021 17:02:09 -0400 Message-ID: Subject: Re: Does glibc has complete test coverage? To: Mike Frysinger , Peng Yu , libc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 21:02:23 -0000 On Tue, Mar 23, 2021 at 4:43 PM Mike Frysinger via Libc-help wrote: > > On 23 Mar 2021 11:39, Peng Yu via Libc-help wrote: > > https://www.kernel.org/doc/man-pages/missing_pages.html > > > > "... quite a few kernel and glibc bugs have been uncovered while > > writing test programs during the preparation of man pages. " > > > > I see the above text. It doesn't make too much sense, as it indicates > > that glibc does not have complete test coverage. > > > > Why not taking an approach of always accompanying each line of source > > code with appopriate test cases? If this approach is taken, then most > > bugs should have been eliminated beforehand? > > ignoring the legacy aspect (code that's in the tree now but lacks tests), > you have diminishing returns when it comes to writing unittests, and, as > can be seen in a recent discussion, glibc is pretty tightly coupled to > the runtime environment (i.e. the host kernel). so getting an env that > matches all the different code paths is challenging. > > plus it comes down a bit to this being an open source project for many > of us, not a job, and you have to be respectful of balancing quality > and developer time with any requests you make on other volunteers. > > along those lines, this is an open source project where "patches are > welcome", so if you wanted to spend your time improving the frameworks > and coverage of our tests, we'd welcome you. Interns are usually a good choice for writing test cases. It gets them familiar with the code, frees up a senior developer's time, and helps avoid the developer's bias. Test cases are monkey work that should be delegated. When delegation does not occur it usually points back to shortcomings in project management. > also try googling for "100% test coverage" and reading the variety of > opinions the wider world has on the topic. Sorry, I could not resist.... But you know the funny thing is, when you perform a post-mortem to determine why the bug made it into production, it usually points to (1) a developer mistake and (2) lack of test case. If you break (1) or (2) you break the chain for the bug. So you either have to hire developers who don't make mistakes or provide complete test cases. Jeff