MIT | Software Construction

🚀MIT 6.031 Software Construction 课程自学笔记

📕Reading2-testing

⭐Why software testing is hard

  • 无穷的测试集是不可能全面详尽测试的
  • 随机的测试项是不太可信的,可能无法发现bug
  • 随机或统计测试对软件不适用,因为软件的行为是不连续的离散的

所以需要 系统测试 systematic testing

⭐Test-first programming

  • Spec: Write a specification for the function. 编写函数规范
  • Test: Write tests that exercise the specification.
  • Implement: Write the implementation.

⭐systematic testing

  • Correct
    • 正确的 合法的
    • 正确的实现可以通过所有测试点
  • Thorough
    • 全面的 详尽的
    • 尽可能涵盖可能出现错误的测试点
  • Small
    • 简洁的 快速的
    • 编写快速,更新容易