Quickstart

Attention

This documentation is deprecated and should no longer be used.

Please, check the new documentation at https://altwalker.github.io/altwalker/, which is being actively maintained.

Also note that all projects related to AltWalker were moved from GitLab to GitHub, you can find the new projects at https://github.com/altwalker.

Eager to get started? This page gives a good introduction to AltWalker. It assumes you already have AltWalker installed. If you do not, head over to the Installation section.

In this section you will learn how to create a tests project from scratch or from existing models, how to validate your models, how to validate your code and how to run your tests with AltWalker.

Start from scratch

You can use the init command to generate a new project.

The init command creates a project directory and initialize a git repository. The project contains a sample model (models/default.json) that will help you get started, and a test package containing the template code for the model (tests/).

$ altwalker init -l python test-project

Using the -l python option will generate a python package containing the template code for the model (tests/).

test-project/
├── models/
│   ├── default.json
└── tests/
    ├── __init__.py
    └── test.py

Note

If you don’t want the init command to initialize a git repository use --no-git option.

To run the tests for the default.json model, run the following command:

$ cd test-project
$ altwalker online tests -m models/default.json "random(edge_coverage(100))"

The above command runs the tests found within the tests folder, based on the model defined in default.json and using the random(edge_coverage(100)) stop condition.

Start from existing models

You can use the init command to generate a new project form existing models.

The init command creates a project directory with your model(s), generates the code template for the model(s) and initialize a git repository.

To generate a project you should replace the path/to/model-name.json and run the following command:

$ altwalker init -l python test-project -m path/to/model-name.json

Note

You can call the init command with multiple models.

To run the tests for the your model, replace model-name.json with the name of you model file and run the following command:

$ cd test-project
$ altwalker online tests -m models/model-name.json "random(edge_coverage(100))"

The above command runs the tests found within the tests folder, based on the model defined in default.json and using the random(edge_coverage(100)) stop condition.

Check your models

You can use the check command to check your models for issues.

$ altwalker check -m models/model-name.json "random(never)"

Verify your code

You can use the verify command to check your code against the models for issues.

$ altwalker verify tests -l python -m models/model-name.json