Package: altwalker
AltWalkerAltWalker is an open source, Model-Based Testing framework.Read the documentation onhttps://altwalker.github.io/altwalker.Join ourGitter chat roomor ourGoogle Groupto chat with us or with other members of the community.Table of ContentsOverviewInstallationQuickstartSetting Up a Development EnvironmentSupportLicenseOverviewAltWalkeris 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 (usingGraphWalker) and executes them.Model-Based TestingModel-Based Testingis 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 structurethe model can be updated to reflect the requirements changes making the tests easy to maintaindynamically 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.AltWalkerAltWalker 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'sunittestmodule. 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,setUpModelandtearDownModel.Now it supports running tests written in .NET/C# and Python3.AltWalker ComponentsAltWalker 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.GeneratorandStop 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 themodel(s)and a pair ofgeneratorandstop conditionto provide a path (a sequence of steps) through the model(s).Currently AltWalker provides two planners:Online PlannerOffline PlannerReporter: 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 thetest 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 ExecutorAnd anHttp Executorthat allows you to hook up your own executor via HTTP. You can read
more about the Http Executor on theHow to: Write your own executorpage.Walker: the test runner. Coordinates the execution of a test asking thePlannerfor the next step, executing the step using theExecutorand reporting the progress
using theReporter.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 theofflinecommand.InstallationPrerequisites:Python3(with pip3)Java 8GraphWalker CLI(Optional).NET Core(Optional)git(Optional)Install AltWalkerTo installaltwalkerrun the following command in your command line:$ pip install altwalkerTo check that you have installed the correct version of AltWalker, run the
following command:$ altwalker --versionLiving on the edgeIf you want to work with the latest code before it’s released, install or update the code from thedevelopbranch:$ pip install -U git+https://github.com/altwalker/altwalkerFor a more detailed tutorial read theInstallationsection from the documentation.QuickstartMake 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:  PASSSetting Up a Development EnvironmentClone the repository:$ git clone https://github.com/altwalker/altwalker.git
$ cd altwalkerInstall python dependencies:$ pip install -r requirements.txt && \
  pip install -r requirements-dev.txtRunning Tests$ pytest tests -s -vRunning tests with tox inside Docker$ docker run  -it --rm -v "$(pwd):/altwalker" -w "/altwalker" altwalker/tests:tox toxCLIAfter 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 --helpDocumentationAfter you install the python dependencies to generate the documentation run:$ cd docs && \
  make clean && \
  make htmlTo see the documentation run:$ open build/html/index.htmlTo rebuild the documentation on changes, with live-reload in the browser run:$ sphinx-autobuild docs/source docs/build/htmlNavigate to the documentation athttp://127.0.0.1:8000.Further Reading/Useful Links:Google Style Docstring ExampleGoogle Style GuideSupportJoin ourGitter chat roomor ourGoogle Groupto chat with us or with other members of the community.LicenseThis project is licensed under theGNU General Public License v3.0.