linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brendan Higgins <brendanhiggins@google.com>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: "Theodore Y. Ts'o" <tytso@mit.edu>,
	"Bird, Timothy" <Tim.Bird@sony.com>,
	Iurii Zaikin <yzaikin@google.com>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca,
	KUnit Development <kunit-dev@googlegroups.com>
Subject: Re: [PATCH linux-kselftest/test v2] ext4: add kunit test for decoding extended timestamps
Date: Wed, 23 Oct 2019 18:30:26 -0700	[thread overview]
Message-ID: <CAFd5g45qckg+sON9ErM_vWJSEy1+=jFyvXY0-zvdGfcK0wB1yg@mail.gmail.com> (raw)
In-Reply-To: <b433854d-3140-95cd-6847-003dcf3851bc@linuxfoundation.org>

On Fri, Oct 18, 2019 at 1:24 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
>
> On 10/18/19 9:27 AM, Theodore Y. Ts'o wrote:
> > On Fri, Oct 18, 2019 at 02:40:50AM +0000, Tim.Bird@sony.com wrote:
> >> We're just talking past each other.  My original e-mail was a rebuttal
> >> to your assertion that any test that was data-driven or non-deterministic
> >> was a fuzzer.  I still believe that's just not the case.  This is independent
> >> of the mechanics or speed of how the data is input.
> >
> > Apologies, I was still focused on the original context of this thread,
> > which was about suggested improvements to Iurii's ext4 kunit test, or
> > perhaps adding new features to Kunit.
> >
> >> I also conceded (multiple times) that externally data-driven
> >> techniques are probably more aptly applied to non-unit tests. I've
> >> heard your pitch about speed, and I'm sympathetic.  My point is that
> >> I believe there is a place for data-driven tests.
> >
>
> As such what this current test does is data driven right. What we are
> discussing is how the data is supplied? In this case it is embedded.
>
> > I guess I would put it differently.  The key goal is it should be
> > really easy for developers to run, create, and extend tests.
> > Data-driven tests is certainly one technique to make it easier to
> > extend tests, and indeed fs/ext4/inode-test.c is data-driven with the
> > goal to make it easier to add additional tests.
> >
>
> Again I would make the distinction that "how the data supplied".
> Embedded in the test vs. having the flexibility to accept external
> test data. From what I can tell,  I didn't see anybody say that the
> embedded data is it and nothing more needed.
>
> Instead of adding the ability to read, the suggestion is for modifying
> the data. This gets real tedious and don't think anybody will take the
> time to do it. On the other hand, is there a few test data files to run
> with, it makes it easier to exercise different cases.
>
> > Having the data for the test be external is certainly one option, and
> > there will be cases where it will make sense.  However, the overhead
> > in creating the parser for the data, and additional complexity
> > required to get the test data to be fed to the test program means that
> > that benefits need to be pretty large in order to balance the
> > additional costs of having an external data file, especially for
> > Kunit.
> >
>
> Let's explore it further before deciding whether is useful or not.
>
> > In terms of the abstract question, is there a place for data-driven
> > tests, I'm in complete agreement with you.  I've used this many times
> > personally, especially when writing tests which are implemented in
> > terms of shell scripts.  Examples of this include e2fsprogs's
> > regression test suite and xfstests.  I don't consider that a terribly
> > interesting question though; I view that as on the same order as "is
> > the sky blue?" or "are apple pies yummy?"
> >
> > The more interesting, and more concrete question is whether there is a
> > place for external data-driven tests in Kunit, and there I am *much*
> > more skeptical.
>
> This is what I am interested in exploring. I do think it will add value.
> I can see some use-cases that could benefit from this.
>
> I am not suggesting that this should happen soon. This is something that
> can be looked into for the future. I have a few use-cases in mind that
> could benefit.
>
> btw. I am by no means suggesting to that this test going in is dependent
> on the external data. I already sent my Reviewed-by for the v6 and
> planning to pull it into linux-kselftest test for 5.5-rc1.

I am not opposed to exploring this further.

How about we make this a follow up task to making a generic mechanism
for parameterized tests? I seem to recall that Tim and Iurii both
thought that a generic mechanism for parameterized tests was a good
idea, and I am certainly not opposed.

An implementation like JUnit's[1] I think would lend itself to an
extension that allows loading additional test cases in a running
kernel. Does that sound like a good starting point?

Basically, I imagine having a mechanism not dissimilar to JUnit's
parameterized tests that allows test parameters to be specified in the
test suite, but in a way that is decoupled from the test case. It
should be relatively straightforward to allow the data structure
containing the test parameters to be overridden at runtime without
really affecting how the test is implemented in anyway. It should be
transparent to the test maintainer.

Thoughts?

[1] https://dzone.com/articles/junit-parameterized-test

  reply	other threads:[~2019-10-24  1:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10  2:39 [PATCH linux-kselftest/test v2] ext4: add kunit test for decoding extended timestamps Iurii Zaikin
2019-10-10  3:46 ` Tim.Bird
2019-10-10 16:45   ` Iurii Zaikin
2019-10-10 20:29     ` Tim.Bird
2019-10-10 23:49       ` Iurii Zaikin
2019-10-10 17:11 ` Shuah Khan
2019-10-10 22:13   ` Iurii Zaikin
2019-10-11 10:05     ` Brendan Higgins
2019-10-11 13:19       ` Theodore Y. Ts'o
2019-10-12  2:38         ` Iurii Zaikin
2019-10-16 22:18         ` Brendan Higgins
2019-10-16 23:26           ` Shuah Khan
2019-10-17  0:07             ` Iurii Zaikin
2019-10-17 12:08             ` Theodore Y. Ts'o
2019-10-17 22:25               ` Tim.Bird
2019-10-17 22:56                 ` Theodore Y. Ts'o
2019-10-17 23:40                   ` Tim.Bird
2019-10-18  1:40                     ` Theodore Y. Ts'o
2019-10-18  2:40                       ` Tim.Bird
2019-10-18 15:27                         ` Theodore Y. Ts'o
2019-10-18 20:24                           ` Shuah Khan
2019-10-24  1:30                             ` Brendan Higgins [this message]
2019-10-18  1:12                 ` Brendan Higgins
2019-10-18  1:30                   ` Tim.Bird
2019-10-17 22:49               ` Shuah Khan
2019-10-17 23:07                 ` Iurii Zaikin
2019-10-17 23:12                   ` Shuah Khan
2019-10-17 23:27                     ` Iurii Zaikin
2019-10-17 23:42                       ` Shuah Khan
2019-10-17 23:54                       ` Tim.Bird
2019-10-17 23:59                         ` Shuah Khan
2019-10-18  0:11                         ` Iurii Zaikin
2019-10-18  0:38                           ` Tim.Bird
2019-10-18  1:06                             ` Iurii Zaikin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFd5g45qckg+sON9ErM_vWJSEy1+=jFyvXY0-zvdGfcK0wB1yg@mail.gmail.com' \
    --to=brendanhiggins@google.com \
    --cc=Tim.Bird@sony.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tytso@mit.edu \
    --cc=yzaikin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).