From: Jared Hulbert <jaredeh@gmail.com>
To: Nicolas Pitre <nico@cam.org>
Cc: MTD List <linux-mtd@lists.infradead.org>,
"Eric W. Biederman" <ebiederman@lnxi.com>
Subject: Re: Unit test for cfi_cmdset_0001.c
Date: Fri, 28 Jan 2005 17:48:10 -0800 [thread overview]
Message-ID: <6934efce050128174863077433@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0501281508160.21048@localhost.localdomain>
> I can see that. But in this particular case I think it would be better
> for code maintainability, and more importantly upstream code acceptance,
> that the code remains as is and that you write a small perl script to
> split it up automatically.
Right, #1 it is then. For now that is, until ya'll see how niffty the
test tools are.
> The test tools could be committed to the MTD
> CVS but they would never see the mainline tree.
I couldn't, wouldn't, shouldn't ask for more.
> That's why I'm not sold to the idea since that particular driver sees
> its core complexity in the locking, scheduling and concurrent stomping
> on the state machine. I don't think synthetic tests can replace careful
> inspection and perfect understanding of the code. Static analysis tools
> like sparse should help with locking correctness though. But I'm always
> open to be shown otherwise!
I think you'll be surprised how much of that locking and concurrency
we can test.
> For filesystems I can imagine. It has many more conditions to deal with
> and making sure all of them are tested can be tedious. But
> purely writing to
> flash is not that complex (or is it?) compared to all the needed code
> above that dealing with concurrency.
>
> I remember the first Linux NOR flash driver I wrote in 1997: pure char
> device, no MTD layer, no reentrancy, no scheduling, just the pure flash
> read/write. It was in the order of 20 to 30 lines of code. I made it a
> block device with about 20 additional lines. It even was able to deal
> with flash errors! More than that like what we have today is
> performance stuff.
Anything paragraph about coding that starts with 'I remember' is pure gold!
I don't know. The drivers are not that simple. Lots of obscure cases
and states. I can say this much, almost every bug I've seen would be
have been found by a unit test. Of course this is almost as much
because of the process of creating the tests as actually running them.
Running the tests will make sure you don't reintroduce bugs you found
before as the code evolves.
prev parent reply other threads:[~2005-01-29 1:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-28 1:20 Unit test for cfi_cmdset_0001.c Jared Hulbert
2005-01-28 2:12 ` Nicolas Pitre
2005-01-28 2:16 ` Josh Boyer
2005-01-28 6:11 ` Eric W. Biederman
2005-01-28 19:47 ` Jared Hulbert
2005-01-28 20:59 ` Nicolas Pitre
2005-01-29 1:48 ` Jared Hulbert [this message]
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=6934efce050128174863077433@mail.gmail.com \
--to=jaredeh@gmail.com \
--cc=ebiederman@lnxi.com \
--cc=linux-mtd@lists.infradead.org \
--cc=nico@cam.org \
/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