{"id":25446595,"url":"https://github.com/anthonykrivonos/qubot","last_synced_at":"2025-07-23T13:35:16.341Z","repository":{"id":52897170,"uuid":"338516226","full_name":"anthonykrivonos/qubot","owner":"anthonykrivonos","description":"🤖 Autonomous software acceptance testing library for Python taken from my Qubot paper.","archived":false,"fork":false,"pushed_at":"2021-04-16T06:29:12.000Z","size":34432,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T07:42:54.456Z","etag":null,"topics":["ai","autonomous","exploratory","machine","machine-learning","q-learning","selenium","testing"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/anthonykrivonos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-13T06:56:30.000Z","updated_at":"2021-10-08T18:07:42.000Z","dependencies_parsed_at":"2022-09-10T08:40:17.257Z","dependency_job_id":null,"html_url":"https://github.com/anthonykrivonos/qubot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anthonykrivonos/qubot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonykrivonos%2Fqubot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonykrivonos%2Fqubot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonykrivonos%2Fqubot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonykrivonos%2Fqubot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anthonykrivonos","download_url":"https://codeload.github.com/anthonykrivonos/qubot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonykrivonos%2Fqubot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266689300,"owners_count":23969142,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","autonomous","exploratory","machine","machine-learning","q-learning","selenium","testing"],"created_at":"2025-02-17T17:59:11.757Z","updated_at":"2025-07-23T13:35:16.278Z","avatar_url":"https://github.com/anthonykrivonos.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🤖 Qubot\n\nAn autonomous exploratory testing library for Python.\n\n### About\n\nQubot was created out of inspiration to create a fully autonomous testing bot to mimic a real-life\nQA-tester.\n\nSee [the Qubot paper](docs/qubot_paper.pdf) to learn more about the design decisions and the Q-learning approach behind\nthis repository. Moreover, see [experiments.ipynb](tests/experiments.ipynb) for the experiment\nmentioned in paper.\n\nHours of painstaking work have been put into this project thus far, and we hope this\nlibrary finds actual use in the field of autonomous software testing.\n\n### Getting Started\n\nTo get started with Qubot, simply download the library into your project's repository from PyPi:\n```\npip install qubot\n```\n\nThis will download all necessary dependencies, as well as install the `qubot` command line program\nin your current Python environment.\n\n#### Run Programmatically\n\nYou can specify each aspect of your test programmatically, and run it all within the same code file.\n\n```\nfrom qubot import Qubot, QubotConfigTerminalInfo, QubotConfigModelParameters, QubotDriverParameters, QubotPresetRewardFunc\n\nqb = Qubot(\n    url_to_test=\"https://upmed-starmen.web.app/\",\n    terminal_info_testing=QubotConfigTerminalInfo(\n        terminal_ids=[],\n        terminal_classes=[\"SignIn_login_hcp__qYuvP\"],\n        terminal_contains_text=[],\n    ),\n    terminal_info_training=QubotConfigTerminalInfo(\n        terminal_ids=[],\n        terminal_classes=[],\n        terminal_contains_text=[\"Log in as a Healthcare Provider\"],\n    ),\n    driver_params=QubotDriverParameters(\n        use_cache=False,\n        max_urls=10,\n    ),\n    model_params=QubotConfigModelParameters(\n        alpha=0.5,\n        gamma=0.6,\n        epsilon=1,\n        decay=0.01,\n        train_episodes=1000,\n        test_episodes=100,\n        step_limit=100,\n    ),\n    reward_func=QubotPresetRewardFunc.ENCOURAGE_EXPLORATION,\n    input_values={\n        \"color\": \"#000000\",\n        \"date\": \"2021-01-01\",\n        \"datetime-local\": \"2021-01-01T01:00\",\n        \"email\": \"johndoe@gmail.com\",\n        \"month\": \"2021-01\",\n        \"number\": \"1\",\n        \"password\": \"p@ssw0rd\",\n        \"search\": \"query\",\n        \"tel\": \"123-456-7890\",\n        \"text\": \"text\",\n        \"time\":  \"00:00:00.00\",\n        \"url\": \"https://www.google.com/\",\n        \"week\": \"2021-W01\"\n    }\n)\nqb.run()\nprint(qb.get_stats())\n```\n\nSee the source code for descriptions of each configuration property. If you'd like to stick with\ndefault values, your `Qubot` instantiation may look as short as the following:\n```\nqb = Qubot(\n    url_to_test=\"https://upmed-starmen.web.app/\",\n    QubotConfigTerminalInfo(\n        terminal_ids=[],\n        terminal_classes=[\"SignIn_login_hcp__qYuvP\"],\n        terminal_contains_text=[],\n    )\n)\n```\n\n#### Run Programmatically via a Configuration File\n\nShorten the Qubot setup code by adding a Qubot configuration `JSON` file in the same directory, as follows:\n\n##### qu_config.json\n```\n{\n\t\"url\": \"https://upmed-starmen.web.app/\",\n\t\"terminal_info\": {\n\t\t\"training\": {\n            \"ids\": [],\n            \"classes\": [\n                \"SignIn_login_hcp__qYuvP\"\n            ],\n            \"contains_text\": []\n\t\t},\n\t\t\"testing\": {\n            \"ids\": [],\n            \"classes\": [],\n            \"contains_text\": [\n                \"Log in as a Healthcare Provider\"\n            ]\n\t\t}\n\t},\n\t\"driver_parameters\": {\n\t    \"use_cache\": false,\n\t    \"max_urls\": 1\n\t},\n\t\"model_parameters\": {\n\t\t\"alpha\": 0.5,\n\t\t\"gamma\": 0.6,\n\t\t\"epsilon\": 1,\n\t\t\"decay\": 0.01,\n\t\t\"train_episodes\": 1000,\n\t\t\"test_episodes\": 100,\n\t\t\"step_limit\": 100\n\t},\n\t\"reward_func\": 3,\n\t\"input_values\": {\n        \"color\": \"#000000\",\n        \"date\": \"2021-01-01\",\n        \"datetime-local\": \"2021-01-01T01:00\",\n        \"email\": \"johndoe@gmail.com\",\n        \"month\": \"2021-01\",\n        \"number\": \"1\",\n        \"password\": \"p@ssw0rd\",\n        \"search\": \"query\",\n        \"tel\": \"123-456-7890\",\n        \"text\": \"text\",\n        \"time\":  \"00:00:00.00\",\n        \"url\": \"https://www.google.com/\",\n        \"week\": \"2021-W01\"\n\t}\n}\n```\n\nThen, run the following code to set up and execute the Qubot tests.\n\n##### main.py\n```\nfrom qubot import Qubot\n\nqb = Qubot.from_file('./qu_config.json')\nqb.run()\nprint(qb.get_stats())\n```\n\n#### Run in Command-Line via a Configuration File\n\nQubot is automatically installed to your command line when you run `pip install qubot`.\n\nAssuming you've defined the configuration in `./qu_config.json`, enter the\nfollowing into your command line to run a test:\n```\nqubot ./qu_config.json\n```\n\nThe above will generate an output file called `qu_stats.json` in the same directory. To change\nthe name of this output file, you can add the `--output_file`/`-o` flag:\n```\nqubot ./qu_config.json -o output_stats.json\n```\n\nSee this usage statement for more info on the command line utility:\n```\nusage: qubot [-h] config_file [--output_file OUTPUT_FILE]\n```\n\n#### Retrieving Test Statistics\n\nWhat good is a testing suite without stats?\n\nTo retrieve output statistics on your latest test run in code, simply call `Qubot(...).get_stats()` This is\nexemplified above.\n\nMeanwhile, output statistics will be written to a file (default: `qu_stats.json`) if using the command line program.\n\nStatistics have no defined shape, but generally look like the following:\n```\n{\n    \"elements_encountered\": {\n        \"count\": 80,\n        \"events\": [\n            \"\u003chtml id=\\\"\\\" class=\\\"\\\"\u003e (bccad3ad-f444-c74a-a440-631241a8dfc3)\",\n            \"\u003chead id=\\\"\\\" class=\\\"\\\"\u003e (12bf4d04-00df-2541-8b82-1476d4467471)\",\n            \"\u003cmeta id=\\\"\\\" class=\\\"\\\"\u003e (768ecfcb-5f5d-6945-96a6-6a8e6884d8a9)\",\n            \"\u003clink id=\\\"\\\" class=\\\"\\\"\u003e (34f6f1d4-7b65-5f4b-b92c-fa5ec96e480d)\",\n            ...\n        ]\n    },\n    \"elements_left_clicked\": {\n        \"count\": 7,\n        \"events\": [\n            \"\u003ca id=\\\"\\\" class=\\\"text-left pt-2 pb-2\\\"\u003e (ad1272a9-2a5a-2844-b741-39a7fbaf6aff)\",\n            ...\n        ]\n    },\n    \"step_count\": 110000,\n    \"reward_sum\": -1100000,\n    \"training_rewards\": {\n        \"count\": 1000,\n        \"events\": [\n            -1000,\n            -2000,\n            ...\n        ]\n    },\n    \"epsilon_history\": {\n        \"count\": 1000,\n        \"events\": [\n            1.0,\n            0.9901493354116764,\n            0.9803966865736877,\n            ...\n        ]\n    },\n    \"testing_rewards\": {\n        \"count\": 100,\n        \"events\": [\n            -1000,\n            ...\n        ]\n    },\n    \"testing_penalties\": {\n        \"count\": 100,\n        \"events\": [\n            100,\n            ...\n        ]\n    }\n}\n```\n\n### Authors\n\n\u003cb\u003eAnthony Krivonos\u003c/b\u003e \u003cbr/\u003e\n[Portfolio](https://anthonykrivonos.com) | [GitHub](https://github.com/anthonykrivonos)\n\n\u003cb\u003eKenneth Chuen\u003c/b\u003e \u003cbr/\u003e\n[GitHub](https://github.com/kenkenchuen)\n\nCreated for the [COMSE6156 - Topics in Software Engineering](https://www.coursicle.com/columbia/courses/COMS/E6156/)\ncourse at Columbia University in Spring 2021.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonykrivonos%2Fqubot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthonykrivonos%2Fqubot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonykrivonos%2Fqubot/lists"}