|
4 | 4 | [](https://codecov.io/gh/libraz/coverwise) |
5 | 5 | [](https://github.com/libraz/coverwise/blob/main/LICENSE) |
6 | 6 | [](https://en.cppreference.com/w/cpp/17) |
| 7 | +[](https://www.typescriptlang.org/) |
7 | 8 | [](https://github.com/libraz/coverwise) |
8 | 9 |
|
9 | 10 | Combinatorial test coverage engine. Analyzes existing tests for coverage gaps, generates minimal test suites, and extends tests incrementally — in browsers, Node.js, and native C++. |
@@ -85,6 +86,34 @@ const result = cw.generate({ |
85 | 86 | }); |
86 | 87 | ``` |
87 | 88 |
|
| 89 | +## Pure TypeScript (no WASM) |
| 90 | + |
| 91 | +A pure TypeScript build is available for environments where WASM is not supported or not needed. Same API, no async initialization required. |
| 92 | + |
| 93 | +```typescript |
| 94 | +import { Coverwise } from '@libraz/coverwise/pure'; |
| 95 | + |
| 96 | +const cw = await Coverwise.create(); // returns immediately, no WASM loading |
| 97 | + |
| 98 | +const result = cw.generate({ |
| 99 | + parameters: [ |
| 100 | + { name: 'os', values: ['Windows', 'macOS', 'Linux'] }, |
| 101 | + { name: 'browser', values: ['Chrome', 'Firefox', 'Safari'] }, |
| 102 | + ], |
| 103 | +}); |
| 104 | + |
| 105 | +const report = cw.analyzeCoverage(parameters, existingTests); |
| 106 | +const extended = cw.extendTests(existingTests, { parameters }); |
| 107 | +``` |
| 108 | + |
| 109 | +| | WASM (default) | Pure TS | |
| 110 | +|---|---|---| |
| 111 | +| Import | `@libraz/coverwise` | `@libraz/coverwise/pure` | |
| 112 | +| Initialization | `await Coverwise.create()` | `await Coverwise.create()` | |
| 113 | +| Performance | Faster (native code) | Slightly slower | |
| 114 | +| Dependencies | Requires WASM support | None | |
| 115 | +| API | Identical | Identical | |
| 116 | + |
88 | 117 | ## CLI |
89 | 118 |
|
90 | 119 | ```bash |
@@ -124,29 +153,39 @@ All configurations achieve 100% t-wise coverage, verified by an independent cove |
124 | 153 |
|
125 | 154 | ### Pairwise (2-wise) |
126 | 155 |
|
127 | | -| Configuration | Params | Values | Tuples | Tests | Theoretical Min | Time | |
128 | | -|---------------|--------|--------|--------|-------|-----------------|------| |
129 | | -| 5 × 3 uniform | 5 | 3 | 90 | 16 | 9 (OA) | < 1 ms | |
130 | | -| 10 × 3 uniform | 10 | 3 | 405 | 20 | 9 (OA) | < 1 ms | |
131 | | -| 13 × 3 uniform | 13 | 3 | 702 | 21 | 9 (OA) | < 1 ms | |
132 | | -| 10 × 5 uniform | 10 | 5 | 1,125 | 52 | 25 | 1 ms | |
133 | | -| 15 × 4 uniform | 15 | 4 | 1,680 | 40 | 16 | 1 ms | |
134 | | -| 20 × 2 uniform | 20 | 2 | 760 | 12 | 4 | < 1 ms | |
135 | | -| 20 × 5 uniform | 20 | 5 | 4,750 | 66 | 25 | 4 ms | |
136 | | -| 30 × 5 uniform | 30 | 5 | 10,875 | 76 | 25 | 9 ms | |
137 | | -| 50 × 3 uniform | 50 | 3 | 11,025 | 33 | 9 (OA) | 6 ms | |
138 | | -| 5 × 20 high-card | 5 | 20 | 4,000 | 514 | 400 | 9 ms | |
139 | | -| 3⁴ × 2³ mixed | 7 | 2–3 | 138 | 14 | 9 | < 1 ms | |
140 | | -| 5¹ × 3³ × 2⁴ mixed | 8 | 2–5 | 208 | 19 | 15 | < 1 ms | |
| 156 | +| Configuration | Tuples | Tests | Theoretical Min | WASM | Pure TS | |
| 157 | +|---------------|--------|-------|-----------------|------|---------| |
| 158 | +| 5 × 3 uniform | 90 | 16 | 9 (OA) | < 1 ms | 1 ms | |
| 159 | +| 10 × 3 uniform | 405 | 20 | 9 (OA) | < 1 ms | 1 ms | |
| 160 | +| 13 × 3 uniform | 702 | 21 | 9 (OA) | < 1 ms | 1 ms | |
| 161 | +| 10 × 5 uniform | 1,125 | 52 | 25 | 1 ms | 1 ms | |
| 162 | +| 15 × 4 uniform | 1,680 | 40 | 16 | 1 ms | 1 ms | |
| 163 | +| 20 × 2 uniform | 760 | 12 | 4 | < 1 ms | < 1 ms | |
| 164 | +| 20 × 5 uniform | 4,750 | 66 | 25 | 4 ms | 2 ms | |
| 165 | +| 30 × 5 uniform | 10,875 | 76 | 25 | 9 ms | 5 ms | |
| 166 | +| 50 × 3 uniform | 11,025 | 33 | 9 (OA) | 6 ms | 4 ms | |
| 167 | +| 5 × 20 high-card | 4,000 | 514 | 400 | 9 ms | 4 ms | |
141 | 168 |
|
142 | 169 | ### Higher strength |
143 | 170 |
|
144 | | -| Configuration | Params | Values | Strength | Tuples | Tests | Time | |
145 | | -|---------------|--------|--------|----------|--------|-------|------| |
146 | | -| 15 × 3 | 15 | 3 | 3-wise | 12,285 | 100 | 11 ms | |
147 | | -| 8 × 3 | 8 | 3 | 4-wise | 5,670 | 236 | 8 ms | |
| 171 | +| Configuration | Strength | Tuples | Tests | WASM | Pure TS | |
| 172 | +|---------------|----------|--------|-------|------|---------| |
| 173 | +| 15 × 3 | 3-wise | 12,285 | 100 | 11 ms | 9 ms | |
| 174 | +| 8 × 3 | 4-wise | 5,670 | 236 | 8 ms | 4 ms | |
| 175 | + |
| 176 | +### High strength (stress test) |
| 177 | + |
| 178 | +| Configuration | Strength | Tuples | Tests | WASM | Pure TS | |
| 179 | +|---------------|----------|--------|-------|------|---------| |
| 180 | +| 10 × 3 | 5-wise | 61,236 | 885 | 16 ms | 49 ms | |
| 181 | +| 8 × 4 | 5-wise | 57,344 | 2,749 | 18 ms | 52 ms | |
| 182 | +| 12 × 3 | 6-wise | 673,596 | 3,334 | 218 ms | 789 ms | |
| 183 | +| 15 × 3 | 5-wise | 729,729 | 1,277 | 220 ms | 761 ms | |
| 184 | +| 20 × 3 | 5-wise | 3,767,472 | 1,581 | 1.4 s | 4.2 s | |
| 185 | + |
| 186 | +Measured on Apple M-series (seed=42). Theoretical Min is from orthogonal array (OA) theory or v² bounds. Greedy algorithms typically produce 1.5–2.5× the theoretical minimum. WASM and Pure TS use different RNG implementations, so test counts may differ slightly. |
148 | 187 |
|
149 | | -Measured on Apple M-series (seed=42). Theoretical Min is from orthogonal array (OA) theory or v² bounds. Greedy algorithms typically produce 1.5–2.5× the theoretical minimum. |
| 188 | +For pairwise testing (the most common use case), WASM and Pure TS perform equally. WASM shows a ~3× advantage only in high-strength configurations with > 60,000 tuples. |
150 | 189 |
|
151 | 190 | ## Build |
152 | 191 |
|
|
0 commit comments