Skip to Content
程序员的38堂成长课
book

程序员的38堂成长课

by Pete Goodliffe
January 2022
Beginner to intermediate
314 pages
6h 55m
Chinese
Posts & Telecom Press
Content preview from 程序员的38堂成长课
测试时间
87
11.10
 结论
如果不考虑质量,那我们可以满足所有需求。
——杰拉尔德
温伯格
测试有助于编写好的代码和维护代码的
质量
,它们不仅可以
驱动
代码设计,还可以作为软
件的文档。但是测试并不能解决软件开发中的所有问题。艾兹格
迪杰斯特拉曾说:
测试
是表明存在
bug
的非常有效的方法
但它无法证明没有
bug
虽然没有测试是完美的,但拥有测试可以增强我们编写和维护代码的信心。在开发测试上
投入的精力是一种权衡取舍,你愿意投入多少精力来获得信心?请记住,测试只能保证测
试用例覆盖的部分不出问题,我们完全有可能漏掉重要的部分而没有检查。将代码部署到
生产环境中仍然会出现问题,所以测试代码也应该像生产代码一样经过仔细的评审检查。
测试的关键点很简单:编写了代码就要编写测试。为生产代码编写测试,并使用它们来
设计。在编写代码的
同时
编写测试,并自动运行这些测试。
缩短反馈循环。
测试至关重要。本章只能触及皮毛,我鼓励你进行测试,以了解更多的测试技术和信息。
思考题
1.
你接触过多少种类型的测试?
2.
哪项测试开发技术更好:是测试先行,还是在编码之后(很快)进行测试?为什么?你
的经历是如何影响这个答案的?
3.
雇用专业的单元测试工程师来构建高质量的测试套件是一个好主意吗?
4.
为什么传统
QA
部门不编写测试代码,而集中于运行测试脚本和执行探索性测试?
5.
如何才能将
TDD
引入没有自动化测试的项目中?你会遇到什么样的问题?
6.
研究一下
行为驱动开发
behaviour-driven-development
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey
Python应用开发指南

Python应用开发指南

Posts & Telecom Press, Ninad Sathaye
解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787115577948