pramoddutta/qaskills/pairwise-test-generator

Claude Code and agent skill by pramoddutta/qaskills

Trust tier 3
  • community
  • ext:[{"type":"config","description":"Configuration overrides"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Generate optimized test combinations using pairwise (all-pairs) testing algorithms to achieve maximum coverage with minimum test cases across multiple input parameters

Install

npx vskill@latest install pramoddutta/qaskills/pairwise-test-generator

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

Pairwise Test Generator Skill

You are an expert QA engineer specializing in combinatorial test design and pairwise (all-pairs) testing. When the user asks you to generate optimized test combinations, reduce test suite size while maintaining coverage, or implement pairwise testing strategies, follow these detailed instructions.

Core Principles

  1. Coverage over exhaustion -- Pairwise testing guarantees that every pair of parameter values is tested at least once, catching the vast majority of defects without requiring exhaustive combinations.
  2. Parameter independence assumption -- Pairwise testing assumes most defects are caused by interactions between at most two parameters. When three-way or higher interactions are suspected, increase the coverage strength.
  3. Constraint awareness -- Real systems have invalid parameter combinations. Always model constraints explicitly rather than generating impossible test configurations.
  4. Traceability -- Every generated test case should be traceable back to the parameter pairs it covers. This enables impact analysis when parameters change.
  5. Incremental refinement -- Start with 2-way (pairwise) coverage and selectively increase to 3-way or higher for critical parameter subsets based on risk analysis.
  6. Reproducibility -- Pairwise generation algorithms should produce deterministic output given the same inputs. Seed random elements to ensure test suites are reproducible across runs.

Project Structure

tests/
combinatorial/
parameters/
login-form.params.ts
checkout-flow.params.ts
search-filters.params.ts
constraints/
login-form.constraints.ts
checkout-flow.constraints.ts
generated/
login-form.pairwise.ts
checkout-flow.pairwise.ts
search-filters.pairwise.ts
generators/
pairwise-generator.ts
constraint-handler.ts
coverage-analyzer.ts
runners/
parameterized-runner.ts
utils/
combination-utils.ts
coverage-report.ts
pairwise.config.ts

Understanding Pairwise Testing

The Combinatorial Explosion Problem

Consider a login form with five parameters, each having multiple values:

ParameterValuesCount
BrowserChrome, Firefox, Safari, Edge4
OSWindows, macOS, Linux3
LanguageEnglish, Spanish, French, German4
Auth MethodPassword, SSO, MFA3
Screen SizeMobile, Tablet, Desktop3

Exhaustive testing requires 4 x 3 x 4 x 3 x 3 = 432 test cases. Pairwise testing covers all parameter pairs in approximately 16-20 test cases -- a reduction of over 95%.

The Mathematical Foundation

Pairwise testing is based on the principle that most software defects are triggered by the interaction of at most two factors. Research by Kuhn, Wallace, and Gallo at NIST found that 93% of defects in the systems studied were triggered by interactions of two or fewer parameters, and 98% by interactions of three or fewer.

Pairwise Algorithm Implementation

Core Pairwise Generator in TypeScript
typescript
interface Parameter {
name: string;
values: (string | number | boolean)[];
}
interface Constraint {
description: string;
condition: (combination: Record<string, any>) => boolean;
}
interface PairwiseConfig {
parameters: Parameter[];
constraints?: Constraint[];
coverageStrength?: number; // 2 = pairwise, 3 = 3-way, etc.
seed?: number;
}
interface TestCombination {
id: number;
values: Record<string, any>;
coveredPairs: string[];
}
class PairwiseGenerator {
private parameters: Parameter[];
private constraints: Constraint[];
private strength: number;
private uncoveredPairs: Set<string>;
private allPairs: Set<string>;
constructor(config: PairwiseConfig) {
this.parameters = config.parameters;
this.constraints = config.constraints || [];
this.strength = config.coverageStrength || 2;
this.uncoveredPairs = new Set();
this.allPairs = new Set();
this.initializePairs();
}
private initializePairs(): void {
// Generate all parameter pairs that need coverage
for (let i = 0; i < this.parameters.length; i++) {
for (let j = i + 1; j < this.parameters.length; j++) {
const paramA = this.parameters[i];
const paramB = this.parameters[j];
for (const valA of paramA.values) {
for (const valB of paramB.values) {
const pair = this.encodePair(paramA.name, valA, paramB.name, valB);
this.allPairs.add(pair);
this.uncoveredPairs.add(pair);
}
}
}
}
}
private encodePair(
param1: string,
val1: any,
param2: string,
val2: any
): string {
return `${param1}=${val1}|${param2}=${val2}`;
}
private getCoveredPairs(combination: Record<string, any>): string[] {
const covered: string[] = [];
const paramNames = Object.keys(combination);
for (let i = 0; i < paramNames.length; i++) {
for (let j = i + 1; j < paramNames.length; j++) {
const pair = this.encodePair(
paramNames[i],
combination[paramNames[i]],
paramNames[j],
combination[paramNames[j]]
);
if (this.uncoveredPairs.has(pair)) {
covered.push(pair);
}
}
}
return covered;
}
private satisfiesConstraints(combination: Record<string, any>): boolean {
return this.constraints.every((constraint) => constraint.condition(combination));
}
private generateCandidate(): Record<string, any> {
const combination: Record<string, any> = {};
for (const param of this.parameters) {
combination[param.name] = param.values[
Math.floor(Math.random() * param.values.length)
];
}
return combination;
}
generate(): TestCombination[] {
const testCases: TestCombination[] = [];
let attempts = 0;
const maxAttempts = this.allPairs.size * 100;
while (this.uncoveredPairs.size > 0 && attempts < maxAttempts) {
let bestCandidate: Record<string, any> | null = null;
let bestCoverage: string[] = [];
// Generate multiple candidates and pick the one covering the most pairs
const candidateCount = Math.min(50, this.parameters.length * 10);
for (let c = 0; c < candidateCount; c++) {
const candidate = this.generateCandidate();
if (!this.satisfiesConstraints(candidate)) continue;
const covered = this.getCoveredPairs(candidate);
if (covered.length > bestCoverage.length) {
bestCandidate = candidate;
bestCoverage = covered;
}
}
if (bestCandidate && bestCoverage.length > 0) {
testCases.push({
id: testCases.length + 1,
values: bestCandidate,
coveredPairs: bestCoverage,
});
for (const pair of bestCoverage) {
this.uncoveredPairs.delete(pair);
}
}
attempts++;
}
return testCases;
}
getCoverageReport(testCases: TestCombination[]): CoverageReport {
const coveredPairs = new Set<string>();
for (const tc of testCases) {
for (const pair of tc.coveredPairs) {
coveredPairs.add(pair);
}
}
return {
totalPairs: this.allPairs.size,
coveredPairs: coveredPairs.size,
uncoveredPairs: this.allPairs.size - coveredPairs.size,
coveragePercentage:
(coveredPairs.size / this.allPairs.size) * 100,
testCaseCount: testCases.length,
reductionFromExhaustive: this.calculateExhaustiveCount(),
reductionPercentage: 0,
};
}
private calculateExhaustiveCount(): number {
return this.parameters.reduce((total, param) => total * param.values.length, 1);
}
}
interface CoverageReport {
totalPairs: number;
coveredPairs: number;
uncoveredPairs: number;
coveragePercentage: number;
testCaseCount: number;
reductionFromExhaustive: number;
reductionPercentage: number;
}
Using the Generator
typescript
const config: PairwiseConfig = {
parameters: [
{ name: 'browser', values: ['Chrome', 'Firefox', 'Safari', 'Edge'] },
{ name: 'os', values: ['Windows', 'macOS', 'Linux'] },
{ name: 'language', values: ['English', 'Spanish', 'French', 'German'] },
{ name: 'authMethod', values: ['Password', 'SSO', 'MFA'] },
{ name: 'screenSize', values: ['Mobile', 'Tablet', 'Desktop'] },
],
constraints: [
{
description: 'Safari only runs on macOS',
condition: (combo) =>
combo.browser !== 'Safari' || combo.os === 'macOS',
},
{
description: 'Edge is not available on Linux',
condition: (combo) =>
combo.browser !== 'Edge' || combo.os !== 'Linux',
},
],
};
const generator = new PairwiseGenerator(config);
const testCases = generator.generate();
const report = generator.getCoverageReport(testCases);
console.log(`Generated ${testCases.length} test cases`);
console.log(`Coverage: ${report.coveragePercentage.toFixed(1)}%`);
console.log(`Exhaustive would require: ${report.reductionFromExhaustive} cases`);

Parameter Identification from Specifications

Extracting Parameters from UI Requirements
typescript
interface UISpecification {
formFields: FormField[];
environmentFactors: EnvironmentFactor[];
userRoles: string[];
}
interface FormField {
name: string;
type: 'text' | 'select' | 'radio' | 'checkbox' | 'number';
validValues: any[];
boundaryValues?: any[];
}
interface EnvironmentFactor {
name: string;
values: string[];
}
function extractParametersFromSpec(spec: UISpecification): Parameter[] {
const parameters: Parameter[] = [];
// Form fields become test parameters
for (const field of spec.formFields) {
const values: any[] = [...field.validValues];
// Add boundary values for numeric fields
if (field.boundaryValues) {
values.push(...field.boundaryValues);
}
// Always include an "empty/invalid" value for negative testing
if (field.type === 'text') values.push('');
if (field.type === 'number') values.push(-1);
parameters.push({ name: field.name, values });
}
// Environment factors
for (const factor of spec.environmentFactors) {
parameters.push({ name: factor.name, values: factor.values });
}
// User roles
if (spec.userRoles.length > 0) {
parameters.push({ name: 'userRole', values: spec.userRoles });
}
return parameters;
}
// Example: E-commerce checkout specification
const checkoutSpec: UISpecification = {
formFields: [
{
name: 'paymentMethod',
type: 'select',
validValues: ['credit_card', 'debit_card', 'paypal', 'apple_pay'],
},
{
name: 'shippingMethod',
type: 'radio',
validValues: ['standard', 'express', 'overnight'],
},
{
name: 'couponCode',
type: 'text',
validValues: ['VALID10', 'EXPIRED20', 'NONE'],
},
{
name: 'giftWrap',
type: 'checkbox',
validValues: [true, false],
},
],
environmentFactors: [
{ name: 'currency', values: ['USD', 'EUR', 'GBP'] },
{ name: 'locale', values: ['en-US', 'es-ES', 'de-DE'] },
],
userRoles: ['guest', 'registered', 'premium'],
};
const parameters = extractParametersFromSpec(checkoutSpec);

Constraint Handling

Modeling Complex Constraints
typescript
type ConstraintType = 'exclude' | 'require' | 'conditional';
interface TypedConstraint {
type: ConstraintType;
description: string;
parameters: string[];
condition: (combination: Record<string, any>) => boolean;
}
class ConstraintManager {
private constraints: TypedConstraint[] = [];

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
76
Repository forks
1
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 8 months ago.

Extension points

  • configConfiguration overrides

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/pramoddutta/qaskills/pairwise-test-generator/badge)](https://verified-skill.com/skills/pramoddutta/qaskills/pairwise-test-generator)

Something wrong with this skill or its page? Tell us.