Skip to Content
可观测性工程
book

可观测性工程

by Charity Majors, Liz Fong-Jones, George Miranda
July 2023
Beginner to intermediate
270 pages
4h 48m
Chinese
China Machine Press
Content preview from 可观测性工程
103
11
可观测性驱动开发
作为一种实践,可观测性从根本上帮助研发工程师与最终用户进行换位思考,让工程师
可以像最终用户那样,在生产中体验自己编写的代码。但是,这并不意味着可观测性仅
在软件发布到生产环境的环节才有用。可观测性完全应该在软件开发生命周期中左移或
提前。在本章中,你可以了解可观测性驱动开发的实践。
我们将首先探索测试驱动开发及其在软件开发生命周期中的用法和可能存在的不足。然
后我们通过类比,研究如何在测试驱动开发的方法中加入可观测性。我们将探讨这样做
产生的效果,探讨各种调试代码的方法,并追问探针如何帮助可观测性。最后,我们探
讨可观测性驱动开发是如何左移,并且帮助加快软件交付进度的。
11.1 测试驱动开发
如今,在软件投入生产之前,进行测试的既定事实标准是测试驱动开发(
TDD
)。
TDD
可以说是近
20
年来整个软件开发行业中最成功的实践之一。
TDD
为测试左移提供了一
个有用的框架,可以在许多潜在问题投入生产之前,就开始发现和捕获程序上的问题。
TDD
在软件开发行业的广泛采用,应该归功于它提升了在生产服务中运行的代码质量。
TDD
是一种强大的实践,它为工程师提供了一种清晰的方式来思考软件的易用性。应用
程序由一组每天可以运行数百次的确定性的可重复测试来定义。如果应用程序通过这些
可重复的测试,则应用程序一定是按照预期运行的。在对生产的应用程序变更之前,工
程师要先编写对应用程序的测试用例,以便后面在编写代码时,这些代码可以通过这些
提前编好的测试用例。
TDD
特别强大,是因为每次的测试都会以相同的方式运行。数据通常不会在测试运行之 ...
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

可观察性工程

可观察性工程

Charity Majors, Liz Fong-Jones, George Miranda
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 9787111729099