pwtg
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

PWTG - PairWise Test Generator

This simple library is a wrapper for Microsoft's PICT tool.

Unlike some other packages this library does not include PICT binaries. User is expected to provide requested binary him/her self. This is primarily for security reasons. It is not a good practise to download npm packages with binaries inside.

Preconditions

Installation

  • run npm install pwtg

Usage

Generate tests into json file

import PictGenerator from "pwtg";

const generator = new Generator(
  "path/to/input-model-file.txt",
  "path/to/pict-binary",
);

await generator.generate("json", true, "path/to/output-json-file.json");

Generate tests into txt file

import PictGenerator from "pwtg";

const generator = new Generator(
  "path/to/input-model-file.txt",
  "path/to/pict-binary",
);

await generator.generate("text", true, "path/to/output-text-file.txt");

Just generate output string but do not save

import PictGenerator from "pwtg";

const generator = new Generator(
  "path/to/input-model-file.txt",
  "path/to/pict-binary",
);

await generator.generate("text", false);

console.log(generator.generated);

Generate output using seed file

What is seeding and when to use it - see HERE

import PictGenerator from "pwtg";

const generator = new Generator(
  "path/to/input-model-file.txt",
  "path/to/pict/binary",
);

await generator.generate(
  "text",
  true,
  "file/path/to/output-text-file.txt",
  "path/to/seed-text-file.txt",
);

Generate output using different combinatorial order

For pair-wise approach, the (default) value of combinatorial order is set to 2.

However, you can set different order, as specified HERE.

Simply put, the higher combinatorial order you set, the higher coverage of possible combinations you get.

Beware: if you set combinatorial order HIGHER then the highest number of parameters, you will get an error

import PictGenerator from "pwtg";

const generator = new Generator(
  "path/to/input-model-file.txt",
  "path/to/pict/binary",
);

await generator.generate(
  "text",
  true,
  "path/to/output-text-file.txt",
  undefined,
  3,
);

Package Sidebar

Install

npm i pwtg

Weekly Downloads

5

Version

0.2.0

License

MIT

Unpacked Size

15.1 kB

Total Files

15

Last publish

Collaborators

  • bednarik_radek