{"id":18345687,"url":"https://github.com/lovesoo/orthogonalarraytest","last_synced_at":"2025-08-20T08:32:17.149Z","repository":{"id":22748135,"uuid":"97212362","full_name":"lovesoo/OrthogonalArrayTest","owner":"lovesoo","description":"OrthogonalArrayTest. 正交实验法设计测试用例，自动生成测试集。","archived":false,"fork":false,"pushed_at":"2023-03-25T11:42:50.000Z","size":251,"stargazers_count":157,"open_issues_count":0,"forks_count":59,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-05T15:47:46.784Z","etag":null,"topics":["array","orthogonal","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lovesoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-07-14T08:36:59.000Z","updated_at":"2024-10-15T03:59:23.000Z","dependencies_parsed_at":"2022-09-16T10:50:49.458Z","dependency_job_id":"d8b84482-d5ed-43d3-bf74-19e152201fb9","html_url":"https://github.com/lovesoo/OrthogonalArrayTest","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/lovesoo%2FOrthogonalArrayTest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesoo%2FOrthogonalArrayTest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesoo%2FOrthogonalArrayTest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovesoo%2FOrthogonalArrayTest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovesoo","download_url":"https://codeload.github.com/lovesoo/OrthogonalArrayTest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230408170,"owners_count":18220974,"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":["array","orthogonal","python"],"created_at":"2024-11-05T21:09:07.100Z","updated_at":"2024-12-19T09:07:11.115Z","avatar_url":"https://github.com/lovesoo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OrthogonalArrayTest\nUse the orthogonal experiment method to design test cases and generate test sets. \n\n[中文版README](https://github.com/lovesoo/OrthogonalArrayTest/blob/master/README_CN.md)\n\n### 1.Introduction\nOrthogonal test method is a multi-factor and multi-level test method. It uses the orthogonal table to design the test, replaces the comprehensive test with a small number of tests, and selects from the comprehensive test according to the orthogonality of the orthogonal table. An appropriate amount of representative points are tested, and these representative points have the characteristics of \"evenly dispersed, neat and comparable\".\n\nUse orthogonal experiment method to design test cases, the basic steps are as follows:\n\n1. Extract the functional description of test requirements, determine the number of factors and levels\n2. Determine the n value based on the number of factors and the number of levels\n2. Select the appropriate orthogonal table\n3. Map the values of the variables to the table according to the orthogonal table, and design the test case data set\n\nReferring to the above steps, this article uses Python to implement the complete process of automatically designing test cases using orthogonal tables.\n\nSupported Python 2.7 ~ 3.8.\n\n### 2.Demo\nInput case1, case2, case3, respectively calculate m (number of levels), k (number of factors), n (number of experiments), and then query to select the appropriate orthogonal table, crop and finally generate the relevant test set\n\n```\n# encoding: utf-8\n\n\nfrom OAT import *\nimport json\n\nif __name__ == \"__main__\":\n    oat = OAT()\n    case1 = OrderedDict([('K1', [0, 1]),\n                         ('K2', [0, 1]),\n                         ('K3', [0, 1])])\n\n    case2 = OrderedDict([('A', ['A1', 'A2', 'A3']),\n                         ('B', ['B1', 'B2', 'B3', 'B4']),\n                         ('C', ['C1', 'C2', 'C3']),\n                         ('D', ['D1', 'D2'])])\n\n    case3 = OrderedDict([(u'对比度', [u'正常', u'极低', u'低', u'高', u'极高']),\n                         (u'色彩效果', [u'无', u'黑白', u'棕褐色', u'负片', u'水绿色']),\n                         (u'感光度', [u'自动', 100, 200, 400, 800]),\n                         (u'白平衡', [u'自动', u'白炽光', u'日光', u'荧光', u'阴光']),\n                         (u'照片大小', ['5M', '3M', '2M', '1M', 'VGA']),\n                         (u'闪光模式', [u'开', u'关'])])\n\n    case4 = OrderedDict([('A', ['A1', 'A2', 'A3', 'A4', 'A5', 'A6']),\n                         ('B', ['B1']),\n                         ('C', ['C1'])])\n\n    print json.dumps(oat.genSets(case1))\n    print json.dumps(oat.genSets(case2))\n    print json.dumps(oat.genSets(case3), ensure_ascii=False)\n    print json.dumps(oat.genSets(case4))\n    print json.dumps(oat.genSets(case4, 1, 0))\n    print json.dumps(oat.genSets(case4, 1, 1))\n    print json.dumps(oat.genSets(case4, 1, 2))\n    print json.dumps(oat.genSets(case4, 1, 3))\n\n```\n\nRun Result：\n\n```\n[{\"K1\": 0, \"K2\": 0, \"K3\": 0}, {\"K1\": 0, \"K2\": 1, \"K3\": 1}, {\"K1\": 1, \"K2\": 0, \"K3\": 1}, {\"K1\": 1, \"K2\": 1, \"K3\": 0}]\n[{\"A\": \"A1\", \"B\": \"B1\", \"C\": \"C1\", \"D\": \"D1\"}, {\"A\": \"A1\", \"B\": \"B2\", \"C\": \"C2\", \"D\": \"D2\"}, {\"A\": \"A1\", \"B\": \"B3\", \"C\": \"C3\", \"D\": null}, {\"A\": \"A1\", \"B\": \"B4\", \"C\": null, \"D\": null}, {\"A\": \"A2\", \"B\": \"B1\", \"C\": \"C2\", \"D\": null}, {\"A\": \"A2\", \"B\": \"B2\", \"C\": \"C1\", \"D\": null}, {\"A\": \"A2\", \"B\": \"B3\", \"C\": null, \"D\": \"D1\"}, {\"A\": \"A2\", \"B\": \"B4\", \"C\": \"C3\", \"D\": \"D2\"}, {\"A\": \"A3\", \"B\": \"B1\", \"C\": \"C3\", \"D\": null}, {\"A\": \"A3\", \"B\": \"B2\", \"C\": null, \"D\": null}, {\"A\": \"A3\", \"B\": \"B3\", \"C\": \"C1\", \"D\": \"D2\"}, {\"A\": \"A3\", \"B\": \"B4\", \"C\": \"C2\", \"D\": \"D1\"}, {\"A\": null, \"B\": \"B1\", \"C\": null, \"D\": \"D2\"}, {\"A\": null, \"B\": \"B2\", \"C\": \"C3\", \"D\": \"D1\"}, {\"A\": null, \"B\": \"B3\", \"C\": \"C2\", \"D\": null}, {\"A\": null, \"B\": \"B4\", \"C\": \"C1\", \"D\": null}]\n[{\"对比度\": \"正常\", \"色彩效果\": \"无\", \"感光度\": \"自动\", \"白平衡\": \"自动\", \"照片大小\": \"5M\", \"闪光模式\": \"开\"}, {\"对比度\": \"正常\", \"色彩效果\": \"黑白\", \"感光度\": 200, \"白平衡\": \"荧光\", \"照片大小\": \"VGA\", \"闪光模式\": \"关\"}, {\"对比度\": \"正常\", \"色彩效果\": \"棕褐色\", \"感光度\": 800, \"白平衡\": \"白炽光\", \"照片大小\": \"1M\", \"闪光模式\": null}, {\"对比度\": \"正常\", \"色彩效果\": \"负片\", \"感光度\": 100, \"白平衡\": \"阴光\", \"照片大小\": \"2M\", \"闪光模式\": null}, {\"对比度\": \"正常\", \"色彩效果\": \"水绿色\", \"感光度\": 400, \"白平衡\": \"日光\", \"照片大小\": \"3M\", \"闪光模式\": null}, {\"对比度\": \"极低\", \"色彩效果\": \"无\", \"感光度\": 800, \"白平衡\": \"荧光\", \"照片大小\": \"2M\", \"闪光模式\": null}, {\"对比度\": \"极低\", \"色彩效果\": \"黑白\", \"感光度\": 100, \"白平衡\": \"白炽光\", \"照片大小\": \"3M\", \"闪光模式\": \"开\"}, {\"对比度\": \"极低\", \"色彩效果\": \"棕褐色\", \"感光度\": 400, \"白平衡\": \"阴光\", \"照片大小\": \"5M\", \"闪光模式\": \"关\"}, {\"对比度\": \"极低\", \"色彩效果\": \"负片\", \"感光度\": \"自动\", \"白平衡\": \"日光\", \"照片大小\": \"VGA\", \"闪光模式\": null}, {\"对比度\": \"极低\", \"色彩效果\": \"水绿色\", \"感光度\": 200, \"白平衡\": \"自动\", \"照片大小\": \"1M\", \"闪光模式\": null}, {\"对比度\": \"低\", \"色彩效果\": \"无\", \"感光度\": 400, \"白平衡\": \"白炽光\", \"照片大小\": \"VGA\", \"闪光模式\": null}, {\"对比度\": \"低\", \"色彩效果\": \"黑白\", \"感光度\": \"自动\", \"白平衡\": \"阴光\", \"照片大小\": \"1M\", \"闪光模式\": null}, {\"对比度\": \"低\", \"色彩效果\": \"棕褐色\", \"感光度\": 200, \"白平衡\": \"日光\", \"照片大小\": \"2M\", \"闪光模式\": \"开\"}, {\"对比度\": \"低\", \"色彩效果\": \"负片\", \"感光度\": 800, \"白平衡\": \"自动\", \"照片大小\": \"3M\", \"闪光模式\": \"关\"}, {\"对比度\": \"低\", \"色彩效果\": \"水绿色\", \"感光度\": 100, \"白平衡\": \"荧光\", \"照片大小\": \"5M\", \"闪光模式\": null}, {\"对比度\": \"高\", \"色彩效果\": \"无\", \"感光度\": 200, \"白平衡\": \"阴光\", \"照片大小\": \"3M\", \"闪光模式\": null}, {\"对比度\": \"高\", \"色彩效果\": \"黑白\", \"感光度\": 800, \"白平衡\": \"日光\", \"照片大小\": \"5M\", \"闪光模式\": null}, {\"对比度\": \"高\", \"色彩效果\": \"棕褐色\", \"感光度\": 100, \"白平衡\": \"自动\", \"照片大小\": \"VGA\", \"闪光模式\": null}, {\"对比度\": \"高\", \"色彩效果\": \"负片\", \"感光度\": 400, \"白平衡\": \"荧光\", \"照片大小\": \"1M\", \"闪光模式\": \"开\"}, {\"对比度\": \"高\", \"色彩效果\": \"水绿色\", \"感光度\": \"自动\", \"白平衡\": \"白炽光\", \"照片大小\": \"2M\", \"闪光模式\": \"关\"}, {\"对比度\": \"极高\", \"色彩效果\": \"无\", \"感光度\": 100, \"白平衡\": \"日光\", \"照片大小\": \"1M\", \"闪光模式\": \"关\"}, {\"对比度\": \"极高\", \"色彩效果\": \"黑白\", \"感光度\": 400, \"白平衡\": \"自动\", \"照片大小\": \"2M\", \"闪光模式\": null}, {\"对比度\": \"极高\", \"色彩效果\": \"棕褐色\", \"感光度\": \"自动\", \"白平衡\": \"荧光\", \"照片大小\": \"3M\", \"闪光模式\": null}, {\"对比度\": \"极高\", \"色彩效果\": \"负片\", \"感光度\": 200, \"白平衡\": \"白炽光\", \"照片大小\": \"5M\", \"闪光模式\": null}, {\"对比度\": \"极高\", \"色彩效果\": \"水绿色\", \"感光度\": 800, \"白平衡\": \"阴光\", \"照片大小\": \"VGA\", \"闪光模式\": \"开\"}]\n[{\"A\": \"A1\", \"B\": \"B1\", \"C\": \"C1\"}, {\"A\": \"A1\", \"B\": null, \"C\": null}, {\"A\": \"A2\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A2\", \"B\": null, \"C\": null}, {\"A\": \"A2\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A3\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A3\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A3\", \"B\": null, \"C\": null}, {\"A\": \"A4\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A4\", \"B\": null, \"C\": null}, {\"A\": \"A4\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A5\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A5\", \"B\": null, \"C\": null}, {\"A\": \"A5\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A6\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A6\", \"B\": null, \"C\": null}, {\"A\": \"A6\", \"B\": null, \"C\": \"C1\"}, {\"A\": null, \"B\": \"B1\", \"C\": null}, {\"A\": null, \"B\": null, \"C\": null}, {\"A\": null, \"B\": null, \"C\": \"C1\"}]\n[{\"A\": \"A1\", \"B\": \"B1\", \"C\": \"C1\"}]\n[{\"A\": \"A1\", \"B\": \"B1\", \"C\": \"C1\"}, {\"A\": \"A2\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A2\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A3\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A3\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A4\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A4\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A5\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A5\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A6\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A6\", \"B\": null, \"C\": \"C1\"}]\n[{\"A\": \"A1\", \"B\": \"B1\", \"C\": \"C1\"}, {\"A\": \"A1\", \"B\": null, \"C\": null}, {\"A\": \"A2\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A2\", \"B\": null, \"C\": null}, {\"A\": \"A2\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A3\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A3\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A3\", \"B\": null, \"C\": null}, {\"A\": \"A4\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A4\", \"B\": null, \"C\": null}, {\"A\": \"A4\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A5\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A5\", \"B\": null, \"C\": null}, {\"A\": \"A5\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A6\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A6\", \"B\": null, \"C\": null}, {\"A\": \"A6\", \"B\": null, \"C\": \"C1\"}, {\"A\": null, \"B\": \"B1\", \"C\": null}, {\"A\": null, \"B\": null, \"C\": \"C1\"}]\n[{\"A\": \"A1\", \"B\": \"B1\", \"C\": \"C1\"}, {\"A\": \"A1\", \"B\": null, \"C\": null}, {\"A\": \"A2\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A2\", \"B\": null, \"C\": null}, {\"A\": \"A2\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A3\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A3\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A3\", \"B\": null, \"C\": null}, {\"A\": \"A4\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A4\", \"B\": null, \"C\": null}, {\"A\": \"A4\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A5\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A5\", \"B\": null, \"C\": null}, {\"A\": \"A5\", \"B\": null, \"C\": \"C1\"}, {\"A\": \"A6\", \"B\": \"B1\", \"C\": null}, {\"A\": \"A6\", \"B\": null, \"C\": null}, {\"A\": \"A6\", \"B\": null, \"C\": \"C1\"}, {\"A\": null, \"B\": \"B1\", \"C\": null}, {\"A\": null, \"B\": null, \"C\": null}, {\"A\": null, \"B\": null, \"C\": \"C1\"}]\n\n```\n\n### 3.To-Do List\n1. Decision table query logic optimization\n2. Test case set tailoring and optimization\n\n### 4.Reference\n1. [https://wenku.baidu.com/view/a54724156edb6f1aff001f79.html](https://wenku.baidu.com/view/a54724156edb6f1aff001f79.html)\n2. [http://www.york.ac.uk/depts/maths/tables/orthogonal.htm](http://www.york.ac.uk/depts/maths/tables/orthogonal.htm)\n3. [http://support.sas.com/techsup/technote/ts723_Designs.txt](http://support.sas.com/techsup/technote/ts723_Designs.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovesoo%2Forthogonalarraytest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovesoo%2Forthogonalarraytest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovesoo%2Forthogonalarraytest/lists"}