Comprehensive testing procedures for the COBOL Harmonizer extension.
- Extension installs from VSIX without errors
- Extension appears in Extensions list
- Extension version shown correctly (0.1.0)
- Extension icon displays properly
- All three commands appear in Command Palette:
- "COBOL Harmonizer: Analyze Current File"
- "COBOL Harmonizer: Analyze Workspace"
- "COBOL Harmonizer: Clear Diagnostics"
- Settings appear in VS Code settings UI
-
pythonPathaccepts custom path -
harmonizerPathaccepts custom path -
harmonizerPathauto-detects when empty -
disharmonyThresholdaccepts values 0.0-1.5 -
analyzeOnSavetoggle works -
copybookPathsaccepts array of paths
File: test-harmonious.cbl
CALCULATE-TOTAL.
COMPUTE WS-TOTAL = WS-A + WS-B.Expected:
- Analysis completes successfully
- No diagnostics shown
- Message: "✓ No semantic disharmony detected!"
File: test-minor-drift.cbl
VALIDATE-CUSTOMER.
EXEC SQL
SELECT STATUS INTO :WS-STATUS
FROM CUSTOMERS
WHERE CUST-ID = :WS-CUST-ID
END-EXEC.Expected:
- Info diagnostic on
VALIDATE-CUSTOMER - Disharmony score: 0.5-0.8
- Hover shows LJPW coordinates
File: test-critical.cbl
DISPLAY-ACCOUNT.
EXEC SQL
DELETE FROM ACCOUNTS
WHERE ACCT-ID = :WS-ACCT-ID
END-EXEC.Expected:
- Error diagnostic on
DISPLAY-ACCOUNT - Disharmony score: ≥1.2
- Red underline
- Message: "Found 1 procedure(s) with semantic disharmony"
Steps:
- Open COBOL file with disharmony
- Save file (Ctrl+S)
- Verify analysis runs automatically
Expected:
- "Analyzing COBOL file..." notification appears
- Diagnostics update after save
- No manual command needed
Setup: Create workspace with 5 COBOL files
Steps:
- Run "COBOL Harmonizer: Analyze Workspace"
- Observe progress notification
Expected:
- Progress bar shows "X/5 files"
- All files analyzed
- Summary: "Analyzed 5 COBOL files"
- Diagnostics shown for all files
Steps:
- Analyze file with diagnostics
- Run "COBOL Harmonizer: Clear Diagnostics"
Expected:
- All underlines removed
- Problems panel cleared
- Message: "COBOL Harmonizer diagnostics cleared"
Steps:
- Right-click in COBOL file
- Find "COBOL Harmonizer: Analyze Current File"
Expected:
- Command appears in context menu
- Only appears for COBOL files (.cbl, .cob, .cobol)
- Not shown for other file types
Setup:
{
"cobolHarmonizer.copybookPaths": ["/path/to/copybooks"]
}File: Uses COPY CUSTOMER-RECORD.
Expected:
- Copybook resolved from configured path
- No copybook errors in output
- Analysis completes successfully
Setup: Set invalid Python path
{
"cobolHarmonizer.pythonPath": "/invalid/python"
}Expected:
- Error: "Analysis failed: ..."
- Graceful error message
- No crash
Setup: Set invalid harmonizer path
{
"cobolHarmonizer.harmonizerPath": "/invalid/path.py"
}Expected:
- Error: "Could not find cobol_harmonizer.py..."
- Suggestion to configure path
- No crash
File: Broken COBOL syntax
Expected:
- Analysis attempts but fails gracefully
- Error message shown
- No VS Code crash
Expected:
- Analysis completes in < 1 second
- UI remains responsive
Expected:
- Analysis completes in < 10 seconds
- Progress indication shown
- UI remains responsive
Expected:
- Progress bar updates smoothly
- Can cancel operation (if implemented)
- Memory usage stays reasonable (<500MB)
Create test/suite/extension.test.js:
const assert = require('assert');
const vscode = require('vscode');
suite('Extension Test Suite', () => {
test('Extension should activate', async () => {
const ext = vscode.extensions.getExtension('cobol-harmonizer.cobol-harmonizer');
assert.ok(ext);
await ext.activate();
assert.ok(ext.isActive);
});
test('Commands should be registered', async () => {
const commands = await vscode.commands.getCommands(true);
assert.ok(commands.includes('cobolHarmonizer.analyzeFile'));
assert.ok(commands.includes('cobolHarmonizer.analyzeWorkspace'));
assert.ok(commands.includes('cobolHarmonizer.clearDiagnostics'));
});
});Run: npm test
Before each release:
-
Run all manual tests above
-
Test on all platforms:
- Windows 10/11
- macOS (Intel)
- macOS (Apple Silicon)
- Linux (Ubuntu)
- z/OS USS (if available)
-
Test VS Code versions:
- Latest stable
- Previous major version
- Insiders build
-
Test Python versions:
- Python 3.9
- Python 3.10
- Python 3.11
- Python 3.12
Create test-files/ directory:
- harmonious.cbl - No disharmony (0.0-0.3)
- minor-drift.cbl - Info level (0.3-0.5)
- concerning.cbl - Info level (0.5-0.8)
- significant.cbl - Warning level (0.8-1.2)
- critical.cbl - Error level (≥1.2)
- with-copybook.cbl - Uses copybooks
- large-file.cbl - 2000+ LOC
- invalid-syntax.cbl - Broken COBOL
## Test Run: [Date]
**Environment:**
- OS: [Windows/macOS/Linux]
- VS Code: [version]
- Python: [version]
- Extension: [version]
**Results:**
- Phase 1: [Pass/Fail] - [Notes]
- Phase 2: [Pass/Fail] - [Notes]
- Phase 3: [Pass/Fail] - [Notes]
- Phase 4: [Pass/Fail] - [Notes]
- Phase 5: [Pass/Fail] - [Notes]
- Phase 6: [Pass/Fail] - [Notes]
- Phase 7: [Pass/Fail] - [Notes]
**Issues Found:**
1. [Issue description]
2. [Issue description]
**Overall:** [Pass/Fail]When issues are found:
**Environment:**
- OS: [Windows/macOS/Linux/z/OS]
- VS Code: [version]
- Python: [version]
- Extension: [version]
**Steps to Reproduce:**
1. [Step 1]
2. [Step 2]
3. [Step 3]
**Expected Behavior:**
[What should happen]
**Actual Behavior:**
[What actually happened]
**Logs:**[Paste relevant logs from Output → COBOL Harmonizer]
**Screenshots:**
[If applicable]
For CI/CD integration:
# .github/workflows/extension-test.yml
name: Extension Tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
vscode: [stable, insiders]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm install
- run: npm testExtension is ready for release when:
- All Phase 1-7 tests pass
- No critical bugs
- Performance meets targets (<10s for 2000 LOC)
- Documentation complete
- Works on Windows, macOS, Linux
- IBM z/OS USS testing completed (if available)
Testing Status: Ready for initial manual testing Last Updated: 2025-11-08 Next Review: After first user feedback