Hi Alberto,
No, not at all.
I really dont see anyway I can be independent of all apis, development
tools, debugger and other stuff. I have to depend on something to start
with. For commercial products, time/cost/etc matters most. BTW, I’d been
involved in multiplatform projects, and all the base synchronization APIs
were wrapped around to make them platform independent, but still baseline
apis were used. It made sense to me.
Alberto, you probably are a Sr. Scientist. But what you mentioned ( and if
I take limit tends to infinity) every one should either have source code
with them or dont use API or any infrastructure. This is what bothers me
most. It really fails my belief for abstraction(s). I dont want to build
my shoes, period. I would try to use it, and with caution, if it hurts,
return or throw, and never use. But I dont want to make shoes unless I see
there is/are no other choices. It should be applied to all aspects of
life, and that is my belief.
So there is the optimization and/or clear boundary that I’m trying to
emphasize. And again, your approach might not fit the bill :).
Finally, I know you are an EE, solid state physicist and what not :-). But
what I’m after is separation of concern for most designer/developer.
I agree that debugging at assembler level is important. Well sometimes,
not all the times.
I agree that trust anything with caution. Even breathin Air.
I dont agree to avoid most of the API while I’m on commercial programming.
I dont agree that I’ve to have the source before I use it.
-pro
Hi, Pro,
You seem to have put your finger right on my development
approach. Yes, I happen to know assembler well, and I do believe
that it is fundamentally important to know the machine
architecture well enough, which leads to knowing what’s going on
at electronics level - and yes, I’m an EE and I kind of
understand it all the way from Solid State Physics, although I’m
not an expert except on my own professional area.
It makes for having a machine-architecture-centric approach to
development, rather than an OS-centric or an API-centric. To me,
OS’s are by and large similar, see one see all, and the
differences are relatively minor. To me, APIs are pretty
irrelevant in the big picture: you learn them, you use them to
your best advantage, you discard them when they don’t suit your
best interest, and most of all, you isolate them from your
mainstream code so that you know exactly where you must rely on
an API, and then you can minimize those occasions. And if you
can avoid an API, you avoid it, because if you use my
development approach, you trust your hand better than you trust
the hands who wrote that API routine.
I believe that from an engineering point of view it makes sense
to have as much control over the code as possible. So, my
philosophy is, I’ll reuse anything I wrote; I’ll reuse a fair
amount of stuff that I have control over its source code; I’ll
be very, very reluctant about reusing anything I don’t have
direct source code control.
That’s why I like to see my code working, instruction by
instruction, before I go into automated testing. And I also like
to see the compiler’s code working at machine level too,
because, again, I’m not sure I trust compilers: I’ve seen enough
to feel the urge to vet their generated code.
I only trust my own teeth, and even then, occasionally they bite
back my tongue!
Alberto.
----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 10, 2005 11:37 AM
Subject: RE: [ntdev] Driver Unit Tests
This is all well and good I suppose, and it reminds me the days
when Ken
Thomson openly said " You all need to worry when you hire a
programmer
like me". Well the context was for security/correctness etc of
programs.
And I see your point here.
But how could you avoid all ( or as much as posssible)
dependencies ?.
When you put out a software, I or other ( ie. the set of all
programmers
except U ) will have the same feeling.
It is really really good to program in assembler, it is also
very good to
get into microcode, it is also very good to know the working of
the
circuits, and finally it is extreemly good to know how the
semiconductor
physics is working ( A relative of mine taught me that
everything is
carbon, boy ! ).
But from engineering sense, it would not make any sense to do
everything
on your own.
But one thing I agree, what fits the bill ( or rather whatever
makes
someone comfortable). After all the idea is to have good quality
product
:).
-pro
----- Original Message -----
From: “Alberto Moreira”
To: “Windows System Software Devs Interest List”
Sent: Saturday, December 10, 2005 6:36 AM
Subject: Re: [ntdev] Driver Unit Tests
> Hi, Else,
>
> I’m a low level programmer, and assembler is still my choice
> computer language, so, you may not find this very helpful,
> Still…
>
> I find it important to use a debugger and to single-step at
> least once through every nook and cranny of my driver. What I
> normally do is, I write a few very simple C++ or C# test
> programs that exercise the driver API and its functions, one
> at
> a time, and then I use SoftICE or Windbg to step through the
> whole thing. So, I might first write a program that does an
> Open
> and nothing else, then I add a Close, then I add a Read, then
> I
> replace it by a Write. If I’m doing Ioctls, I write one little
> test for each Ioctl, and here again, my emphasis isn’t in
> seeing
> the result but in being able to reach into the code. I only
> feel
> happy when I have covered all my code, and only then I go for
> results-oriented testing.
>
> Also, if the peripheral has plug-and-play or power
> requirements,
> I delay complex things like hot plugging and unplugging, power
> irps, and so on, until I have single stepped enough through my
> driver that I’m happy with the way things work. I pay
> particular
> attention to tables, lists, queues, and so on. I also make
> sure
> that every shared data structure has its own Mutex or
> Semaphore,
> I make sure that every time someone uses that structure the
> Mutex gets exercised properly, and so on. And I may be a bit
> paranoid, but I need to single step through the code to see
> it,
> nothing else does it. And I step through it at assembler
> level,
> paying very good attention to what code the compiler generated
> for me; I do not trust compilers!
>
> Only after I have single stepped through the whole driver a
> healthy number of times I will then resort to tools like
> Verifier or Prefast, that is, when I use them at all. I have
> another personal trait, I am a strict observer of Occam’s
> razor,
> and I only use an API when I cannot possibly avoid it; hence,
> I
> tend to be more self-relying than other driver writers, and my
> drivers have less code that I do not directly control. I also
> try to isolate those parts of the driver that depend on the
> API,
> so that I can test the API independently of the driver: I
> often
> stub API-independent routines when I’m testing the API, and I
> replace my API modules with some hand-crafted code to test my
> own code independently of the APIs. It’s one thing that gives
> me
> the jitters, to have to trust someone else’s code and I cannot
> control or freely modify it! Hence, I’m very careful with my
> own
> code, and I carefully single-step through it, over and again,
> until I’m happy with the way it looks and performs.
>
> Hope this helps!
>
>
> Alberto.
>
>
>
> ----- Original Message -----
> From: “Else Kluger”
> To: “Windows System Software Devs Interest List”
>
> Sent: Friday, December 09, 2005 6:35 AM
> Subject: [ntdev] Driver Unit Tests
>
>
>> Hi,
>>
>> has anyone of you experience with unit testing in kernel mode
>> ?
>> I feel quite comfortable (and nearly secure) with Driver
>> Verifier,
>> having extensive registry configurable debug logs
>> and running Prefast from time to time.
>> And I have no idea how to mock OS functionality in a way to
>> make
>> it feel real for the driver.
>>
>> best regards
>> Else
>>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to
xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@garlic.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
NOD32 1.1317 (20051209) Information
This message was checked by NOD32 antivirus system.
http://www.eset.com