欢迎光临
我们一直在努力

【阅读笔记】软件测试架构师的知识能力模型(上)

文章目录

  • 1 软件产品质量模型
    • 软件产品质量6属性
  • 2 测试类型
  • 3 测试方法
    • 功能测试方法
    • 可靠性测试方法
    • 性能测试方法
    • 易用性测试方法
  • 4 下篇概览

前段时间非常焦虑,于是有嵌入式测试的实习offer就接了。这几天没有ET测试要做,
摸鱼 顺手记录一下阅读刘琛梅《测试架构师修炼之道》的学习笔记,带大家简要阅读一下,划划重点,顺便尝试一下markdown和mermaid语法,诸多不足还望海涵!

1 软件产品质量模型

“正确、全面、深入地理解用户需求”是测试的基础,“验证产品质量是否满足用户的需求”是软件测试的一个重要目标。为了系统地分析、理解用户需求,我们可以用到软件产品质量模型来分析。

软件产品质量6属性

软件产品质量模型将一个软件产品所需要满足的质量划分为6大属性,每类属性又细分为很多子属性。一个高质量的产品,一定是在6大属性上设计得都很出色的产品。对于软件测试架构师而言,掌握了高质量的产品应该具备的特质,也就等于拿到了了验证产品、评价产品的“金钥匙”。

功能性是指产品能够提供满足明确和隐含要求的功能,可以被划分为5个子属性: ①适合性:能够提供一组合适的功能。不仅要包含容易想到的功能,也应有一些用户在特定情境下才会用到的功能。 ②准确性:能够提供正确的结果,且精度符合要求。 ③互操作性:这个说法可能有点晦涩,其实描述的是兼容性的问题。功能与其他功能的结果可以一起显示。产品能够兼容不同的工作模式和系统版本。 ④安全性:能够保护数据和信息。无权限的用户不能阅读和修改,而有权限的用户不会被拒绝访问。 ⑤功能顺从性:功能符合相关的标准、规则。如计算器,计算规则应该与数学中的相关规则一致。

可靠性是指维持规定的性能级别的能力。首先,设备最好不要出现故障;其次,设备出现故障了也不会影响主要的功能和业务;最后,如果影响了主要功能和业务,系统也能尽快定位和恢复。可以划分为4个子属性: ①成熟性:功能不会失效,即便是已经持续运行了一段时间。 ②容错性:对用户的错误输入,有处理应对能力。 ③可恢复性:一旦出现了产品自身无法预期的异常,能够恢复(包括自动恢复和手动恢复)。 ④可靠性顺从性:系统故障率和故障恢复时间等等指标需要符合标准。

易用性是指软件产品易于被用户学习、理解、使用,而且外观好看,可以分为5个子属性: ①易理解性:产品的操作方式很容易理解,不需要专门学习也能正确使用。 ②易学性:用户可以很轻易地学习产品的使用。具体可以体现为:提供说明书、社区等学习资料。界面设计贴近用户常用的设备,方便用户快速上手。 ③易操作性:易于操作。如计算器,对输入做了合法性限制,选择二进制的时候,界面只有0和1可以被选择,减少了用户的无效操作。 ④吸引性:界面美观。 ⑤易用性的依从性:遵循相关标准、约定。如电脑上的计算器面板设计得很像实体计算器就是一个例证。

效率是指相对于使用资源的数量,软件产品可以提供适当的性能的能力,可以被分为3个子属性: ①时间特性:得到正确结果的响应时间。 ②资源利用率:对系统资源的占用率。 ③效率依从性:遵循相关标准、约定。如在某种情况下对系统资源的占用不能超过多少。

可维护性是指软件产品可被修改的能力,既可以被纠正、改进,也能够适应环境、功能规格变化,可分为5个子属性: ①可分析性:如果发生异常,异常信息是能够被捕捉和记录的,并且,对于开发人员来说,这些信息是足够的、有效的,能够用于定位、复现并解决这个问题。 ②可修改性:在用户处发现的产品缺陷可以被修复,并可以通过产品升级来修复用户处的产品缺陷。 ③稳定性:版本更新后,不会因为修改而引入新的问题,依然能够稳定工作。 ④可测试性:所有改动都是可以被验证的,可以确认它们是否正确、符合预期。 ⑤可维护性的依从性:

可移植性是指软件产品从一种环境迁移到另一种环境的能力,这里的环境可以理解为硬件、软件或组织等不同的环境,可分为5个子属性: ①适应性:能够适应不同设备。例如,换用不同大小的显示屏,软件产品都可以正常地显示。 ②可安装性:产品能被顺利安装到不同操作系统上,并能够正常运行。 ③共存性:软件产品与卡软件能在系统中共存,不会互相争抢资源。 ④易替换性:产品的新版本可以成功替换老版本,并能够兼容老版本的数据信息。注意:这里指的是可能同时存在新老版本的情形。 ⑤可移植性的依从性:产品能够遵守系统在可移植性方面的一些约定。

2 测试类型

测试类型是测试需要考虑的不同角度,包含:功能测试、性能测试、压力测试、兼容性测试、易用性测试、可靠性测试等。测试类型解决的问题是测试要从那些角度去分析和测试产品。 作为软件测试架构师,需要保证测试组员对众多测试概念的理解一致。清楚理解这些概念并不是一件容易的事,因此可以借助质量模型来快速定义和理解测试类型。例如,易用性是产品被用户理解、学习、使用和吸引用户的能力;与此对应的,易用性测试就可以定义为,验证用户在指定条件下使用软件产品时,品被用户理解、学习、使用和吸引用户的能力。 下表总结了一些常见测试类型,以及这些测试类型和质量属性指教的对应关系。

名称说明对应的质量属性
功能测试 验证产品能否满足用户特定功能要求并做出正确响应 功能性
安全性测试 验证产品是否有保护数据的能力,并能在合适的范围内承受恶意攻击 功能性
兼容性测试 验证产品是否能够和其他相关产品顺利对接 功能性
配置测试 验证产品是否能够在推荐配置上流畅运行;验证产品为了完成特定功能的输入是否会出现故障 功能性,易用性
可靠性测试 验证产品在长时间运行下能否满足保证系统的性能水平;在存在异常的情况下系统是否依然可靠 可靠性
易用性测试 验证产品是否易于理解、易于学习和易于操作 易用性
性能测试 测试产品提供某项功能时的时间和资源使用情况 效率
安装测试 测试产品能否被正确安装并运行 可移植性

使用这个方法还有一项额外收获:我们既可以以质量属性为参照标准来避免测试类型的遗漏,也可以据此来评审测试点或测试用例的设计是否全面。

3 测试方法

功能测试方法

一些通用的功能测试方法列举如下:

  • 单运行正常值输入法
  • 单运行值边界输入法
  • 多运行顺序执行法
  • 多运行相互作用法

从功能的层面来说,一个“运行”确定了“输入”和“输出”的一种可能的情况。 不能为用户提供一个完整的、有意义的行为的功能,即使是确定了输入和输出,也不能算作“运行”。这时,可以将多个功能组合起来,直到这个功能能为用户能为用户提供完整的、有意义的行为为止。下图描绘了在这种情况下,功能与运行的关系。

#mermaid-svg-0PFHx6QQmlm8Hjth{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-0PFHx6QQmlm8Hjth .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-0PFHx6QQmlm8Hjth .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-0PFHx6QQmlm8Hjth .error-icon{fill:#552222;}#mermaid-svg-0PFHx6QQmlm8Hjth .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-0PFHx6QQmlm8Hjth .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-0PFHx6QQmlm8Hjth .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-0PFHx6QQmlm8Hjth .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-0PFHx6QQmlm8Hjth .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-0PFHx6QQmlm8Hjth .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-0PFHx6QQmlm8Hjth .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-0PFHx6QQmlm8Hjth .marker{fill:#333333;stroke:#333333;}#mermaid-svg-0PFHx6QQmlm8Hjth .marker.cross{stroke:#333333;}#mermaid-svg-0PFHx6QQmlm8Hjth svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-0PFHx6QQmlm8Hjth p{margin:0;}#mermaid-svg-0PFHx6QQmlm8Hjth .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-0PFHx6QQmlm8Hjth .cluster-label text{fill:#333;}#mermaid-svg-0PFHx6QQmlm8Hjth .cluster-label span{color:#333;}#mermaid-svg-0PFHx6QQmlm8Hjth .cluster-label span p{background-color:transparent;}#mermaid-svg-0PFHx6QQmlm8Hjth .label text,#mermaid-svg-0PFHx6QQmlm8Hjth span{fill:#333;color:#333;}#mermaid-svg-0PFHx6QQmlm8Hjth .node rect,#mermaid-svg-0PFHx6QQmlm8Hjth .node circle,#mermaid-svg-0PFHx6QQmlm8Hjth .node ellipse,#mermaid-svg-0PFHx6QQmlm8Hjth .node polygon,#mermaid-svg-0PFHx6QQmlm8Hjth .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-0PFHx6QQmlm8Hjth .rough-node .label text,#mermaid-svg-0PFHx6QQmlm8Hjth .node .label text,#mermaid-svg-0PFHx6QQmlm8Hjth .image-shape .label,#mermaid-svg-0PFHx6QQmlm8Hjth .icon-shape .label{text-anchor:middle;}#mermaid-svg-0PFHx6QQmlm8Hjth .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-0PFHx6QQmlm8Hjth .rough-node .label,#mermaid-svg-0PFHx6QQmlm8Hjth .node .label,#mermaid-svg-0PFHx6QQmlm8Hjth .image-shape .label,#mermaid-svg-0PFHx6QQmlm8Hjth .icon-shape .label{text-align:center;}#mermaid-svg-0PFHx6QQmlm8Hjth .node.clickable{cursor:pointer;}#mermaid-svg-0PFHx6QQmlm8Hjth .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-0PFHx6QQmlm8Hjth .arrowheadPath{fill:#333333;}#mermaid-svg-0PFHx6QQmlm8Hjth .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-0PFHx6QQmlm8Hjth .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-0PFHx6QQmlm8Hjth .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-0PFHx6QQmlm8Hjth .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-0PFHx6QQmlm8Hjth .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-0PFHx6QQmlm8Hjth .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-0PFHx6QQmlm8Hjth .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-0PFHx6QQmlm8Hjth .cluster text{fill:#333;}#mermaid-svg-0PFHx6QQmlm8Hjth .cluster span{color:#333;}#mermaid-svg-0PFHx6QQmlm8Hjth div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-0PFHx6QQmlm8Hjth .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-0PFHx6QQmlm8Hjth rect.text{fill:none;stroke-width:0;}#mermaid-svg-0PFHx6QQmlm8Hjth .icon-shape,#mermaid-svg-0PFHx6QQmlm8Hjth .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-0PFHx6QQmlm8Hjth .icon-shape p,#mermaid-svg-0PFHx6QQmlm8Hjth .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-0PFHx6QQmlm8Hjth .icon-shape .label rect,#mermaid-svg-0PFHx6QQmlm8Hjth .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-0PFHx6QQmlm8Hjth .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-0PFHx6QQmlm8Hjth .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-0PFHx6QQmlm8Hjth :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

A1

B1

C1

A2

B2

C2

输入

功能1

功能2

输出

输入

功能1

功能2

输出

图1:功能与运行的关系

其中,“单运行操作1”的输入是A1、B1,输出为C1;“单运行操作2”的输入是A2、B2,输出为C2,它们都涉及了功能1、功能2。

#mermaid-svg-NsXr9r7sXR1ySieH{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-NsXr9r7sXR1ySieH .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-NsXr9r7sXR1ySieH .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-NsXr9r7sXR1ySieH .error-icon{fill:#552222;}#mermaid-svg-NsXr9r7sXR1ySieH .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-NsXr9r7sXR1ySieH .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-NsXr9r7sXR1ySieH .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-NsXr9r7sXR1ySieH .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-NsXr9r7sXR1ySieH .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-NsXr9r7sXR1ySieH .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-NsXr9r7sXR1ySieH .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-NsXr9r7sXR1ySieH .marker{fill:#333333;stroke:#333333;}#mermaid-svg-NsXr9r7sXR1ySieH .marker.cross{stroke:#333333;}#mermaid-svg-NsXr9r7sXR1ySieH svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-NsXr9r7sXR1ySieH p{margin:0;}#mermaid-svg-NsXr9r7sXR1ySieH .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-NsXr9r7sXR1ySieH .cluster-label text{fill:#333;}#mermaid-svg-NsXr9r7sXR1ySieH .cluster-label span{color:#333;}#mermaid-svg-NsXr9r7sXR1ySieH .cluster-label span p{background-color:transparent;}#mermaid-svg-NsXr9r7sXR1ySieH .label text,#mermaid-svg-NsXr9r7sXR1ySieH span{fill:#333;color:#333;}#mermaid-svg-NsXr9r7sXR1ySieH .node rect,#mermaid-svg-NsXr9r7sXR1ySieH .node circle,#mermaid-svg-NsXr9r7sXR1ySieH .node ellipse,#mermaid-svg-NsXr9r7sXR1ySieH .node polygon,#mermaid-svg-NsXr9r7sXR1ySieH .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-NsXr9r7sXR1ySieH .rough-node .label text,#mermaid-svg-NsXr9r7sXR1ySieH .node .label text,#mermaid-svg-NsXr9r7sXR1ySieH .image-shape .label,#mermaid-svg-NsXr9r7sXR1ySieH .icon-shape .label{text-anchor:middle;}#mermaid-svg-NsXr9r7sXR1ySieH .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-NsXr9r7sXR1ySieH .rough-node .label,#mermaid-svg-NsXr9r7sXR1ySieH .node .label,#mermaid-svg-NsXr9r7sXR1ySieH .image-shape .label,#mermaid-svg-NsXr9r7sXR1ySieH .icon-shape .label{text-align:center;}#mermaid-svg-NsXr9r7sXR1ySieH .node.clickable{cursor:pointer;}#mermaid-svg-NsXr9r7sXR1ySieH .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-NsXr9r7sXR1ySieH .arrowheadPath{fill:#333333;}#mermaid-svg-NsXr9r7sXR1ySieH .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-NsXr9r7sXR1ySieH .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-NsXr9r7sXR1ySieH .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-NsXr9r7sXR1ySieH .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-NsXr9r7sXR1ySieH .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-NsXr9r7sXR1ySieH .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-NsXr9r7sXR1ySieH .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-NsXr9r7sXR1ySieH .cluster text{fill:#333;}#mermaid-svg-NsXr9r7sXR1ySieH .cluster span{color:#333;}#mermaid-svg-NsXr9r7sXR1ySieH div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-NsXr9r7sXR1ySieH .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-NsXr9r7sXR1ySieH rect.text{fill:none;stroke-width:0;}#mermaid-svg-NsXr9r7sXR1ySieH .icon-shape,#mermaid-svg-NsXr9r7sXR1ySieH .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-NsXr9r7sXR1ySieH .icon-shape p,#mermaid-svg-NsXr9r7sXR1ySieH .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-NsXr9r7sXR1ySieH .icon-shape .label rect,#mermaid-svg-NsXr9r7sXR1ySieH .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-NsXr9r7sXR1ySieH .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-NsXr9r7sXR1ySieH .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-NsXr9r7sXR1ySieH :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

运行1

运行2

运行3

图2:多运行操作示意图

将多个单运行放在一起考虑,得到的结果就是多运行操作,上图展示了一个多运行的操作示意图。

单运行正常值输入法是指测试时的输入都是系统允许的“正常值”时的测试方法。对于图1来说,即测试时输入的A1和A2均为正常值的测试方法。 对一个功能的输入值来说,系统允许输入的正常值的个数可能是有限的,如邮件的优先级;也有可能是无限的,如收件人的邮箱名。 对于输入个数有限的情形,遍历这些取值。 对于输入个数无限的情形,用“等价类”的思想将输入值分类,然后在每一类中选取一些测试值来进行测试,变无限为有限。

对于图1来说,即测试时输入的A1和A2均为系统的“边界值”的测试方法。 相较于单运行正常值输入法,单运行边界值输入法包含了“正常输入”和“非法输入”,既能测试到正常处理,又能测试到非正常处理。例如,系统允许的输入值是[1, 10],这时0、1、10、11就是边界值。

多运行顺序执行法是指在功能测试时按照一定顺序来进行多个运行操作的测试方法。

#mermaid-svg-LpZ9gDf6Ya5hMI5F{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .error-icon{fill:#552222;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .marker{fill:#333333;stroke:#333333;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .marker.cross{stroke:#333333;}#mermaid-svg-LpZ9gDf6Ya5hMI5F svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-LpZ9gDf6Ya5hMI5F p{margin:0;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .cluster-label text{fill:#333;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .cluster-label span{color:#333;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .cluster-label span p{background-color:transparent;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .label text,#mermaid-svg-LpZ9gDf6Ya5hMI5F span{fill:#333;color:#333;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .node rect,#mermaid-svg-LpZ9gDf6Ya5hMI5F .node circle,#mermaid-svg-LpZ9gDf6Ya5hMI5F .node ellipse,#mermaid-svg-LpZ9gDf6Ya5hMI5F .node polygon,#mermaid-svg-LpZ9gDf6Ya5hMI5F .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .rough-node .label text,#mermaid-svg-LpZ9gDf6Ya5hMI5F .node .label text,#mermaid-svg-LpZ9gDf6Ya5hMI5F .image-shape .label,#mermaid-svg-LpZ9gDf6Ya5hMI5F .icon-shape .label{text-anchor:middle;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .rough-node .label,#mermaid-svg-LpZ9gDf6Ya5hMI5F .node .label,#mermaid-svg-LpZ9gDf6Ya5hMI5F .image-shape .label,#mermaid-svg-LpZ9gDf6Ya5hMI5F .icon-shape .label{text-align:center;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .node.clickable{cursor:pointer;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .arrowheadPath{fill:#333333;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-LpZ9gDf6Ya5hMI5F .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-LpZ9gDf6Ya5hMI5F .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-LpZ9gDf6Ya5hMI5F .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .cluster text{fill:#333;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .cluster span{color:#333;}#mermaid-svg-LpZ9gDf6Ya5hMI5F div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-LpZ9gDf6Ya5hMI5F rect.text{fill:none;stroke-width:0;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .icon-shape,#mermaid-svg-LpZ9gDf6Ya5hMI5F .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .icon-shape p,#mermaid-svg-LpZ9gDf6Ya5hMI5F .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .icon-shape .label rect,#mermaid-svg-LpZ9gDf6Ya5hMI5F .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-LpZ9gDf6Ya5hMI5F .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-LpZ9gDf6Ya5hMI5F .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-LpZ9gDf6Ya5hMI5F :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

用户登录

选择商品

提交订单

选择商品

用户登录

提交订单

选择商品

提交订单

用户登录

图3:操作顺序示意图

多运行顺序执行法在和用户的操作习惯相关的地方使用非常有效,图3为一个示例。此外,多运行顺序执行法也适于功能的配置测试上。

多运行相互作用法是指在功能测试时把多个存在相互关系的运行组合在一起测试的方法,强调的是多个运行之间的关系性。这个关系可以是内在关系,如使用到相同的资源;也可以是外在关系,如某业务的顺利进行需要各个运行之间相互协作。

可靠性测试方法

可靠性测试的是产品在各种调节下维持规定的性能级别的能力。需要注意的是,可靠性测试顺利执行的前提是基本功能正确,这对我们在测试策略中安排这些测试方法的顺序提出了要求。 可靠性测试方法包括:

  • 异常值输入法
  • 故障植入法
  • 稳定性测试法
  • 压力测试法
  • 恢复测试法

使用系统不允许用户输入的数值(异常值)作为测试输入。 上文中“单运行值边界输入法”中的非法输入值也可以归于此类。不同之处在于,单运行值边界输入法侧重于测试“功能”能否达成,而这里侧重于测试功能是否可靠。 异常值输入法可以测试系统的容错性,能够测试到系统处理各种错误输入的能力。

把系统放在有问题的环境中进行测试。主要能够测试到的质量属性是容错性和成熟性。这种方法与异常值输入法的不同在于,异常值输入法采用系统不支持的值作为输入;而故障植入法的输入依然是正常值,但是系统处于异常的环境。 故障植入可以从以下方面着手分析:

  • 用户的业务环境中会有哪些故障、错误、问题?把系统放在这些环境中运行正常业务,分析响应是否合理。
  • 系统所需要的硬件资源不足时,系统的反应是否合理?
  • 系统在软件冲突、驱动不正确的情况下,系统的反应是否合理?
  • 系统的关键器件出现问题时,系统的反应是否合理?

在一段时间里,长时间大容量地运行某种业务。能够非常有效地测试到系统的“成熟性”。

#mermaid-svg-4bbqD1mhKOP1aJAO{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-4bbqD1mhKOP1aJAO .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-4bbqD1mhKOP1aJAO .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-4bbqD1mhKOP1aJAO .error-icon{fill:#552222;}#mermaid-svg-4bbqD1mhKOP1aJAO .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-4bbqD1mhKOP1aJAO .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-4bbqD1mhKOP1aJAO .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-4bbqD1mhKOP1aJAO .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-4bbqD1mhKOP1aJAO .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-4bbqD1mhKOP1aJAO .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-4bbqD1mhKOP1aJAO .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-4bbqD1mhKOP1aJAO .marker{fill:#333333;stroke:#333333;}#mermaid-svg-4bbqD1mhKOP1aJAO .marker.cross{stroke:#333333;}#mermaid-svg-4bbqD1mhKOP1aJAO svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-4bbqD1mhKOP1aJAO p{margin:0;}#mermaid-svg-4bbqD1mhKOP1aJAO .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-4bbqD1mhKOP1aJAO .cluster-label text{fill:#333;}#mermaid-svg-4bbqD1mhKOP1aJAO .cluster-label span{color:#333;}#mermaid-svg-4bbqD1mhKOP1aJAO .cluster-label span p{background-color:transparent;}#mermaid-svg-4bbqD1mhKOP1aJAO .label text,#mermaid-svg-4bbqD1mhKOP1aJAO span{fill:#333;color:#333;}#mermaid-svg-4bbqD1mhKOP1aJAO .node rect,#mermaid-svg-4bbqD1mhKOP1aJAO .node circle,#mermaid-svg-4bbqD1mhKOP1aJAO .node ellipse,#mermaid-svg-4bbqD1mhKOP1aJAO .node polygon,#mermaid-svg-4bbqD1mhKOP1aJAO .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-4bbqD1mhKOP1aJAO .rough-node .label text,#mermaid-svg-4bbqD1mhKOP1aJAO .node .label text,#mermaid-svg-4bbqD1mhKOP1aJAO .image-shape .label,#mermaid-svg-4bbqD1mhKOP1aJAO .icon-shape .label{text-anchor:middle;}#mermaid-svg-4bbqD1mhKOP1aJAO .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-4bbqD1mhKOP1aJAO .rough-node .label,#mermaid-svg-4bbqD1mhKOP1aJAO .node .label,#mermaid-svg-4bbqD1mhKOP1aJAO .image-shape .label,#mermaid-svg-4bbqD1mhKOP1aJAO .icon-shape .label{text-align:center;}#mermaid-svg-4bbqD1mhKOP1aJAO .node.clickable{cursor:pointer;}#mermaid-svg-4bbqD1mhKOP1aJAO .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-4bbqD1mhKOP1aJAO .arrowheadPath{fill:#333333;}#mermaid-svg-4bbqD1mhKOP1aJAO .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-4bbqD1mhKOP1aJAO .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-4bbqD1mhKOP1aJAO .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-4bbqD1mhKOP1aJAO .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-4bbqD1mhKOP1aJAO .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-4bbqD1mhKOP1aJAO .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-4bbqD1mhKOP1aJAO .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-4bbqD1mhKOP1aJAO .cluster text{fill:#333;}#mermaid-svg-4bbqD1mhKOP1aJAO .cluster span{color:#333;}#mermaid-svg-4bbqD1mhKOP1aJAO div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-4bbqD1mhKOP1aJAO .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-4bbqD1mhKOP1aJAO rect.text{fill:none;stroke-width:0;}#mermaid-svg-4bbqD1mhKOP1aJAO .icon-shape,#mermaid-svg-4bbqD1mhKOP1aJAO .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-4bbqD1mhKOP1aJAO .icon-shape p,#mermaid-svg-4bbqD1mhKOP1aJAO .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-4bbqD1mhKOP1aJAO .icon-shape .label rect,#mermaid-svg-4bbqD1mhKOP1aJAO .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-4bbqD1mhKOP1aJAO .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-4bbqD1mhKOP1aJAO .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-4bbqD1mhKOP1aJAO :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

验证

条件

条件

产品规格测试

性能测试

稳定性测试

压力测试

产品规格是否符合说明书承诺

低于性能值的前提下运行测试

高于性能值的前提下运行测试

图4:区别三种以产品规格为纽带的测试方法

上图中展示了稳定性测试与以产品规格为纽带的其他测试方法间的不同。其中,性能测试实测出来的性能值,就是系统真正能够处理的最大容量或能力;稳定性测试在低于性能值的前提下测试,我们可以控制测试中的负载量,使其和用户的实际使用情况尽量接近,这样测试也会更为准确和有价值;压力测试是在高于性能值的前提下进行测试的,虽然负载超过了系统能力,但不代表此时系统的功能都会失效,我们需要根据实际情况分析系统的表现是否合理。 稳定性测试的测试方法可以总结为一个“四字诀”——多、并、复、异。

  • 多:增加用户对功能的操作数量。
  • 并:让多个用户同时操作这个功能。
  • 复:让用户反复进行操作。
  • 异:让用户反复进行异常操作。

压力测试法是在一段时间内持续使用超过系统规格的负载进行测试的一种可靠性测试方法。 尽管产品已声明规格,但压力测试法仍有其意义,一个重要原因是:用户的业务负载并不是平均的,可能在极短的时间内,出现超过负载的情况;但是平均下来,却没有超过规格。 我们希望系统在突发情况下,有切实的应对措施,不会因突发情况导致死机、反复重启等致命问题。 为了达到这个测试目标,我们可以使用突发形态的负载模型,而不是持续超过规格的负载量(系统可能无法保证所有在规格值之内的业务都被处理,只要超出规格足够多,系统一定会被“打死”)。

压力测试法是指使用持续超过规格的负载进行了测试后,再将负载降到规格以内的测试方法。 “加强版”:周期性地执行上面的负载。以电子邮件为例,系统最多能支持1000个用户同时发送电子邮件。设置负载如下来进行恢复测试:以每60分钟为一个周期,在一个周期里,前30分钟为1400给用户同时发送电子邮件,后30分钟为600个用户同时发送电子邮件,持续测试1天。

#mermaid-svg-xeWvHfRZ16Rs6lqC{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-xeWvHfRZ16Rs6lqC .error-icon{fill:#552222;}#mermaid-svg-xeWvHfRZ16Rs6lqC .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-xeWvHfRZ16Rs6lqC .marker{fill:#333333;stroke:#333333;}#mermaid-svg-xeWvHfRZ16Rs6lqC .marker.cross{stroke:#333333;}#mermaid-svg-xeWvHfRZ16Rs6lqC svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-xeWvHfRZ16Rs6lqC p{margin:0;}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge{stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section–1 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section–1 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section–1 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section–1 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section–1 path{fill:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section–1 text{fill:#ffffff;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon–1{font-size:40px;color:#ffffff;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge–1{stroke:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth–1{stroke-width:17;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section–1 line{stroke:hsl(60, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-0 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-0 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-0 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-0 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-0 path{fill:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-0 text{fill:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon-0{font-size:40px;color:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge-0{stroke:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth-0{stroke-width:14;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-0 line{stroke:hsl(240, 100%, 83.5294117647%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-1 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-1 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-1 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-1 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-1 path{fill:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-1 text{fill:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon-1{font-size:40px;color:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge-1{stroke:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth-1{stroke-width:11;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-1 line{stroke:hsl(260, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-2 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-2 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-2 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-2 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-2 path{fill:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-2 text{fill:#ffffff;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon-2{font-size:40px;color:#ffffff;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge-2{stroke:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth-2{stroke-width:8;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-2 line{stroke:hsl(90, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-3 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-3 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-3 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-3 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-3 path{fill:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-3 text{fill:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon-3{font-size:40px;color:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge-3{stroke:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth-3{stroke-width:5;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-3 line{stroke:hsl(120, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-4 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-4 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-4 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-4 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-4 path{fill:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-4 text{fill:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon-4{font-size:40px;color:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge-4{stroke:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth-4{stroke-width:2;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-4 line{stroke:hsl(150, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-5 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-5 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-5 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-5 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-5 path{fill:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-5 text{fill:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon-5{font-size:40px;color:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge-5{stroke:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth-5{stroke-width:-1;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-5 line{stroke:hsl(180, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-6 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-6 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-6 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-6 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-6 path{fill:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-6 text{fill:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon-6{font-size:40px;color:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge-6{stroke:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth-6{stroke-width:-4;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-6 line{stroke:hsl(210, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-7 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-7 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-7 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-7 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-7 path{fill:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-7 text{fill:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon-7{font-size:40px;color:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge-7{stroke:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth-7{stroke-width:-7;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-7 line{stroke:hsl(270, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-8 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-8 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-8 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-8 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-8 path{fill:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-8 text{fill:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon-8{font-size:40px;color:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge-8{stroke:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth-8{stroke-width:-10;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-8 line{stroke:hsl(330, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-9 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-9 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-9 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-9 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-9 path{fill:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-9 text{fill:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon-9{font-size:40px;color:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge-9{stroke:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth-9{stroke-width:-13;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-9 line{stroke:hsl(0, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-10 rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-10 path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-10 circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-10 polygon,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-10 path{fill:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-10 text{fill:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .node-icon-10{font-size:40px;color:black;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-edge-10{stroke:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge-depth-10{stroke-width:-16;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-10 line{stroke:hsl(30, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:lightgray;}#mermaid-svg-xeWvHfRZ16Rs6lqC .disabled text{fill:#efefef;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-root rect,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-root path,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-root circle,#mermaid-svg-xeWvHfRZ16Rs6lqC .section-root polygon{fill:hsl(240, 100%, 46.2745098039%);}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-root text{fill:#ffffff;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-root span{color:#ffffff;}#mermaid-svg-xeWvHfRZ16Rs6lqC .section-2 span{color:#ffffff;}#mermaid-svg-xeWvHfRZ16Rs6lqC .icon-container{height:100%;display:flex;justify-content:center;align-items:center;}#mermaid-svg-xeWvHfRZ16Rs6lqC .edge{fill:none;}#mermaid-svg-xeWvHfRZ16Rs6lqC .mindmap-node-label{dy:1em;alignment-baseline:middle;text-anchor:middle;dominant-baseline:middle;text-align:center;}#mermaid-svg-xeWvHfRZ16Rs6lqC :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

可靠性测试方法

压力测试法

超过规格时

规格内的负载

不允许业务失败

超过规格的负载

允许业务失败

在规格内时

规格内的负载

不允许业务失败

恢复测试法

超过规格时

规格内的负载

允许业务失败

超过规格的负载

允许业务失败

在规格内时

规格内的负载

不允许业务失败

图5:两种测试方法在不同负载下的对比

性能测试方法

测试性能的目的是测试产品真实规格是否和承诺的需求规格一致。我们实测出来的性能值,就是系统真正能够处理的最大容量或者能力。

#mermaid-svg-aTiGoU9ZjqXA916H{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-aTiGoU9ZjqXA916H .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-aTiGoU9ZjqXA916H .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-aTiGoU9ZjqXA916H .error-icon{fill:#552222;}#mermaid-svg-aTiGoU9ZjqXA916H .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-aTiGoU9ZjqXA916H .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-aTiGoU9ZjqXA916H .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-aTiGoU9ZjqXA916H .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-aTiGoU9ZjqXA916H .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-aTiGoU9ZjqXA916H .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-aTiGoU9ZjqXA916H .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-aTiGoU9ZjqXA916H .marker{fill:#333333;stroke:#333333;}#mermaid-svg-aTiGoU9ZjqXA916H .marker.cross{stroke:#333333;}#mermaid-svg-aTiGoU9ZjqXA916H svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-aTiGoU9ZjqXA916H p{margin:0;}#mermaid-svg-aTiGoU9ZjqXA916H .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-aTiGoU9ZjqXA916H .cluster-label text{fill:#333;}#mermaid-svg-aTiGoU9ZjqXA916H .cluster-label span{color:#333;}#mermaid-svg-aTiGoU9ZjqXA916H .cluster-label span p{background-color:transparent;}#mermaid-svg-aTiGoU9ZjqXA916H .label text,#mermaid-svg-aTiGoU9ZjqXA916H span{fill:#333;color:#333;}#mermaid-svg-aTiGoU9ZjqXA916H .node rect,#mermaid-svg-aTiGoU9ZjqXA916H .node circle,#mermaid-svg-aTiGoU9ZjqXA916H .node ellipse,#mermaid-svg-aTiGoU9ZjqXA916H .node polygon,#mermaid-svg-aTiGoU9ZjqXA916H .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-aTiGoU9ZjqXA916H .rough-node .label text,#mermaid-svg-aTiGoU9ZjqXA916H .node .label text,#mermaid-svg-aTiGoU9ZjqXA916H .image-shape .label,#mermaid-svg-aTiGoU9ZjqXA916H .icon-shape .label{text-anchor:middle;}#mermaid-svg-aTiGoU9ZjqXA916H .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-aTiGoU9ZjqXA916H .rough-node .label,#mermaid-svg-aTiGoU9ZjqXA916H .node .label,#mermaid-svg-aTiGoU9ZjqXA916H .image-shape .label,#mermaid-svg-aTiGoU9ZjqXA916H .icon-shape .label{text-align:center;}#mermaid-svg-aTiGoU9ZjqXA916H .node.clickable{cursor:pointer;}#mermaid-svg-aTiGoU9ZjqXA916H .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-aTiGoU9ZjqXA916H .arrowheadPath{fill:#333333;}#mermaid-svg-aTiGoU9ZjqXA916H .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-aTiGoU9ZjqXA916H .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-aTiGoU9ZjqXA916H .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-aTiGoU9ZjqXA916H .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-aTiGoU9ZjqXA916H .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-aTiGoU9ZjqXA916H .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-aTiGoU9ZjqXA916H .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-aTiGoU9ZjqXA916H .cluster text{fill:#333;}#mermaid-svg-aTiGoU9ZjqXA916H .cluster span{color:#333;}#mermaid-svg-aTiGoU9ZjqXA916H div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-aTiGoU9ZjqXA916H .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-aTiGoU9ZjqXA916H rect.text{fill:none;stroke-width:0;}#mermaid-svg-aTiGoU9ZjqXA916H .icon-shape,#mermaid-svg-aTiGoU9ZjqXA916H .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-aTiGoU9ZjqXA916H .icon-shape p,#mermaid-svg-aTiGoU9ZjqXA916H .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-aTiGoU9ZjqXA916H .icon-shape .label rect,#mermaid-svg-aTiGoU9ZjqXA916H .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-aTiGoU9ZjqXA916H .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-aTiGoU9ZjqXA916H .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-aTiGoU9ZjqXA916H :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}

测试出系统最好的性能值

分析会影响性能的因素,测试它对性能的影响(包括最坏的情况)

以场景为单位,测试每个场景下的性能

图6:性能测试流程

在性能测试中,测试者除了确认性能规格是否满足产品的需求规格中给出的性能期望值外,还希望能发现产品的性能“瓶颈”,并评估产品在用户使用环境中的性能表现。测试流程如上图6所示。

进行测试时,可以以性能规格中要求的性能值作为测试的项目,测试出这些指标的极限。 总的来说,产品的业务规格可以分为两类:

  • 新建:系统能够正确处理新业务的最大能力。测试的是系统为一个新业务从分配资源到完成处理流程的速度。业务处理流程和资源的总量都会影响新建能力。需要注意的是,系统不能只“建”不“拆”,且拆除业务的速度应比新建快,至少也要能与新建持平。
  • 并发:系统能够同时正确处理的最大业务能力。

在这个步骤中,我们要分析出系统中的那些因素对性能有影响(性能下降)然后进行测试,分析性能下降是否符合预期,最坏的情况是否合理。 例如,在邮件发送系统中,系统接收1Byte和1MB大小的邮件的性能值应该是不同的;配置了1条用户策略和1000条用户策略的性能应该是不同的。 通过测试这些性能值,我们可以得到:

  • 哪些因素对系统性能影响较大,哪些影响较小
  • 各个因素对性能的影响趋势
  • 各个因素下的性能最坏值,以及是否会成为“瓶颈”

以场景为单位,来测试这个场景中的典型配置、典型业务下的性能值。 例如,在邮件发送系统中,典型的配置为200条过滤策略,邮件大小为1KB、10KB、2MB以1:2:1混合。在这种情形下测试系统每秒能接收、处理的最大邮件数。 以场景为单位进行性能测试,能够很好地评估产品在用户使用环境中的性能表现,对用户更有实际意义。

易用性测试方法

易用性测试方法测试的是用户在理解、使用产品时的能力。 易用性带有很强的主观性,因此在问题确认上常出现分歧。因此,确定一些客观的测试验收标准,保证必要投入(易用性测试的投入、问题修改的投入)是很必要的。

一致性测试法测试的对象是用户界面(User Interface,UI),不关心产品功能是否正确,关注:

  • 风格、布局、元素是否一致、统一
  • 布局、操作的合理性,提示是否符合UI设计规范

一致性测试法的具体方法是:

  • 进入一个用户界面,确认这个页面和产品的整体风格是否相符。
  • 确认页面图标是否来自产品图标库,风格是否统一。
  • 确认页面的元素是否符合产品UI设计规范,是否统一。
  • 确认页面布局是否符合设计规范。
  • 确认页面在操作合理性上是否符合设计规范。
  • 确认页面在提示方面是否符合规范,如确认输入、错误提示等。
  • 重复上述步骤,遍历所有页面。
  • 实际操作时,测试人员很难一下熟悉所有的规范,比较有效的方法是“抽测”一部分,抽测范围可以是随机,也可以根据缺陷分析来确定。测试时可以对需要测试的设计规范指定简明的checklist(清查表)。

    可用性测试法测试的对象也是UI,但关注的是产品提供的功能对用户来说是否易于学习理解、使用。所有可用性测试需要和功能测试结合起来,以场景作为测试粒度,以用户的视角进行测试。

    序号关注点标准
    1 测试者完成这个场景所有的配置,并确认成功需要花费的时间 < 30分钟
    2 测试者完成这个场景,一共配置了多少个步骤 不能超过10个步骤
    3 测试者完成这个场景,一共跳转了多少个配置页面,或者视图 不能超过5个页面(或10个视图)
    4 测试者完成这个场景,一共求助了几次?能否很容易地通过产品提供的资料解决问题 求助不超过5次,产品提供的资料能够解决用户针对这个场景配置的所有问题

    上表给出了一个可用性测试的关注点和标准的示例。

    4 下篇概览

    测试设计技术、探索式测试、自动化测试。发出来以后会在这里贴链接。

    赞(0)
    未经允许不得转载:171主机测评 » 【阅读笔记】软件测试架构师的知识能力模型(上)
    分享到: 更多 (0)

    评论 抢沙发

    • 昵称 (必填)
    • 邮箱 (必填)
    • 网址