{"id":17019053,"url":"https://github.com/robert-96/altwalker-graph-data-demo","last_synced_at":"2025-03-22T16:28:39.016Z","repository":{"id":139248119,"uuid":"384144293","full_name":"Robert-96/altwalker-graph-data-demo","owner":"Robert-96","description":"A simple example of an AltWalker project that updates the graph data from the test code.","archived":false,"fork":false,"pushed_at":"2022-10-19T13:29:51.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T17:54:04.338Z","etag":null,"topics":["altwalker","graphwalker","model-based-testing","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Robert-96.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-08T14:04:05.000Z","updated_at":"2022-09-15T19:32:36.000Z","dependencies_parsed_at":"2023-05-17T17:45:31.283Z","dependency_job_id":null,"html_url":"https://github.com/Robert-96/altwalker-graph-data-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert-96%2Faltwalker-graph-data-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert-96%2Faltwalker-graph-data-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert-96%2Faltwalker-graph-data-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert-96%2Faltwalker-graph-data-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Robert-96","download_url":"https://codeload.github.com/Robert-96/altwalker-graph-data-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244985369,"owners_count":20542813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["altwalker","graphwalker","model-based-testing","python"],"created_at":"2024-10-14T06:47:56.514Z","updated_at":"2025-03-22T16:28:38.996Z","avatar_url":"https://github.com/Robert-96.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# altwalker-graph-data-demo\n\nA simple example of an AltWalker project that updates the graph data from the test code.\n\n## Overview\n\nThis example showcases how you can update you graph data (model data) in order to influence the path generation.\n\nBasically we have a node from witch we want to go.\n\n\n\u003e **Note**:\n\u003e\n\u003e This method doesn't works with the `offline` command because it generates all steps before the execution of the test code.\n\u003e\n\u003e This method only works with the `online` command, where only one step from the path is generated at a time and then executed.\n\n\nFist we will initialize a variable `number` inside the `action` section of the model with a default value:\n\n```json\n\"actions\": [\n    \"number = 0;\"\n]\n```\n\nFist we will add a guard.\n\n```json\n\"guard\": \"number \u003e 0.5\"\n```\n\nIn order to update the graph data from your tests, you need to define the method with a parameter, and AltWalker will pass the graph data to your method. This method is a way of executing actions from you test code.\n\nThen in the method corresponding with our branching vertex will add:\n\n```python\ndef v_start(self, data):\n    data['number'] = random.random()\n```\n\n## Setup\n\nYou can find the AltWalker setup guide [here](https://altom.gitlab.io/altwalker/altwalker/installation.html).\n\n## Running the tests\n\n```\n$ altwalker online tests -m models/default.json \"random(vertex_coverage(100))\"\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert-96%2Faltwalker-graph-data-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobert-96%2Faltwalker-graph-data-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert-96%2Faltwalker-graph-data-demo/lists"}