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堂成长课
76
11
测试时间
质量是免费的,但只有那些愿意付出沉重代价的人才能拥有。
——汤姆
狄马克和蒂莫西
李斯特
出自《人件》
测试驱动开发(
TDD
)对一些人来说是信仰、是开发的唯一方式或是一个自己还没掌握的
好主意。而对另一些人来说,做
TDD
纯粹是浪费时间。
那么它到底是何方神圣?
TDD
是提高软件质量的重要技术,不过对于什么是
测试驱动
、什么是
单元测试
,仍然存在
着争论。让我们先跳过这些争论,一起探索一种能够让开发人员进行测试的有效方法,从
而写出更好的代码。
11.1
 为什么测试
答案显而易见:
必须
测试代码。
你可以运行新程序来判断它是否正常工作。没有哪个程序员能信心满满或狂妄自大地跳过
测试直接发布。如果没有对代码进行测试,那它首次运行时基本上会失败:问题可能是由
QA
发现的,或者更糟,在客户使用时出现。
测试时间
77
11.1.1
 缩短反馈循环
开发优秀的软件和保持开发过程高效都需要程序员快速频繁地收到
反馈
。良好的测试策略
可以缩短反馈循环,使我们高效地工作。
代码在实际使用中一般能正常工作,并向用户返回正确的结果。如果不能,用户就会抱
怨。如果这是我们唯一的反馈循环,那么软件开发将非常缓慢而且成本高昂。我们应该
做得更好。
在软件发布
之前
QA
团队会测试软件。这就缩短了反馈循环,让我们能尽快知道答案, ...
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