{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/software-testing-fundamentals/",
  "atlas": "https://www.pystone.net/?node=software-testing-fundamentals#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/software-testing-fundamentals.md",
  "context": "https://www.pystone.net/notes/software-testing-fundamentals.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:software-testing-fundamentals",
  "slug": "software-testing-fundamentals",
  "title": "软件测试",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "软件测试",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "3134d529d1111f85ec844212f8a1798e62bc1694a7697d3ca40810ba217b6ade",
  "assets": [
    {
      "reference": "assets/1603181708253.png",
      "url": "/media/d4048b84167fd09af31b.png",
      "mediaType": "image/png",
      "contentHash": "d4048b84167fd09af31ba9298fc6c49710d498cd97604ad8d4ab6150835d7536",
      "byteLength": 71658,
      "width": 1286,
      "height": 542
    },
    {
      "reference": "assets/1603181826574.png",
      "url": "/media/e55209f6e510ceb73c46.png",
      "mediaType": "image/png",
      "contentHash": "e55209f6e510ceb73c464145b62c9301013d2366582cbd262cc068997d26a70a",
      "byteLength": 105015,
      "width": 1156,
      "height": 990
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "软件测试",
      "anchor": "软件测试",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E8%BD%AF%E4%BB%B6%E6%B5%8B%E8%AF%95"
    },
    {
      "depth": 2,
      "text": "定义",
      "anchor": "定义",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E5%AE%9A%E4%B9%89"
    },
    {
      "depth": 2,
      "text": "其他基础知识",
      "anchor": "其他基础知识",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E5%85%B6%E4%BB%96%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86"
    },
    {
      "depth": 3,
      "text": "软件开发模型",
      "anchor": "软件开发模型",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E6%A8%A1%E5%9E%8B"
    },
    {
      "depth": 2,
      "text": "软件测试分类",
      "anchor": "软件测试分类",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E8%BD%AF%E4%BB%B6%E6%B5%8B%E8%AF%95%E5%88%86%E7%B1%BB"
    },
    {
      "depth": 3,
      "text": "按阶段划分",
      "anchor": "按阶段划分",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E6%8C%89%E9%98%B6%E6%AE%B5%E5%88%92%E5%88%86"
    },
    {
      "depth": 4,
      "text": "单元测试(Unit Testing)",
      "anchor": "单元测试unit-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95unit-testing"
    },
    {
      "depth": 4,
      "text": "集成测试(Integration Testing)",
      "anchor": "集成测试integration-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E9%9B%86%E6%88%90%E6%B5%8B%E8%AF%95integration-testing"
    },
    {
      "depth": 4,
      "text": "系统测试(System Testing)",
      "anchor": "系统测试system-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E7%B3%BB%E7%BB%9F%E6%B5%8B%E8%AF%95system-testing"
    },
    {
      "depth": 4,
      "text": "验收测试(Acceptance Testing)",
      "anchor": "验收测试acceptance-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E9%AA%8C%E6%94%B6%E6%B5%8B%E8%AF%95acceptance-testing"
    },
    {
      "depth": 3,
      "text": "按是否查看代码划分",
      "anchor": "按是否查看代码划分",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E6%8C%89%E6%98%AF%E5%90%A6%E6%9F%A5%E7%9C%8B%E4%BB%A3%E7%A0%81%E5%88%92%E5%88%86"
    },
    {
      "depth": 4,
      "text": "黑盒测试(Black-box Testing)",
      "anchor": "黑盒测试black-box-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E9%BB%91%E7%9B%92%E6%B5%8B%E8%AF%95black-box-testing"
    },
    {
      "depth": 4,
      "text": "白盒测试(White-box Testing)",
      "anchor": "白盒测试white-box-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E7%99%BD%E7%9B%92%E6%B5%8B%E8%AF%95white-box-testing"
    },
    {
      "depth": 4,
      "text": "灰盒测试(Gray-Box Testing)",
      "anchor": "灰盒测试gray-box-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E7%81%B0%E7%9B%92%E6%B5%8B%E8%AF%95gray-box-testing"
    },
    {
      "depth": 3,
      "text": "按是否执行程序划分",
      "anchor": "按是否执行程序划分",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E6%8C%89%E6%98%AF%E5%90%A6%E6%89%A7%E8%A1%8C%E7%A8%8B%E5%BA%8F%E5%88%92%E5%88%86"
    },
    {
      "depth": 4,
      "text": "静态测试(Static testing)",
      "anchor": "静态测试static-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E9%9D%99%E6%80%81%E6%B5%8B%E8%AF%95static-testing"
    },
    {
      "depth": 4,
      "text": "动态测试(Dynamic testing)",
      "anchor": "动态测试dynamic-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E5%8A%A8%E6%80%81%E6%B5%8B%E8%AF%95dynamic-testing"
    },
    {
      "depth": 3,
      "text": "按是否查看代码划分",
      "anchor": "按是否查看代码划分-1",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E6%8C%89%E6%98%AF%E5%90%A6%E6%9F%A5%E7%9C%8B%E4%BB%A3%E7%A0%81%E5%88%92%E5%88%86-1"
    },
    {
      "depth": 4,
      "text": "手工测试(Manual testing)",
      "anchor": "手工测试manual-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E6%89%8B%E5%B7%A5%E6%B5%8B%E8%AF%95manual-testing"
    },
    {
      "depth": 4,
      "text": "自动化测试(Automation Testing)",
      "anchor": "自动化测试automation-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95automation-testing"
    },
    {
      "depth": 3,
      "text": "其他具体测试方法",
      "anchor": "其他具体测试方法",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E5%85%B6%E4%BB%96%E5%85%B7%E4%BD%93%E6%B5%8B%E8%AF%95%E6%96%B9%E6%B3%95"
    },
    {
      "depth": 4,
      "text": "冒烟测试(Smoke Testing)",
      "anchor": "冒烟测试smoke-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E5%86%92%E7%83%9F%E6%B5%8B%E8%AF%95smoke-testing"
    },
    {
      "depth": 4,
      "text": "安全测试(Security Testing) //重要",
      "anchor": "安全测试security-testing-重要",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E5%AE%89%E5%85%A8%E6%B5%8B%E8%AF%95security-testing-%E9%87%8D%E8%A6%81"
    },
    {
      "depth": 4,
      "text": "回归测试(Regression Testing)",
      "anchor": "回归测试regression-testing",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%E5%9B%9E%E5%BD%92%E6%B5%8B%E8%AF%95regression-testing"
    },
    {
      "depth": 4,
      "text": "α测试(Alpha Testing) //重要",
      "anchor": "α测试alpha-testing-重要",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%CE%B1%E6%B5%8B%E8%AF%95alpha-testing-%E9%87%8D%E8%A6%81"
    },
    {
      "depth": 4,
      "text": "β测试(Beta Testing) //重要",
      "anchor": "β测试beta-testing-重要",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#%CE%B2%E6%B5%8B%E8%AF%95beta-testing-%E9%87%8D%E8%A6%81"
    },
    {
      "depth": 2,
      "text": "Ref",
      "anchor": "ref",
      "citation": "https://www.pystone.net/notes/software-testing-fundamentals/#ref"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "id": "note:software-engineering-and-quality",
      "title": "软件工程与质量保障",
      "url": "https://www.pystone.net/notes/software-engineering-and-quality/",
      "atlas": "https://www.pystone.net/?node=software-engineering-and-quality#knowledge-atlas",
      "label": "软件工程与质量保障",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "CI-CD与质量保障中的“软件测试”导航项",
      "citation": "https://www.pystone.net/notes/software-engineering-and-quality/#ci-cd%E4%B8%8E%E8%B4%A8%E9%87%8F%E4%BF%9D%E9%9A%9C"
    }
  ],
  "contentMarkdown": "# 软件测试\n\n> 创建时间：2020/10/20 14:26\n\n## 定义\n\n软件测试(Software Testing)，在规定的条件下对程序进行操作，以发现程序错误，衡量软件质量，并对其是否能满足设计要求进行评估的过程。\n\n> IEEE定义：\n>  软件测试是使用人工或自动的手段来运行或测定某个软件系统的过程，其目的在于检验它是否满足规定的需求或弄清预期结果与实际结果之间的差别。\n\n## 其他基础知识\n\n### 软件开发模型\n\nRAD（Rap Application Development，快速应用开发）模型是软件开发过程中的一个重要模型，由于其模型构图形似字母V，所以又称软件测试的V模型，V模型大体可以划分为以下几个不同的阶段步骤：需求分析、概要设计、详细设计、软件编码、单元测试、集成测试、系统测试、验收测试。\n\n## 软件测试分类\n\n![Alt text](assets/1603181708253.png)\n\n![Alt text](assets/1603181826574.png)\n\n### 按阶段划分\n\n#### 单元测试(Unit Testing)\n\n单元测试是对软件组成单元进行测试。其目的是检验软件基本组成单位的正确性。测试的对象是软件设计的最小单位：模块。Findyou又称为模块测试\n\n测试阶段：编码后\n测试对象：最小模块\n测试人员：白盒测试工程师或开发工程师\n测试依据：代码和注释+详细设计文档\n测试方法：白盒测试\n\n测试内容：模块接口测试、局部数据结构测试、路径测试、错误处理测试、边界测试\n\n#### 集成测试(Integration Testing)\n\n集成测试也称联合测试、组装测试，将程序模块采用适当的集成策略组装起来，对系统的接口及集成后的功能进行正确性检测的测试工作。阿旺主要目的是检查软件单位之间的接口是否正确。\n测试阶段：一般单元测试之后进行\n测试对象：模块间的接口\n测试人员：白盒测试工程师或开发工程师\n测试依据：单元测试的模块+概要设计文档\n测试方法：黑盒测试与白盒测试相结合\n测试内容：模块之间数据传输、模块之间功能冲突、模块组装功能正确性、全局数据结构、单模块缺陷对系统的影响\n\n#### 系统测试(System Testing)\n\n将软件系统看成是一个系统的测试。包括对功能、性能以及软件所运行的软硬件环境进行测试。时间大部分在系统测试执行阶段\n测试阶段：集成测试通过之后\n测试对象：整个系统（软、硬件）\n测试人员：黑盒测试工程师\n测试依据：需求规格说明文档\n测试方法：黑盒测试\n测试内容：功能、界面、可靠性、易用性、性能、兼容性、安全性等\n\n#### 验收测试(Acceptance Testing)\n\n验收测试是部署软件之前的最后一个测试操作。它是技术测试的最后一个阶段，也称为交付测试。阿旺总结验收测试的目的是确保软件准备就绪，按照项目合同、任务书、双方约定的验收依据文档，向软件购买都展示该软件系统满足原始需求。\n测试阶段：系统测试通过之后\n测试对象：整个系统（包括软硬件）。\n测试人员：主要是最终用户或者需求方。\n测试依据：用户需求、验收标准\n测试方法：黑盒测试\n测试内容：同系统测试(功能…各类文档等)\n\n### 按是否查看代码划分\n\n#### 黑盒测试(Black-box Testing)\n\n黑盒测试也称功能测试，测试中把被测的软件当成一个黑盒子，不关心盒子的内部结构是什么，只关心软件的输入数据与输出数据。\n\n#### 白盒测试(White-box Testing)\n\n白盒测试又称结构测试、透明盒测试、逻辑驱动测试或基于代码的测试。白盒指的打开盒子，去研究里面的源代码和程序结果。\n\n#### 灰盒测试(Gray-Box Testing)\n\n灰盒测试，是介于白盒测试与黑盒测试之间的一种测试，灰盒测试多用于集成测试阶段，不仅关注输出、输入的正确性，同时也关注程序内部的情况。\n\n### 按是否执行程序划分\n\n#### 静态测试(Static testing)\n\n静态方法是指不运行被测程序本身，仅通过分析或检查源程序的语法、结构、过程、接口等来检查程序的正确性。对需求规格说明书、软件设计说明书、源程序做结构分析、流程图分析、符号执行来找错。阿旺分析如下\n检查项：代码风格和规则审核；程序设计和结构的审核；业务逻辑的审核；走查、审查与技术复审手册。\n静态质量：度量所依据的标准是ISO9126。在该标准中，软件的质量用以下几个方面来衡量，即功能性(Functionality)、可靠性(Reliability)、可用性(Usability)、有效性(Efficiency)、可维护性（Maintainability）、可移植性(Portability)。\n\n#### 动态测试(Dynamic testing)\n\n动态测试方法是指通过运行被测程序，检查运行结果与预期结果的差异，并分析运行效率、正确性和健壮性等性能。这种方法由三部分组成：构造测试用例、执行程序、分析程序的输出结果。\n\n### 按是否查看代码划分\n\n#### 手工测试(Manual testing)\n\n手工测试就是由人去一个一个的输入用例，然后观察结果，和机器测试相对应，属于比较原始但是必须的一个步骤。阿旺总结优缺点：\n优点：自动化无法替代探索性测试、发散思维类无既定结果的测试。\n缺点：执行效率慢，量大易错。\n\n#### 自动化测试(Automation Testing)\n\n就是在预设条件下运行系统或应用程序，评估运行结果，预先条件应包括正常条件和异常条件。简单说自动化测试是把以人为驱动的测试行为转化为机器执行的一种过程。\n自动化测试比如功能测试自动化、性能测试自动化、安全测试自动化。\n通常所说的自动化是指功能测试自动化。\n\n### 其他具体测试方法\n\n#### 冒烟测试(Smoke Testing)\n\n开发人员在个人版本的软件上执行目前的冒烟测试项目，确定新的程序代码不出故障。目的是确认软件基本功能正常，执行者是版本编译人员。\n\n> 开发嵌入式产品的时候，如果软件不对，很可能给的电流电压都不对。板子就烧坏了，有时候真的会冒烟的。冒烟测试最开始意思就是烧上软件，什么都不干，只是通一下电，如果板子不冒烟，表示没有严重问题。如果板子冒烟了，调查合入的code, 修复问题，重新发一版软件。后来的软件工程也都以冒烟测试来称呼那些基本功能的验证内容，冒烟测试的目的是避免严重bug。\n\n#### 安全测试(Security Testing) //重要\n\n安全测试是在IT软件产品的生命周期中，特别是产品开发基本完成到发布阶段，对产品进行检验以验证产品符合安全需求定义和产品质量标准的过程 。\n\n#### 回归测试(Regression Testing)\n\n回归测试是指修改了旧代码后，重新进行测试以确认修改没有引入新的错误或导致其他代码产生错误。自动回归测试将大幅降低系统测试、维护升级等阶段的成本。\n在整个软件测试过程中占有很大的工作量比重，软件开发的各个阶段都会进行多次回归测试。通过选择正确的回归测试策略来改进回归测试的效率和有效性是很有意义的。\n\n> 在软件生命周期中的任何一个阶段，只要软件发生了改变，就可能给该软件带来问题。软件的改变可能是源于发现了错误并做了修改，也有可能是因为在集成或维护阶段加入了新的模块。当软件中所含错误被发现时，如果错误跟踪与管理系统不够完善，就可能会遗漏对这些错误的修改；而开发者对错误理解的不够透彻，也可能导致所做的修改只修正了错误的外在表现，而没有修复错误本身，从而造成修改失败；修改还有可能产生副作用从而导致软件未被修改的部分产生新的问题，使本来工作正常的功能产生错误。同样，在有新代码加入软件的时候，除了新加入的代码中有可能含有错误外，新代码还有可能对原有的代码带来影响。因此，每当软件发生变化时，我们就必须重新测试现有的功能，以便确定修改是否达到了预期的目的，检查修改是否损害了原有的正常功能。同时，还需要补充新的测试用例来测试新的或被修改了的功能。为了验证修改的正确性及其影响就需要进行回归测试。\n\n#### α测试(Alpha Testing) //重要\n\nα测试是由一个用户在开发环境下进行的测试，也可以是公司内部的用户在模拟实际操作环境下进行的测试。α测试的目的是评价软件产品的FLURPS(即功能、局域化、可使用性、可靠性、性能和支持)。\n大型通用软件，在正式发布前，通常需要执行Alpha和Beta测试。α测试不能由程序员或测试员完成。\n\n#### β测试(Beta Testing) //重要\n\nBeta测试是一种验收测试。Beta测试由软件的最终用户们在一个或多个客房场所进行。\nα测试与Beta测试的区别：\n\n  * 测试的场所不同：Alpha测试是指把用户请到开发方的场所来测试,beta测试是指在一个或多个用户的场所进行的测试。\n\n  * Alpha测试的环境是受开发方控制的,用户的数量相对比较少,时间比较集中。beta测试的环境是不受开发方控制的,用户数量相对比较多,时间不集中。\n\n  * alpha测试先于beta测试执行。通用的软件产品需要较大规模的beta测试,测试周期比较长。\n\n## Ref\n\n<https://www.cnblogs.com/findyou/p/6480411.html>\n"
}
