From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58E87CA9EC8 for ; Fri, 18 Oct 2019 00:12:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30D1B222C4 for ; Fri, 18 Oct 2019 00:12:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OnY/jB02" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441868AbfJRAMK (ORCPT ); Thu, 17 Oct 2019 20:12:10 -0400 Received: from mail-qt1-f180.google.com ([209.85.160.180]:44891 "EHLO mail-qt1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727941AbfJRAMK (ORCPT ); Thu, 17 Oct 2019 20:12:10 -0400 Received: by mail-qt1-f180.google.com with SMTP id u40so6433761qth.11 for ; Thu, 17 Oct 2019 17:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qlq0IBiJL0VWJaCjGOCVLXHXeTcQVmXh3XXXt8eG1zQ=; b=OnY/jB02QlN859S24vGJBoK4ibrxELgo8ZrWRymSY5IyrxS7/rucba8CYiQY/ytBbj 0f7mg+YQZAqF9qNRsAfUbdCG+L4S9+BA5V5CstZLGkUwR41tu/WbEp2Z+5ZbawMsbH8W G3CtwTt1FZiqHrWwKuN89rlvCuSxnkXbd9QqYtjVda8zlbQXNOfzbu6e+mwWwJmG/z4t Vw4BkndsfvVTUvXZJGN4wBTKSLJWdTNJH5TuzgRI87iftvJzOAxkfbUeF45XllwwpGxt yj5fTii+SfJKvAOoBP2clqqoZjhmYy0JT7z73lVw3LnHZM5z84LMR/IZF7KLDBscWvBX pQwA== 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:from:date :message-id:subject:to:cc; bh=qlq0IBiJL0VWJaCjGOCVLXHXeTcQVmXh3XXXt8eG1zQ=; b=UB03TXxpUXyNgqa3uzMCWvQaqT3FxPAWcQXVSbC6/KWyzZSfLODJxB6TcIGnZINBON 6PWL1/NqU6m8SQWYzROcAOhhYkeZXLVUEQCXow+qvaNikIf5Boo6MOIGZCs93Wzb+QQV bDHaKk6QBTCsAnIpEbkRdmBkOw++jEgad8NTz+p+6QpbLrmV+6jUYkQRrruF0c6vfLCD 2E7Sq9RJh9706EV7vJDy55feVFtCylTAj0qlwEKYwTK1uVkMtv0OXxaQTgkjGBu6q6So pGpPKTHwVTSfykZSDjxN5a90x4up6d1+6M3WbSVLeHlQLui4z6lDGFwKbAJ9ZEbWXEPS duWw== X-Gm-Message-State: APjAAAWyrek3WbNJFeSRBU8Gg0fKtXR7vGzN3Xlk4rLGsKk29TjOWUXY 1DngJgx1tnckj6zeWh5vvlYIjMEuh4NHow9OA5My X-Google-Smtp-Source: APXvYqzSSMaJzwQe/BcWiaYKohAlQjCz1k+BmS4OfRilFXDbIOi5CgMQM6qGy9vR+wk2MO4LlQWbYrwHLDSwRBqYG1M= X-Received: by 2002:ac8:5147:: with SMTP id h7mr6874621qtn.160.1571357529021; Thu, 17 Oct 2019 17:12:09 -0700 (PDT) MIME-Version: 1.0 References: <20191010023931.230475-1-yzaikin@google.com> <2f2ea7b0-f683-1cdd-f3f2-ecdf44cb4a97@linuxfoundation.org> <20191011131902.GC16225@mit.edu> <1e6611e6-2fa6-6f7d-bc7f-0bc2243d9342@linuxfoundation.org> <20191017120833.GA25548@mit.edu> <957434b6-32cc-487f-f48e-f9c4416b3f60@linuxfoundation.org> <40073fc9-1de1-9253-e2f9-9cf9ee4308d4@linuxfoundation.org> In-Reply-To: From: Iurii Zaikin Date: Thu, 17 Oct 2019 17:11:32 -0700 Message-ID: Subject: Re: [PATCH linux-kselftest/test v2] ext4: add kunit test for decoding extended timestamps To: "Bird, Timothy" Cc: Shuah Khan , "Theodore Ts'o" , Brendan Higgins , "open list:KERNEL SELFTEST FRAMEWORK" , linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca, KUnit Development Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Oct 17, 2019 at 4:54 PM wrote: > > > > > -----Original Message----- > > From: Iurii Zaikin > > > > > You can do all of this and allow users to supply another set of data. > > > It doesn't gave to be one or the other. > > > > > What is the use case for running a unit test on a different data set than > > what it comes with? > > I just gave some ideas in another message (our emails crossed), > but one use case is to allow someone besides the test author > to inject additional data points, and to do so without having to re-compile > the code. > > They might do this for multiple reasons: > - to experiment with additional data points > - to try to diagnose a problem they are seeing > - to fill gaps they see in existing data points > > Whether this makes sense depends on a lot of factors. I suspect > the timestamp test code is not a good candidate for this, as the code > is simple enough that adding a new test case is pretty trivial. For some > other types of tests, adding the data via an external file could be easier > than changing the code of the test. I think feeding test data without recompiling looks attractive right now because in order to run a single test you need to compile and link the whole kernel. I believe KUnit's strategic goal is the ability to only compile the relevant bits, which is admittedly very far off. Normally, in application programming the amount of code that needs to be recompiled in order to run a test suite is small enough that the added complexity of enabling the test to get the data from external sources is not warranted. Typically, external files are used when something is not practical to include in the source file directly due to size or complexity, i.e. a large snippet of text, an image file, some binary data etc. Such needs are typically addressed by the test author rather than the core test framework. Now, in application programming you can do a lot of things like reading a file which is trickier in kernel. But again we've come to supporting a use case for test data which has to be fabricated through some involved process or otherwise not easily included in the source file. And if you come up with an additional test case, why not just add it and leave it there? Unit tests are cheap, even if a case proves to be redundant, the mere fact that the code under test made you think of such a case is sufficient to permanently include the test case into the test suite.