Test Objective
Verify that all IOCTL endpoints have comprehensive documentation including Doxygen-style comments (brief, details, parameters, return values, examples), README with quickstart guide, error handling reference, and working code examples in examples/ directory.
Traceability
Test Type
- Type: Documentation Quality Test
- Level: Meta-Test (validates documentation completeness)
- Priority: P2 (Medium)
- Execution: Automated (Doxygen warnings) + Manual review
Test Environment
Software:
- Doxygen 1.9+ (documentation generator)
- C/C++ compiler (validate examples compile)
- Markdown viewer (validate README rendering)
Tools:
- Doxygen (HTML generation)
- Code linter (comment syntax validation)
- Spell checker (documentation quality)
Prerequisites
- All IOCTL definitions in
avb_ioctl.h
- Doxygen configured (
Doxyfile present)
- Examples directory created (
examples/)
Test Procedure
Test Case 1: All IOCTLs Have Doxygen Comments
Steps:
- Parse
avb_ioctl.h for all #define IOCTL_* definitions
- For each IOCTL, check for Doxygen comment block above definition
- Verify comment includes required sections:
@brief, @details, @param, @return, @example
Expected Results:
- ✅ 100% of IOCTLs have Doxygen comments
- ✅ All required sections present
- ✅ No IOCTLs undocumented
Validation Script (PowerShell):
# extract-ioctl-docs.ps1
$ioctlDefinitions = Select-String -Path "avb_ioctl.h" -Pattern "#define IOCTL_" | Select-Object -ExpandProperty Line
$undocumented = @()
foreach ($ioctl in $ioctlDefinitions) {
$ioctlName = $ioctl -replace ".*#define\s+(\S+).*", '$1'
# Check for Doxygen comment before definition
$hasDoc = Select-String -Path "avb_ioctl.h" -Pattern "\/\*\*.*@brief.*$ioctlName" -Quiet
if (-not $hasDoc) {
$undocumented += $ioctlName
}
}
if ($undocumented.Count -gt 0) {
Write-Host "❌ Undocumented IOCTLs:"
$undocumented | ForEach-Object { Write-Host " - $_" }
exit 1
}
Write-Host "✅ All IOCTLs documented"
Test Case 2: Doxygen Generates HTML Without Warnings
Steps:
- Run
doxygen Doxyfile
- Check for warnings in
doxygen.log
- Verify HTML output generated in
docs/html/
Expected Results:
- ✅ Zero Doxygen warnings
- ✅ HTML files generated
- ✅ Index page (
index.html) accessible
Doxygen Configuration (Doxyfile):
# Project settings
PROJECT_NAME = "IntelAvbFilter IOCTL API"
PROJECT_BRIEF = "NDIS Lightweight Filter for Intel AVB (IEEE 802.1AS/Qav)"
OUTPUT_DIRECTORY = docs
GENERATE_HTML = YES
GENERATE_LATEX = NO
# Input files
INPUT = avb_ioctl.h examples/README.md
FILE_PATTERNS = *.h *.c *.md
RECURSIVE = YES
EXCLUDE = build/
# Warnings
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = YES
Validation:
doxygen Doxyfile 2>&1 | tee doxygen.log
# Check for warnings
if grep -q "warning" doxygen.log; then
echo "❌ Doxygen warnings found"
exit 1
fi
# Verify HTML generated
if [ ! -f docs/html/index.html ]; then
echo "❌ HTML documentation not generated"
exit 1
fi
echo "✅ Doxygen documentation generated successfully"
Test Case 3: README Quickstart Works in <5 Minutes
Steps:
- Give README to new developer (simulated)
- Follow "Quick Start" section verbatim
- Measure time from start to running code
Expected Results:
- ✅ Quickstart code compiles without errors
- ✅ Code runs and produces expected output
- ✅ Elapsed time <5 minutes
Quickstart Code (examples/README.md):
## Quick Start
1. **Open device handle**:
```c
HANDLE hDevice = CreateFile(
"\\\\.\\IntelAvbFilter",
GENERIC_READ | GENERIC_WRITE,
0, NULL, OPEN_EXISTING, 0, NULL
);
-
Query PHC time:
PHC_TIME_QUERY query = {0};
DWORD bytesReturned;
DeviceIoControl(hDevice, IOCTL_PHC_QUERY_TIME,
NULL, 0, &query, sizeof(query), &bytesReturned, NULL);
printf("PHC: %lld ns\n", query.Nanoseconds);
-
Close handle:
Build:
cl /nologo quickstart.c /Fe:quickstart.exe
Expected Output:
PHC: 1640995200123456789 ns
**Validation** (Timed Test):
```powershell
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
# Step 1: Copy quickstart code to file
@"
#include <windows.h>
#include <stdio.h>
// ... (quickstart code)
"@ | Out-File quickstart.c
# Step 2: Compile
cl /nologo quickstart.c /Fe:quickstart.exe
# Step 3: Run
./quickstart.exe
$stopwatch.Stop()
if ($stopwatch.Elapsed.TotalMinutes -gt 5) {
Write-Host "❌ Quickstart took >5 minutes: $($stopwatch.Elapsed.TotalMinutes) min"
exit 1
}
Write-Host "✅ Quickstart completed in $($stopwatch.Elapsed.TotalMinutes) minutes"
Test Case 4: All IOCTLs in Reference Table
Steps:
- Extract IOCTL definitions from
avb_ioctl.h
- Extract IOCTL table from
examples/README.md
- Compare lists (all IOCTLs must be in README)
Expected Results:
- ✅ README table includes all IOCTLs
- ✅ No IOCTLs missing from table
- ✅ Table includes: Function, Admin Required?, Blocking?
README Table Example:
## IOCTL Reference
### PHC (Precision Hardware Clock) IOCTLs
| IOCTL | Function | Admin Required? | Blocking? |
|-------|----------|-----------------|-----------|
| IOCTL_PHC_QUERY_TIME | Read current time | No | No (<100µs) |
| IOCTL_PHC_ADJUST_OFFSET | Adjust time offset | Yes | No (<500µs) |
| IOCTL_PHC_ADJUST_FREQ | Adjust frequency | Yes | No (<500µs) |
Validation Script:
# Compare IOCTLs in header vs README
$headerIoctls = Select-String -Path "avb_ioctl.h" -Pattern "IOCTL_\w+" |
ForEach-Object { $_.Matches.Value } | Sort-Object -Unique
$readmeIoctls = Select-String -Path "examples/README.md" -Pattern "IOCTL_\w+" |
ForEach-Object { $_.Matches.Value } | Sort-Object -Unique
$missing = $headerIoctls | Where-Object { $readmeIoctls -notcontains $_ }
if ($missing.Count -gt 0) {
Write-Host "❌ IOCTLs missing from README:"
$missing | ForEach-Object { Write-Host " - $_" }
exit 1
}
Write-Host "✅ All IOCTLs documented in README table"
Test Case 5: Error Codes Have Recovery Actions
Steps:
- Extract all
STATUS_* codes from IOCTL implementation
- Check README error handling guide for each code
- Verify recovery action documented
Expected Results:
- ✅ All error codes in README table
- ✅ Each error has recovery action
- ✅ Common errors prioritized (e.g., STATUS_INVALID_PARAMETER, STATUS_ACCESS_DENIED)
Error Handling Table (examples/README.md):
## Error Handling Guide
| Error Code | Meaning | Recovery Action |
|------------|---------|-----------------|
| STATUS_INVALID_PARAMETER | Invalid input buffer | Check buffer size and alignment |
| STATUS_DEVICE_NOT_READY | Driver not initialized | Retry after 100ms |
| STATUS_TIMEOUT | Hardware timeout | Check NIC status, may need reboot |
| STATUS_ACCESS_DENIED | Insufficient privileges | Run as Administrator |
Test Case 6: Example Code Compiles Without Warnings
Steps:
- Compile all
.c files in examples/ directory
- Enable all warnings (
/W4 or -Wall)
- Verify zero compiler warnings
Expected Results:
- ✅ All examples compile successfully
- ✅ Zero compiler warnings
- ✅ Executables run without crashes
Build Script (examples/build-all.cmd):
@echo off
for %%f in (*.c) do (
echo Building %%f...
cl /nologo /W4 /Zi %%f /Fe:%%~nf.exe
if errorlevel 1 (
echo ❌ Compilation failed for %%f
exit /b 1
)
)
echo ✅ All examples compiled successfully
Test Case 7: Example Code Runs Successfully
Steps:
- Run each example executable
- Verify expected output or behavior
- Check for crashes or errors
Expected Results:
- ✅ All examples execute without crashes
- ✅ Output matches expected format
- ✅ Examples demonstrate documented IOCTL usage
Examples:
phc_query.exe → Outputs: "PHC: 1640995200123456789 ns"
phc_adjust.exe → Outputs: "✅ PHC offset adjusted by +1000 ns"
tas_config.exe → Outputs: "✅ TAS schedule configured (8 gates)"
cbs_config.exe → Outputs: "✅ CBS parameters set (idleSlope=15000)"
Test Case 8: Performance Characteristics Documented
Steps:
- Check README for "Performance Characteristics" section
- Verify latency targets documented per IOCTL category
- Validate threading model explained
Expected Results:
- ✅ README includes performance section
- ✅ Read-only IOCTLs: <100µs latency documented
- ✅ Write IOCTLs (no hardware): <500µs documented
- ✅ Write IOCTLs (hardware commit): 1-10ms documented
- ✅ Threading model explained (thread-safe, fine-grained locking)
README Performance Section:
## Performance Characteristics
- Read-only IOCTLs: <100µs latency
- Write IOCTLs (no hardware): <500µs latency
- Write IOCTLs (hardware commit): 1-10ms latency (e.g., TAS schedule update)
## Threading Model
- All IOCTLs are thread-safe (driver uses fine-grained locking)
- Multiple processes can open device simultaneously
- No global locks held across IOCTL calls
Test Case 9: API Versioning Documented
Steps:
- Check for API version in header file or README
- Verify changelog documents breaking changes
- Validate deprecation policy documented
Expected Results:
- ✅ API version number present (e.g., "API v1.0")
- ✅ Changelog lists breaking changes per version
- ✅ Deprecation policy explained (e.g., "deprecated IOCTLs supported for 2 releases")
Test Case 10: Links to Source Code
Steps:
- Verify README includes links to header files
- Check for links to example implementations
- Validate GitHub links resolve correctly
Expected Results:
- ✅ README links to
avb_ioctl.h
- ✅ README links to
examples/ directory
- ✅ All links resolve (no 404 errors)
README Links:
## Source Code
- [IOCTL Definitions](avb_ioctl.h) - Header file with all IOCTL codes
- [Examples](examples/) - Working code samples
- [Driver Source](filter.c) - IOCTL handler implementation
Pass/Fail Criteria
Pass Criteria
- ✅ 100% of IOCTLs have Doxygen comments (Test Case 1)
- ✅ Doxygen generates HTML with zero warnings (Test Case 2)
- ✅ Quickstart works in <5 minutes (Test Case 3)
- ✅ All IOCTLs in README table (Test Case 4)
- ✅ All error codes documented with recovery actions (Test Case 5)
- ✅ Example code compiles without warnings (Test Case 6)
- ✅ Example code runs successfully (Test Case 7)
- ✅ Performance characteristics documented (Test Case 8)
- ✅ API versioning documented (Test Case 9)
- ✅ Links to source code valid (Test Case 10)
Fail Criteria
- ❌ Any IOCTL undocumented
- ❌ Doxygen warnings present
- ❌ Quickstart takes >5 minutes or fails
- ❌ IOCTLs missing from README table
- ❌ Error codes missing recovery actions
- ❌ Examples fail to compile or run
- ❌ Performance targets not documented
- ❌ Broken links in README
Test Data
Expected Documentation Sections:
- Doxygen comments:
@brief, @details, @param, @return, @note, @example
- README sections: Quick Start, IOCTL Reference, Error Handling, Performance, Threading Model, Examples
IOCTL Categories:
- PHC (Precision Hardware Clock): 5 IOCTLs
- TAS (Time-Aware Shaper): 4 IOCTLs
- CBS (Credit-Based Shaper): 3 IOCTLs
- Statistics: 2 IOCTLs
- Total: ~14 IOCTLs
Error Codes (minimum required):
STATUS_SUCCESS
STATUS_INVALID_PARAMETER
STATUS_DEVICE_NOT_READY
STATUS_TIMEOUT
STATUS_ACCESS_DENIED
STATUS_BUFFER_TOO_SMALL
Automation
Continuous Integration Check (GitHub Actions):
name: Documentation Quality
on: [push, pull_request]
jobs:
doxygen-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Doxygen
run: sudo apt-get install -y doxygen
- name: Generate Documentation
run: doxygen Doxyfile 2>&1 | tee doxygen.log
- name: Check for Warnings
run: |
if grep -q "warning" doxygen.log; then
echo "❌ Doxygen warnings found"
exit 1
fi
echo "✅ Documentation generated successfully"
- name: Upload HTML
uses: actions/upload-artifact@v3
with:
name: api-docs
path: docs/html/
Example Compilation Check (CI):
build-examples:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Build Examples
run: |
cd examples
./build-all.cmd
- name: Run Examples (dry-run)
run: |
# Examples require driver installed - skip execution in CI
echo "✅ Examples compiled successfully"
Dependencies
- Requires: All IOCTLs implemented and tested
- Blocks: User adoption (developers need docs to integrate)
Notes
- Doxygen: Use
WARN_IF_UNDOCUMENTED=YES to catch missing docs
- Examples: Should be copy-paste ready (no placeholders like
<insert code>)
- Error Codes: Prioritize common errors (80/20 rule)
- Versioning: Document breaking changes in CHANGELOG.md
- CI Integration: Fail builds if Doxygen warnings present
Related Issues
Version: 1.0
Created: 2025-12-19
Author: Standards Compliance Team
Test Objective
Verify that all IOCTL endpoints have comprehensive documentation including Doxygen-style comments (brief, details, parameters, return values, examples), README with quickstart guide, error handling reference, and working code examples in
examples/directory.Traceability
Test Type
Test Environment
Software:
Tools:
Prerequisites
avb_ioctl.hDoxyfilepresent)examples/)Test Procedure
Test Case 1: All IOCTLs Have Doxygen Comments
Steps:
avb_ioctl.hfor all#define IOCTL_*definitions@brief,@details,@param,@return,@exampleExpected Results:
Validation Script (PowerShell):
Test Case 2: Doxygen Generates HTML Without Warnings
Steps:
doxygen Doxyfiledoxygen.logdocs/html/Expected Results:
index.html) accessibleDoxygen Configuration (
Doxyfile):Validation:
Test Case 3: README Quickstart Works in <5 Minutes
Steps:
Expected Results:
Quickstart Code (
examples/README.md):Query PHC time:
Close handle:
Build:
Expected Output:
Test Case 4: All IOCTLs in Reference Table
Steps:
avb_ioctl.hexamples/README.mdExpected Results:
README Table Example:
Validation Script:
Test Case 5: Error Codes Have Recovery Actions
Steps:
STATUS_*codes from IOCTL implementationExpected Results:
Error Handling Table (
examples/README.md):Test Case 6: Example Code Compiles Without Warnings
Steps:
.cfiles inexamples/directory/W4or-Wall)Expected Results:
Build Script (
examples/build-all.cmd):Test Case 7: Example Code Runs Successfully
Steps:
Expected Results:
Examples:
phc_query.exe→ Outputs: "PHC: 1640995200123456789 ns"phc_adjust.exe→ Outputs: "✅ PHC offset adjusted by +1000 ns"tas_config.exe→ Outputs: "✅ TAS schedule configured (8 gates)"cbs_config.exe→ Outputs: "✅ CBS parameters set (idleSlope=15000)"Test Case 8: Performance Characteristics Documented
Steps:
Expected Results:
README Performance Section:
Test Case 9: API Versioning Documented
Steps:
Expected Results:
Test Case 10: Links to Source Code
Steps:
Expected Results:
avb_ioctl.hexamples/directoryREADME Links:
Pass/Fail Criteria
Pass Criteria
Fail Criteria
Test Data
Expected Documentation Sections:
@brief,@details,@param,@return,@note,@exampleIOCTL Categories:
Error Codes (minimum required):
STATUS_SUCCESSSTATUS_INVALID_PARAMETERSTATUS_DEVICE_NOT_READYSTATUS_TIMEOUTSTATUS_ACCESS_DENIEDSTATUS_BUFFER_TOO_SMALLAutomation
Continuous Integration Check (GitHub Actions):
Example Compilation Check (CI):
Dependencies
Notes
WARN_IF_UNDOCUMENTED=YESto catch missing docs<insert code>)Related Issues
Version: 1.0
Created: 2025-12-19
Author: Standards Compliance Team