Today our QA Specialist in drivers reveals the secrets of testing this type of software. Practices for testing different types of Windows drivers are presented in the article below.
- General aspects of driver testing
- File System Filter Drivers Testing
- Network Redirection Drivers Testing
- Virtual Storage Drivers Testing
- USB Client Device Drivers Testing
As we know, Windows drivers can run and work in either user mode or kernel mode.
Kernel-mode drivers run as part of the operating system and possess the privileged abilities. The drivers reviewed below are the drivers of kernel level. As any software testing procedure, driver testing includes automatic and manual testing, but in this article we will focus mainly on the last one.
Later we will review testing process for the followings types of drivers:
- File System Filter Drivers
- Network Redirection Drivers
- Virtual Storage Drivers
- USB Client Device Drivers
First of all, I would like to say "Don't install the driver to be tested on your working system!" However, there are some exceptions on this occasion, for example:
- You are looking for a reason to reinstall your system...
- You don't want to waste time on searching bugs on the clean test systems...
- You are sure that the driver is stable...
- You have to test the work of the connected devices...
Secondly, driver tester must have a virtual machine installed on the working computer and at least one real test computer.
Thirdly, before starting the testing procedure, it is necessary:
1. To define the number of operating systems for which it is necessary to check the driver functionality. Usually, first of all you use the OS confirmed by the specification. Let's suppose that a driver must successfully work under Windows 2000/XP/Server 2003/Vista accordingly to the requirements. Applying our experience in driver testing, we extend this list to the following:
- Windows 2000
- Windows 2000 sp4
- Windows XP_sp0
- Windows XP_sp1
- Windows XP_sp2
- Windows XP_(Windows is installed on FAT32) (obligatory system)
- Windows Server 2003 Standard Edition
- Windows Server 2003 Enterprise Edition
- Windows Vista
- Windows Server 2003 Small Business
- Windows Server 2003 Enterprise EditionSp1
At that, it's desirable for all of these systems to be Checked Build versions. Using the Checked version slows down Windows functioning, but multiplies probability of finding bug in the driver functioning. If there is no a single Checked Windows, it is necessary to purchase the Checked version of at least one system, for example from the Windows XP series.
Thus Windows XP_Chk is added to the OS list. But you shouldn't limit you work only to this list: the more the number of OS, under which driver passed the complete testing successfully, the better quality of product guaranteed.
2. If possible, select test computers with as different hardware and configurations as possible. I recommend obligatory test on machines with single processor, single processor with Hyper-Threading, two-core processor and dual processor machines.
3. To make the following settings for each OS where driver testing will be performed: in System Properties\Advanced\Startup and Recovery Settings\Write debugging information it's necessary to select Kernel memory dump or Complete memory dump, and uncheck Automatically restart option for the case of you won't be nearby in the moment of Blue Screen appearance.
4. To set verification by standard Driver Verifier Manager of the system with all options, except for Low resource simulation. This is determined by the fact that at first you must obtain stable functioning of driver without the option of Low resource simulation, and then test the functioning with this option on smoke tests.
5. To select antivirus software with which it is desirable to test the driver performance. Usually it's recommended to take the most commonly used antivirus programs, such as DrWeb, Kaspersky Antivirus, V3, Symantec Norton Antivirus, NOD32. The list is not limited to these names, of course. The more programs you will test, the better driver performance will be; this will only increase the quality of product.
6. To verify compatibility of your driver with other drivers, the system ones and the drivers by other producers. It is desirable for the last ones to be stable enough - in this case it will be easier for you to discover reasons for improper work of the system or Blue Screen appearance, and to expose bugs in driver performance.
The next general aspect of driver testing is verification of driver loading and unloading, i.e. you set the group of tests that are relevant to each driver:
- Driver installation. The script for driver installation can be written by programmer, but the tester verifies whether it's done correctly. Here we check the following:
- Has the system crashed after driver installation or not?
- Has *.sys file been written in the C:\WINDOWS\system32\drivers directory?
- Have necessary keys been registered in Registry, if they are presented in our case?
The driver installation not always supposes its start - it depends on implementation of driver. Some of them run after system restart and cannot be stopped during the process of work (usually these are File System Filter Drivers), therefore the following questions arise:
- Does system start correctly with installed driver?
- Does system crash when the driver is started manually?
- System Restart while the driver is working. System must be normally rebooted without Blue Screen; after system start, the driver and its settings must comply with the statuses described in the specification.
- System Reset while the driver is working. System must perform the Reset operation and start without Blue Screen; after system start the driver and its settings must comply with the statuses described in the specification.
- System shutdown while the driver is functioning. System must perform the Shut down operation successfully without Blue Screen.
- System Start with the pre-installed driver. System must be rebooted without Blue Screen; after the system starts, the driver and its settings must comply with the statuses described in the specification.
Further work of driver tester includes functional testing of the testing object and search of BSOD, which features depend on the type of testing driver.
The drivers of this type are designed for enhancement of the file system functionality, for example for catching operations of OS in order to watch, forbid or permit certain processes, operations, files in certain disk space. The set of tests to verify the driver functionality is formed in accordance with the type of driver and here you have to pay special attention to the software products workings with network places.
Let's consider an example when we use a database with the multi-users connection status. Let's suppose that the real multi-users DB1 is on the computer N1 and we can work with DB1 on the computer N2 without problems. Let's install some File System Filter Driver on the computer N1 and computer N2. When trying to get access to DB1 from the computer N2 we can get such results:
- DB1 on the computer N1 is not accessible for the computer N2;
- N1 computer has crashed with BSOD;
- N2 computer has crashed with BSOD;
- DB1 remained accessible for using on the computer N2.
It is necessary to test an access to Shared Folders from one machine to another. Thus you have to test standard operations of creation, deleting, copying, renaming, moving of small and large folders and files in Shared Folders.
An insidious test is the starting of some *.exe file both from network space and locally.
On the test system, it's useful to run software products which perform file system indexing (for example, Google Desktop). BSOD or Dead Lock of system with installed File System Filter Driver can occur when such programs are started or functioning.
System can work inadequately after installation of new Virtual Storage Driver (these drivers are developed for creation of virtual encrypted disks) or while it's functioning. BSOD or noticeable slow down in system performance can happen as a result of File System Filter Driver and Virtual Storage Driver interaction - naturally, it's not good.
In my opinion, this type of drivers is the hardest from the view of covering full set of tests, and the most unforeseeable in system crashes while driver is functioning.
Network Redirection Driver is a network file system which gives access to the resources of remote computer. In practice, such drivers are used for creation of network disks, and we will examine such drivers in this paragraph.
First of all, it's necessary to select test data, so we will take:
- Files and folders of small size (to 10Mb);
- Files and folders of large size(more than 600Mb);
- Folders containing some nested files and folders (one folder for one file);
- Folders containing a great number of nested files and folders (nesting is equal to 5; the number of files (size to 1K) is more than 100 in each folder).
In this case main tests are divided into the followings groups:
Group #1 is "Verification of network disk displaying". After connecting network disk that is implemented on the base of Network Redirection Driver, this disk must be displayed in all of the file managers.
Group #2 is "Verification of functionality"
- Testing the standard operations (opening, change, hiding, creation, deleting and other) with files and folders on a network disk.
- Testing the operations of copying, saving files and folders to/from a network disk from/to a local disk. It's necessary to pay special attention to all of applications included in MSOffice package, MindManager and also to verify saving project of MS Visial Studio from local space to a network disk and compiling this project.
- Testing the operations of copying when size of copied files is changed and also when an operation of copying/saving files is interrupted incorrectly.
- Testing software product on the different language versions of OS, for example under English and Korean OS, and performing tests from the first three points of Group #2. The driver must automatically pick up the language of the system and successfully perform all available operations with files and folders.
- Testing search function on a network disk.
- Checking the data integrity when moving them from a local disk to a network one and vice versa.
Group #3 is "Verification of data exchange speed"
- Testing speed on every set from the group of test data when downloading to Network Disk from Local Disk.
- Testing speed on every set from the group of test data when unloading from Network Disk to Local Disk.
At that, it is necessary to take into account the capabilities of data transfer over the local network and capabilities of network protocols both with data cashing and without it. If you can get an analogue product, then compare its speed with the speed of your product.
Group #4 is "Disconnect"
- Checking the reaction of the system to disconnecting the network cable with the network disk connected:
- during uploading of each set from the group of test data;
- during downloading of each set from the group of test data.
- Testing the reconnect of network disk after plugging connecting network cable to the computer.
Group #5 is "Users sessions"
- Testing network disk performance for different users in the terminal session of Windows Server2003.
- Testing network disk performance for different users with Switch option on Windows XP.
- Testing network disk performance for different users with Login switching on Windows Server2003.
Virtual Storage Driver is virtual data storage (for example, it can use random-access memory or file). Usually it is used for implementation of virtual encrypted disks.
Main points when testing this type of drivers are:
- Standard operations (opening, change, hiding, creation, deleting and other) over files and folders on a virtual disk.
- Creation of image of maximum possible size; its formatting.
- Data safety when working with different encrypting algorithms.
- Driver speed (reading / writing to/from a virtual disk).
- Place of images localization (USB memory, Network Disk, Local Disk) and ability to access it.
- Data integrity on repeated connection of image after incorrectly disabled access to image had happened.
USB Client Device Driver manages USB device, interacts with it by means of USB packages (URB), for example, for redirecting requests to another computer. The real USB devices are always involved in testing of such drivers; therefore the critical errors occur mostly during interaction between the driver that is tested and devices' drivers. For example, BSOD can happen on a computer with USB Client Device Driver installed when the following actions are performed:
- connecting new USB device;
- correct removing of USB device;
- incorrect removing of USB device;
- installing drivers for USB devices;
- working with USB device.
Remember that correctly chosen set of tests for the certain type of driver helps your to improve the quality of your product.
Continue reading about drivers R&D with this article about File system filter driver development.
Take a look at our proprietary technologies: Sound capture software development kit