web...@fl... wrote:
> Even though we've tested the driver quite a bit, we don't have any
> specific tests. We really need a set of tests that we can run every
> time we make any changes to the code. Proper regression testing.
>
> If you can think how to get us started that would be much appreciated.
> (Or if you know what questions I should be asking myself).
OK.
I am very fond of automated tests. I had excellent experience with the xUnit
test framework in a big development I lead last year. Not sure how to apply
those concepts here though... For those who never heard of xUnit a rough idea
is to make code that tests your code, with specific unit tests. So after you
do a change to your source you would run the automated tests to check if you
broke something that is already covered by the tests.
For the ntfs write part I believe We could do something like this:
- we know some basic rules the ntfs structures follow when they consistent
- we write functions that test for these rules, example:
- do the two XYZ structures that exist in the fs have the same information
- do all entries in the journal have valid transactions
- we write tests that invoke these functions and inform us if all is OK
- each time we implement more ntfs write functionality or change ntfs write
code we run the new code, change a file, then run our automated tests
- if our automated tests fail, well, our code additions/changes suck
- I know the ntfsfix has some "tests" inside it, but from what I saw they are
not organized as functions that could be called from an automated tester system.
The good thing about using automated testers is that it becomes quite fast to
test, and as we write new automated testers we get more tests without spending
much more time, because they are automated anyway.
Well, it seems logical that the best test is really if windoze accepts our
changes to the FS or not... maybe we should write testers in windoze, and run
them from windoze.
How about this:
- we create test code in windoze to open, read a file, then modify it
- if all operations succeed, in theory our ntfs write didn't break anything
- so, we run our ntfs write
- we do NOT run ntfsfix
- reboot in windoze
- run our windoze tester on the file we manipulated
Another idea, mixing Linux and windoze:
- we create a utility that makes a copy of the NTFS structures to disk files
- we run our ntfs write code, followed by ntfsfix to ask windoze to check the ntfs
- reboot in windoze, let it check and if necessary fix
- reboot in Linux
- run ou utility again, and have it intelligently compare the current
structures with the ones we dumped earlier. By intelligently I mean with
functions that identify what changed in which structure and translates that to us.
- this idea might not work due to other changes that windoze might make to the
FS independent of the changes we did (like due to antivirus or other automatic
on boot crap)
Maybe some of this is what you guys are already doing. Comments?
Fabio
|