{ "info": { "author": "Team7", "author_email": "suchan.park@kaist.ac.kr", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Coding Test Input Generator\n\nCoTeGen automatically generates test suite of a typical coding test problem from the bottom. First, an initial test suite can be constructed with minimal cost. Next, search-based input generation with mutation fitness complement the initial test suite. Using mutated reference solution as a simplified form of wrong answers, we aim to kill as many mutants as possible. Hence, mutation coverage is provided as a complementary result.\n\n- PyPI Release: https://pypi.org/project/cotegen/\n\n- Academic Report: [Dropbox](https://www.dropbox.com/s/izvyd5c61xi35k5/CS453_Final_Project_Report__CoTeGen_.pdf?dl=0)\n\n## Adding New Reference Solution\n\nAfter installing our `cotegen` package, You can write a new reference solution as a simple python file to generate corresponding test cases.\n\nPlease locate your reference solution file in `examples/tasks` directory to utilize command line execution.\n\nYou should define a new class inherits `cotegen.Task` and with the same with filename. \n\n`input_parameters`, `solve`(reference solution), `compare`, and `convert_input_to_string` are essential methods to override.\n\nPlease refer the example:\n\n```python\nimport cotegen\n\n# http://codeforces.com/problemset/problem/1/A\n\nclass CF1A(cotegen.Task):\n input_parameters = \\\n {\n 'n': cotegen.types.Integer(1, 10**9),\n 'm': cotegen.types.Integer(1, 10**9),\n 'a': cotegen.types.Integer(1, 10**9),\n }\n\n def solve(n: int, m: int, a: int) -> int:\n # 1 <= n, m, a <= 10**9\n return ((n + (a-1)) // a) * ((m + (a-1)) // a)\n\n @staticmethod\n def compare(user_answer: int, jury_answer: int) -> bool:\n return user_answer == jury_answer\n\n @staticmethod\n def convert_input_to_string(n: int, m: int, a: int):\n return \"%d %d %d\\n\" % (n, m, a)\n\n\nif __name__ == '__main__':\n import os\n CF1A.generate_test_files(os.path.expanduser(\"~/Downloads/CS453/CF1A\"))\n\n```\n\n### Define Input Parameters\nPredefine the types of input parameters and the range of each argument as a dictionary format.\n\nCurrently, `CoTeGen` supports following types:\n\n```python\ncotegen.types.Integer\ncotegen.types.IntegerSequence\ncotegen.types.NonIncreasingIntegerSequence\ncotegen.types.FixedVariableLengthIntegerSequence\ncotegen.types.IntegerPermutation\n```\n\n### Define constraint\n\nIf needed, define the constraints among input parameters as list.\n```python\nconstraints = [\n cotegen.constraints.Leq('M', 'N')\n ]\n```\n\nYou can utilize these predefined constraints:\n\n```python\ncotegen.constraints.Leq (Less than or equal)\ncotegen.constraints.ListLengthLeqInteger\ncotegen.constraints.ListLengthReqInteger\n```\n\nor, use custom constraints giving custom function (which receives parameter dictionary and returns true/false) as an argument\n\n```python\ncotegen.constraints.CustomConstraint(lambda test: 'd1' not in test or 'd2' not in test or test['d1'] != test['d2'])\n```\n\n## Command Line Usage\n\n```\npython -m cotegen run random --filename \n\npython -m cotegen run mutation --filename --show-survived \n\npython -m cotegen run kill --filename --save --mutation-fitness \n```\n\nFor example:\n\n```\npython -m cotegen run random --filename CF158A\n\npython -m cotegen run mutation --filename CF158A\n\npython -m cotegen run kill --filename CF158A --save ~/Downloads --mutation-fitness true\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kaist-cs453-2019s-team7/cs453-team-project", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "cotegen", "package_url": "https://pypi.org/project/cotegen/", "platform": "", "project_url": "https://pypi.org/project/cotegen/", "project_urls": { "Homepage": "https://github.com/kaist-cs453-2019s-team7/cs453-team-project" }, "release_url": "https://pypi.org/project/cotegen/1.1/", "requires_dist": null, "requires_python": "", "summary": "KAIST CS453 2019 Spring Team 7 Project", "version": "1.1" }, "last_serial": 5418232, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "33e96f816ab19f80ca76476b8b98ba46", "sha256": "513cd8342c867d92afe1fc8ee0a5fefda8da9348162387a57d6bf701594473a6" }, "downloads": -1, "filename": "cotegen-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "33e96f816ab19f80ca76476b8b98ba46", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23306, "upload_time": "2019-06-18T14:23:13", "url": "https://files.pythonhosted.org/packages/ac/8b/1287ada58ac6fd55db2cff74a7e939df3eb0d35416828ad671caba1c538f/cotegen-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "743f289e2919de2fbcd2c8c96c5b717e", "sha256": "2e0dc86d46dda7d807c34002823c6d5caea3ed2719de635096b5327d68ff082d" }, "downloads": -1, "filename": "cotegen-1.0.tar.gz", "has_sig": false, "md5_digest": "743f289e2919de2fbcd2c8c96c5b717e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15398, "upload_time": "2019-06-18T14:23:19", "url": "https://files.pythonhosted.org/packages/02/6a/ad9fd2a21926d660336334bb6c397b06e6ed34ebb02a484786ffd4d978da/cotegen-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "a0387b2db07ccc887c0246ac4b27c091", "sha256": "bb090de064405e9e958a57d4d8527a18e718de04c0db342fa01c0cabbbc98ba5" }, "downloads": -1, "filename": "cotegen-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a0387b2db07ccc887c0246ac4b27c091", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24596, "upload_time": "2019-06-19T02:53:05", "url": "https://files.pythonhosted.org/packages/62/ec/cd23f6b460cce1fab15f1a61fc65f07bce610f8cbdf9c2a6dd58d9b3b88f/cotegen-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "88622e2a598867e225fed9f90e5ce77c", "sha256": "85d2fe84b1658867978bf9c47f24a272d525e41077fc79e53379af663f315188" }, "downloads": -1, "filename": "cotegen-1.1.tar.gz", "has_sig": false, "md5_digest": "88622e2a598867e225fed9f90e5ce77c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17855, "upload_time": "2019-06-19T02:53:07", "url": "https://files.pythonhosted.org/packages/26/d8/c8f19eb47b074f740f325b51caf7504c3295583227e474c2893c415982e7/cotegen-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a0387b2db07ccc887c0246ac4b27c091", "sha256": "bb090de064405e9e958a57d4d8527a18e718de04c0db342fa01c0cabbbc98ba5" }, "downloads": -1, "filename": "cotegen-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a0387b2db07ccc887c0246ac4b27c091", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24596, "upload_time": "2019-06-19T02:53:05", "url": "https://files.pythonhosted.org/packages/62/ec/cd23f6b460cce1fab15f1a61fc65f07bce610f8cbdf9c2a6dd58d9b3b88f/cotegen-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "88622e2a598867e225fed9f90e5ce77c", "sha256": "85d2fe84b1658867978bf9c47f24a272d525e41077fc79e53379af663f315188" }, "downloads": -1, "filename": "cotegen-1.1.tar.gz", "has_sig": false, "md5_digest": "88622e2a598867e225fed9f90e5ce77c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17855, "upload_time": "2019-06-19T02:53:07", "url": "https://files.pythonhosted.org/packages/26/d8/c8f19eb47b074f740f325b51caf7504c3295583227e474c2893c415982e7/cotegen-1.1.tar.gz" } ] }