软件测试是验证软件按预期工作的过程——检查它的行为是否正确、是否满足需求,以及是否没有缺陷。它对于交付可靠、高质量的软件和在问题到达用户之前捕获问题至关重要。
什么是测试
text
Testing = systematically VERIFYING software behaves correctly:
→ does it do what it's supposed to? (meets requirements)
→ does it handle edge cases, errors, and invalid input?
→ does a change break existing functionality? (regressions)
→ from manual testing (a person checks) to AUTOMATED tests (code that checks code)
测试为什么重要
text
✓ CATCH BUGS — find defects BEFORE users do (cheaper/easier to fix early than in production)
✓ CONFIDENCE — change/refactor code knowing tests will catch regressions
✓ QUALITY — reliable software; fewer production failures, crashes, data issues
✓ DOCUMENTATION — tests show how code is meant to be used/behave
✓ FASTER long-term — automated tests catch issues quickly vs slow manual re-checking
→ The cost of a bug grows the later it's found (dev < test < production).
