altwalker


Namealtwalker JSON
Version 0.4.0 PyPI version JSON
download
home_page
SummaryAltWalker is an open source Model-Based Testing framework that supports running tests written in python3 and .NET/C#. You design your tests as a directed graph and AltWalker generates test cases from your graph (using GraphWalker) and executes them.
upload_time2023-09-20 22:16:35
maintainer
docs_urlNone
author
requires_python>=3.8
licenseGNU GPLv3
keywords model-based-testing testing tests testing-framework
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # AltWalker

AltWalker is an open source, Model-Based Testing framework.

Read the documentation on https://altwalker.github.io/altwalker.

Join our [Gitter chat room](https://gitter.im/altwalker/community) or our [Google Group](https://groups.google.com/g/altwalker) to chat with us or with other members of the community.

## Table of Contents

* [Overview](#overview)
* [Installation](#installation)
* [Quickstart](#quickstart)
* [Setting Up a Development Environment](#setting-up-a-development-environment)
* [Support](#support)
* [License](#license)

## Overview

*AltWalker* is an open source Model-Based Testing framework that supports running
tests written in python3 and .NET/C#. You design your tests as a directed graph
and AltWalker generates test cases from your graph (using [GraphWalker](http://graphwalker.github.io/)) and executes them.

### Model-Based Testing

[Model-Based Testing](https://en.wikipedia.org/wiki/Model-based_testing) is a testing
technique which offers a way of generating test cases based on models that describe the behavior
(functionality) of the system under test.

The goal when designing models is to represent the part of the system under test, usually
by one model for each functionality of your system.

With the help of graph theory we can dynamically generate multiple test scripts. A test script is a path passing through the model from a starting point till
a condition is met.

Why use Model-Based Testing:

* the abstraction layer added by the model gives your tests a better structure
* the model can be updated to reflect the requirements changes making the tests easy to maintain
* dynamically generates multiple test scripts based on different conditions (like coverage or length)
* allows for a large number of tests to be created which results in a larger part of the system under test to be covered.

### AltWalker

AltWalker is a test execution tool, which  aims to make it easy to write and run your model-based tests. AltWalker uses GraphWalker to generate a path through the models.

For the test structure it uses an Object-Oriented approach inspired by python's `unittest` module. Every model is mapped to a class with the same name and each vertex and edge from the model is mapped to a method inside the class.

AltWalker also borrows the concept of test fixture from unit tests, and implements the following fixtures:
`setUpRun`, `tearDownRun`, `setUpModel` and `tearDownModel`.

Now it supports running tests written in .NET/C# and Python3.

### AltWalker Components

AltWalker has the following components:

* __Model__: a directed graph, supplied by the user as a json or graphml file.
    A graph is composed from a list of vertices and a list of edges.

* __Generator__ and __Stop Condition__: used to specify how to generate a
    path and to decide when a path is complete.

* __Test Code__: the implementation of the model(s) as code. Each model is mapped to a
    class and each vertex and edge is mapped to a method.

* __Planner__: uses the _model(s)_ and a pair of _generator_ and _stop condition_
    to provide a path (a sequence of steps) through the model(s).

    Currently AltWalker provides two planners:

    * Online Planner
    * Offline Planner

* __Reporter__: reports the output of the tests, the reporter is called on
    each event (e.g. `step_start`, `step_end`, ...).

* __Executor__: for each step in the plan it looks up and calls the named method
    from the _test code_. In addition to the step methods, it also calls
    fixture methods if present (e.g. `setUpModel`, `tearDownModel` ...).

    Currently AltWalker provides three executors:

    * Python Executor
    * .NET Executor

    And an __Http Executor__ that allows you to hook up your own executor via HTTP. You can read
    more about the Http Executor on the [How to: Write your own executor](https://altwalker.github.io/altwalker/advanced-usage/custom-executor.html)
    page.

* __Walker__: the test runner. Coordinates the execution of a test asking the `Planner`
    for the next step, executing the step using the `Executor` and reporting the progress
    using the `Reporter`.


There are two ways to run your tests:

* __Online Mode__ (using the Online Planner): Generate one step and then execute
    the step, until the path is complete.

* __Offline Mode__ (using the Offline Planner): Run a path from a sequence of steps.
    Usually the path is generated using the `offline` command.

## Installation

Prerequisites:

* [Python3](https://www.python.org/) (with pip3)
* [Java 8](https://openjdk.java.net/)
* [GraphWalker CLI](http://graphwalker.github.io/) (Optional)
* [.NET Core](Optional) (Optional)
* [git](https://git-scm.com/) (Optional)

### Install AltWalker

To install ``altwalker`` run the following command in your command line:

```
$ pip install altwalker
```

To check that you have installed the correct version of AltWalker, run the
following command:

```
$ altwalker --version
```

#### Living on the edge

If you want to work with the latest code before it’s released, install or update the code from the `develop` branch:

```
$ pip install -U git+https://github.com/altwalker/altwalker
```

For a more detailed tutorial read the [Installation](https://altwalker.github.io/altwalker/installation.html) section from the documentation.

## Quickstart

Make a sample project and run the tests.

```
$ altwalker init test-project -l python
$ cd test-project
$ altwalker online tests -m models/default.json "random(vertex_coverage(100))"
Running:
[2019-08-06 16:28:44.030077] ModelName.vertex_A Running
[2019-08-06 16:28:44.030940] ModelName.vertex_A Status: PASSED

[2019-08-06 16:28:44.048492] ModelName.edge_A Running
[2019-08-06 16:28:44.048729] ModelName.edge_A Status: PASSED

[2019-08-06 16:28:44.064495] ModelName.vertex_B Running
[2019-08-06 16:28:44.064746] ModelName.vertex_B Status: PASSED

Statistics:

  Model Coverage..................100%
  Number of Models...................1
  Completed Models...................1
  Failed Models......................0
  Incomplete Models..................0
  Not Executed Models................0

  Edge Coverage...................100%
  Number of Edges....................1
  Visited Edges......................1
  Unvisited Edges....................0

  Vertex Coverage.................100%
  Number of Vertices.................2
  Visited Vertices...................2
  Unvisited Vertices.................0

Status:  PASS
```

## Setting Up a Development Environment

Clone the repository:

```
$ git clone https://github.com/altwalker/altwalker.git
$ cd altwalker
```

Install python dependencies:

```
$ pip install -r requirements.txt && \
  pip install -r requirements-dev.txt
```

### Running Tests

```
$ pytest tests -s -v
```

#### Running tests with tox inside Docker

```
$ docker run  -it --rm -v "$(pwd):/altwalker" -w "/altwalker" altwalker/tests:tox tox
```

### CLI

After you install the python dependencies to setup AltWalker CLI locally from code run:

```
$ pip install --editable .
```

Then from any command line you can access:

```
$ altwalker --help
```

### Documentation

After you install the python dependencies to generate the documentation run:

```
$ cd docs && \
  make clean && \
  make html
```

To see the documentation run:

```
$ open build/html/index.html
```

To rebuild the documentation on changes, with live-reload in the browser run:

```
$ sphinx-autobuild docs/source docs/build/html
```

Navigate to the documentation at http://127.0.0.1:8000.


__Further Reading/Useful Links__:

* [Google Style Docstring Example](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html#example-google)
* [Google Style Guide](https://google.github.io/styleguide/pyguide.html)

## Support

Join our [Gitter chat room](https://gitter.im/altwalker/community) or our [Google Group](https://groups.google.com/g/altwalker) to chat with us or with other members of the community.

## License

This project is licensed under the [GNU General Public License v3.0](https://github.com/altwalker/altwalker/blob/main/LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "altwalker",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "model-based-testing,testing,tests,testing-framework",
    "author": "",
    "author_email": "Altom Consulting <altwalker@altom.com>, Dezmerean Robert <dezmereanrobert@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/e8/0a/dad850760597d45b778d0db6bce09ff2b7bd578cc6ba7d9be4de14888da9/altwalker-0.4.0.tar.gz",
    "platform": null,
    "description": "# AltWalker\n\nAltWalker is an open source, Model-Based Testing framework.\n\nRead the documentation on https://altwalker.github.io/altwalker.\n\nJoin our [Gitter chat room](https://gitter.im/altwalker/community) or our [Google Group](https://groups.google.com/g/altwalker) to chat with us or with other members of the community.\n\n## Table of Contents\n\n* [Overview](#overview)\n* [Installation](#installation)\n* [Quickstart](#quickstart)\n* [Setting Up a Development Environment](#setting-up-a-development-environment)\n* [Support](#support)\n* [License](#license)\n\n## Overview\n\n*AltWalker* is an open source Model-Based Testing framework that supports running\ntests written in python3 and .NET/C#. You design your tests as a directed graph\nand AltWalker generates test cases from your graph (using [GraphWalker](http://graphwalker.github.io/)) and executes them.\n\n### Model-Based Testing\n\n[Model-Based Testing](https://en.wikipedia.org/wiki/Model-based_testing) is a testing\ntechnique which offers a way of generating test cases based on models that describe the behavior\n(functionality) of the system under test.\n\nThe goal when designing models is to represent the part of the system under test, usually\nby one model for each functionality of your system.\n\nWith the help of graph theory we can dynamically generate multiple test scripts. A test script is a path passing through the model from a starting point till\na condition is met.\n\nWhy use Model-Based Testing:\n\n* the abstraction layer added by the model gives your tests a better structure\n* the model can be updated to reflect the requirements changes making the tests easy to maintain\n* dynamically generates multiple test scripts based on different conditions (like coverage or length)\n* allows for a large number of tests to be created which results in a larger part of the system under test to be covered.\n\n### AltWalker\n\nAltWalker is a test execution tool, which  aims to make it easy to write and run your model-based tests. AltWalker uses GraphWalker to generate a path through the models.\n\nFor the test structure it uses an Object-Oriented approach inspired by python's `unittest` module. Every model is mapped to a class with the same name and each vertex and edge from the model is mapped to a method inside the class.\n\nAltWalker also borrows the concept of test fixture from unit tests, and implements the following fixtures:\n`setUpRun`, `tearDownRun`, `setUpModel` and `tearDownModel`.\n\nNow it supports running tests written in .NET/C# and Python3.\n\n### AltWalker Components\n\nAltWalker has the following components:\n\n* __Model__: a directed graph, supplied by the user as a json or graphml file.\n    A graph is composed from a list of vertices and a list of edges.\n\n* __Generator__ and __Stop Condition__: used to specify how to generate a\n    path and to decide when a path is complete.\n\n* __Test Code__: the implementation of the model(s) as code. Each model is mapped to a\n    class and each vertex and edge is mapped to a method.\n\n* __Planner__: uses the _model(s)_ and a pair of _generator_ and _stop condition_\n    to provide a path (a sequence of steps) through the model(s).\n\n    Currently AltWalker provides two planners:\n\n    * Online Planner\n    * Offline Planner\n\n* __Reporter__: reports the output of the tests, the reporter is called on\n    each event (e.g. `step_start`, `step_end`, ...).\n\n* __Executor__: for each step in the plan it looks up and calls the named method\n    from the _test code_. In addition to the step methods, it also calls\n    fixture methods if present (e.g. `setUpModel`, `tearDownModel` ...).\n\n    Currently AltWalker provides three executors:\n\n    * Python Executor\n    * .NET Executor\n\n    And an __Http Executor__ that allows you to hook up your own executor via HTTP. You can read\n    more about the Http Executor on the [How to: Write your own executor](https://altwalker.github.io/altwalker/advanced-usage/custom-executor.html)\n    page.\n\n* __Walker__: the test runner. Coordinates the execution of a test asking the `Planner`\n    for the next step, executing the step using the `Executor` and reporting the progress\n    using the `Reporter`.\n\n\nThere are two ways to run your tests:\n\n* __Online Mode__ (using the Online Planner): Generate one step and then execute\n    the step, until the path is complete.\n\n* __Offline Mode__ (using the Offline Planner): Run a path from a sequence of steps.\n    Usually the path is generated using the `offline` command.\n\n## Installation\n\nPrerequisites:\n\n* [Python3](https://www.python.org/) (with pip3)\n* [Java 8](https://openjdk.java.net/)\n* [GraphWalker CLI](http://graphwalker.github.io/) (Optional)\n* [.NET Core](Optional) (Optional)\n* [git](https://git-scm.com/) (Optional)\n\n### Install AltWalker\n\nTo install ``altwalker`` run the following command in your command line:\n\n```\n$ pip install altwalker\n```\n\nTo check that you have installed the correct version of AltWalker, run the\nfollowing command:\n\n```\n$ altwalker --version\n```\n\n#### Living on the edge\n\nIf you want to work with the latest code before it\u2019s released, install or update the code from the `develop` branch:\n\n```\n$ pip install -U git+https://github.com/altwalker/altwalker\n```\n\nFor a more detailed tutorial read the [Installation](https://altwalker.github.io/altwalker/installation.html) section from the documentation.\n\n## Quickstart\n\nMake a sample project and run the tests.\n\n```\n$ altwalker init test-project -l python\n$ cd test-project\n$ altwalker online tests -m models/default.json \"random(vertex_coverage(100))\"\nRunning:\n[2019-08-06 16:28:44.030077] ModelName.vertex_A Running\n[2019-08-06 16:28:44.030940] ModelName.vertex_A Status: PASSED\n\n[2019-08-06 16:28:44.048492] ModelName.edge_A Running\n[2019-08-06 16:28:44.048729] ModelName.edge_A Status: PASSED\n\n[2019-08-06 16:28:44.064495] ModelName.vertex_B Running\n[2019-08-06 16:28:44.064746] ModelName.vertex_B Status: PASSED\n\nStatistics:\n\n  Model Coverage..................100%\n  Number of Models...................1\n  Completed Models...................1\n  Failed Models......................0\n  Incomplete Models..................0\n  Not Executed Models................0\n\n  Edge Coverage...................100%\n  Number of Edges....................1\n  Visited Edges......................1\n  Unvisited Edges....................0\n\n  Vertex Coverage.................100%\n  Number of Vertices.................2\n  Visited Vertices...................2\n  Unvisited Vertices.................0\n\nStatus:  PASS\n```\n\n## Setting Up a Development Environment\n\nClone the repository:\n\n```\n$ git clone https://github.com/altwalker/altwalker.git\n$ cd altwalker\n```\n\nInstall python dependencies:\n\n```\n$ pip install -r requirements.txt && \\\n  pip install -r requirements-dev.txt\n```\n\n### Running Tests\n\n```\n$ pytest tests -s -v\n```\n\n#### Running tests with tox inside Docker\n\n```\n$ docker run  -it --rm -v \"$(pwd):/altwalker\" -w \"/altwalker\" altwalker/tests:tox tox\n```\n\n### CLI\n\nAfter you install the python dependencies to setup AltWalker CLI locally from code run:\n\n```\n$ pip install --editable .\n```\n\nThen from any command line you can access:\n\n```\n$ altwalker --help\n```\n\n### Documentation\n\nAfter you install the python dependencies to generate the documentation run:\n\n```\n$ cd docs && \\\n  make clean && \\\n  make html\n```\n\nTo see the documentation run:\n\n```\n$ open build/html/index.html\n```\n\nTo rebuild the documentation on changes, with live-reload in the browser run:\n\n```\n$ sphinx-autobuild docs/source docs/build/html\n```\n\nNavigate to the documentation at http://127.0.0.1:8000.\n\n\n__Further Reading/Useful Links__:\n\n* [Google Style Docstring Example](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html#example-google)\n* [Google Style Guide](https://google.github.io/styleguide/pyguide.html)\n\n## Support\n\nJoin our [Gitter chat room](https://gitter.im/altwalker/community) or our [Google Group](https://groups.google.com/g/altwalker) to chat with us or with other members of the community.\n\n## License\n\nThis project is licensed under the [GNU General Public License v3.0](https://github.com/altwalker/altwalker/blob/main/LICENSE).\n",
    "bugtrack_url": null,
    "license": "GNU GPLv3",
    "summary": "AltWalker is an open source Model-Based Testing framework that supports running tests written in python3 and .NET/C#. You design your tests as a directed graph and AltWalker generates test cases from your graph (using GraphWalker) and executes them.",
    "version": "0.4.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/altwalker/altwalker/issues",
        "Homepage": "https://github.com/altwalker/altwalker",
        "Repository": "https://github.com/altwalker/altwalker.git"
    },
    "split_keywords": [
        "model-based-testing",
        "testing",
        "tests",
        "testing-framework"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dfff802a04a4516eee5caea21b87f38f6d1c0bf5cacb2c6cd48fce7663fe1460",
                "md5": "b1b205f2345cdb4deb29cda5cbe61a80",
                "sha256": "d6a53a810611e455e2eb703913587f66e8ebd782f780470fcdf1f06b0d600c74"
            },
            "downloads": -1,
            "filename": "altwalker-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b1b205f2345cdb4deb29cda5cbe61a80",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 35953668,
            "upload_time": "2023-09-20T22:16:08",
            "upload_time_iso_8601": "2023-09-20T22:16:08.757155Z",
            "url": "https://files.pythonhosted.org/packages/df/ff/802a04a4516eee5caea21b87f38f6d1c0bf5cacb2c6cd48fce7663fe1460/altwalker-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e80adad850760597d45b778d0db6bce09ff2b7bd578cc6ba7d9be4de14888da9",
                "md5": "039f6fa774901d07f4ae26b35225f7a9",
                "sha256": "4f3036718c8c4079d98657cbfcd8ae3824f4a615311168c6c02c9904f3308006"
            },
            "downloads": -1,
            "filename": "altwalker-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "039f6fa774901d07f4ae26b35225f7a9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 35925189,
            "upload_time": "2023-09-20T22:16:35",
            "upload_time_iso_8601": "2023-09-20T22:16:35.642236Z",
            "url": "https://files.pythonhosted.org/packages/e8/0a/dad850760597d45b778d0db6bce09ff2b7bd578cc6ba7d9be4de14888da9/altwalker-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-20 22:16:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "altwalker",
    "github_project": "altwalker",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "altwalker"
}
        
Elapsed time: 0.12166s