All Projects → lovesoo → Orthogonalarraytest

lovesoo / Orthogonalarraytest

OrthogonalArrayTest. 正交实验法设计测试用例,自动生成测试集。

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Orthogonalarraytest

Cracking The Coding Interview
Solutions for Cracking the Coding Interview - 6th Edition
Stars: ✭ 35 (-55.7%)
Mutual labels:  array
Cartesian Product
PHP - A simple, low-memory footprint function to generate all combinations from a multi-dimensionnal array.
Stars: ✭ 58 (-26.58%)
Mutual labels:  array
Presento
Presento - Transformer & Presenter Package for PHP
Stars: ✭ 71 (-10.13%)
Mutual labels:  array
Pgo
Go library for PHP community with convenient functions
Stars: ✭ 51 (-35.44%)
Mutual labels:  array
Zarr.js
Javascript implementation of Zarr
Stars: ✭ 54 (-31.65%)
Mutual labels:  array
Array view
Wrapper for references to array in C++.
Stars: ✭ 58 (-26.58%)
Mutual labels:  array
Shallow Clone
Make a shallow clone of an object, array or primitive.
Stars: ✭ 23 (-70.89%)
Mutual labels:  array
Map
PHP Map package for easy and elegant handling of PHP arrays as array-like map objects
Stars: ✭ 1,180 (+1393.67%)
Mutual labels:  array
Immutable Array Prototype
A collection of Immutable Array prototype methods(Per method packages).
Stars: ✭ 56 (-29.11%)
Mutual labels:  array
Mjextension
A fast, convenient and nonintrusive conversion framework between JSON and model. Your model class doesn't need to extend any base class. You don't need to modify any model file.
Stars: ✭ 8,458 (+10606.33%)
Mutual labels:  array
Golang Combinations
Golang library which provide an algorithm to generate all combinations out of a given string array.
Stars: ✭ 51 (-35.44%)
Mutual labels:  array
Geeksforgeeks Dsa 2
This repository contains all the assignments and practice questions solved during the Data Structures and Algorithms course in C++ taught by the Geeks For Geeks team.
Stars: ✭ 53 (-32.91%)
Mutual labels:  array
Pycuda
CUDA integration for Python, plus shiny features
Stars: ✭ 1,112 (+1307.59%)
Mutual labels:  array
Sma
Calculate the simple moving average of an array.
Stars: ✭ 48 (-39.24%)
Mutual labels:  array
Componentarrays.jl
Arrays with arbitrarily nested named components.
Stars: ✭ 72 (-8.86%)
Mutual labels:  array
Kakajson
Fast conversion between JSON and model in Swift.
Stars: ✭ 867 (+997.47%)
Mutual labels:  array
Array Sort
Fast and powerful array sorting. Sort an array of objects by one or more properties. Any number of nested properties or custom comparison functions may be used.
Stars: ✭ 58 (-26.58%)
Mutual labels:  array
Tiledb Py
Python interface to the TileDB storage manager
Stars: ✭ 78 (-1.27%)
Mutual labels:  array
Jewell
Javascript Syntax Sugar for Higher-Order Messaging
Stars: ✭ 72 (-8.86%)
Mutual labels:  array
Hibernate Types
The Hibernate Types library gives you extra types that are not supported by the Hibernate ORM core.
Stars: ✭ 1,122 (+1320.25%)
Mutual labels:  array

OrthogonalArrayTest

OrthogonalArrayTest. 使用正交实验法设计测试用例,生成测试集。

1.简介

正交试验法是研究多因素、多水平的一种试验法,它是利用正交表来对试验进行设计,通过少数的试验替代全面试验,根据正交表的正交性从全面试验中挑选适量的、有代表性的点进行试验,这些有代表性的点具备了“均匀分散,整齐可比”的特点。

正交实验法设计测试用例,基本步骤如下:

  1. 提取测试需求功能说明,确定因素数和水平数
  2. 根据因素数和水平数确定n值
  3. 选择合适的正交表
  4. 根据正交表把变量的值映射到表中,设计测试用例数据集

本文参考如上步骤,使用Python实现了使用正交表自动设计测试用例的完整流程。

支持Python版本为 2.7, 3.7。

2.示例demo

输入case1,case2,case3,分别计算m(水平数),k(因素数目),n(实验次数),然后查询选择合适的正交表,裁剪最终生成相关测试集

# encoding: utf-8


from OAT import *
import json

if __name__ == "__main__":
    oat = OAT()
    case1 = OrderedDict([('K1', [0, 1]),
                         ('K2', [0, 1]),
                         ('K3', [0, 1])])

    case2 = OrderedDict([('A', ['A1', 'A2', 'A3']),
                         ('B', ['B1', 'B2', 'B3', 'B4']),
                         ('C', ['C1', 'C2', 'C3']),
                         ('D', ['D1', 'D2'])])

    case3 = OrderedDict([(u'对比度', [u'正常', u'极低', u'低', u'高', u'极高']),
                         (u'色彩效果', [u'无', u'黑白', u'棕褐色', u'负片', u'水绿色']),
                         (u'感光度', [u'自动', 100, 200, 400, 800]),
                         (u'白平衡', [u'自动', u'白炽光', u'日光', u'荧光', u'阴光']),
                         (u'照片大小', ['5M', '3M', '2M', '1M', 'VGA']),
                         (u'闪光模式', [u'开', u'关'])])

    case4 = OrderedDict([('A', ['A1', 'A2', 'A3', 'A4', 'A5', 'A6']),
                         ('B', ['B1']),
                         ('C', ['C1'])])

    print json.dumps(oat.genSets(case1))
    print json.dumps(oat.genSets(case2))
    print json.dumps(oat.genSets(case3), ensure_ascii=False)
    print json.dumps(oat.genSets(case4))
    print json.dumps(oat.genSets(case4, 1, 0))
    print json.dumps(oat.genSets(case4, 1, 1))
    print json.dumps(oat.genSets(case4, 1, 2))
    print json.dumps(oat.genSets(case4, 1, 3))

执行结果如下:

[{"K1": 0, "K2": 0, "K3": 0}, {"K1": 0, "K2": 1, "K3": 1}, {"K1": 1, "K2": 0, "K3": 1}, {"K1": 1, "K2": 1, "K3": 0}]
[{"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}]
[{"对比度": "正常", "色彩效果": "无", "感光度": "自动", "白平衡": "自动", "照片大小": "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", "闪光模式": "开"}]
[{"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"}]
[{"A": "A1", "B": "B1", "C": "C1"}]
[{"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"}]
[{"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"}]
[{"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"}]

3.后续计划

  1. 判定表查询逻辑优化
  2. 测试用例集裁剪优化

4.参考

  1. 测试用例设计-正交实验法详解: https://wenku.baidu.com/view/a54724156edb6f1aff001f79.html
  2. 用正交实验法设计测试用例:http://blog.csdn.net/fangnannanf/article/details/52813498
  3. Dr. Genichi Taguchi 设计的正交表:http://www.york.ac.uk/depts/maths/tables/orthogonal.htm
  4. Technical Support com:http://support.sas.com/techsup/technote/ts723_Designs.txt
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].