How to test drivers ? Should we redesign the current architecture to achieve it ?

How can we test the drivers ? I am especially talking about drivers for JNode-FS but this may also apply to other kind of drivers. We I say 'test', it's mainly 'test ouside of Jnode' (and if possible without the true hardware).

Here, I just want to share some of my ideas to achieve this and also have some help from the others.

To be testable, I think that a part of the system should be layered.

In an ideal situation :
- we can isolate the layer below and the layer above the part to be tested.
- we emulate (by writing stubs) the layer below and the layer above and we can test the part and only it.

Currently, I find it difficult (maybe impossible) to isolate drivers from their device and I am asking you : should we redesign the current architecture to better achieve it ?

Does anyone have some idea or any experience of such task ?

I agree

It's a good idea. To test without real hardware you can use to mock object. Unit test for drivers can help developement and debugging.

a good tutorial to mock objects

Thanks, I think I will try this strategy.

Here is a good tutorial I found.

Fabien