惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
The Register - Security
The Register - Security
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
V
Visual Studio Blog
H
Help Net Security
S
Secure Thoughts
U
Unit 42
P
Palo Alto Networks Blog
A
About on SuperTechFans
S
Securelist
IT之家
IT之家
P
Privacy & Cybersecurity Law Blog
The Cloudflare Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
MyScale Blog
MyScale Blog
M
MIT News - Artificial intelligence
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
T
Tor Project blog
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 聂微东
C
CERT Recently Published Vulnerability Notes
阮一峰的网络日志
阮一峰的网络日志
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
量子位
Security Latest
Security Latest
L
LangChain Blog
The Last Watchdog
The Last Watchdog
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 三生石上(FineUI控件)
T
The Exploit Database - CXSecurity.com
博客园 - 【当耐特】
博客园 - 司徒正美
Blog — PlanetScale
Blog — PlanetScale
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Latest news
Latest news
S
Schneier on Security
H
Hacker News: Front Page

Kent C. Dodds Blog

Implementing Hybrid Semantic + Lexical Search Simplifying Containers with Cloudflare Sandboxes Migrating to Workspaces and Nx Offloading FFmpeg with Cloudflare Building Semantic Search on my Content Helping YOU ask ME questions with AI How I used Cursor to Migrate Frameworks The Dow's Start on the Covenant Path 2025 in Review The next chapter: EpicAI.pro AI is taking your job How I increased my visibility Launching Epic Web 2023 in Review Stop Being a Junior RSC with Dan Abramov and Joe Savona Live Stream Fixing a Memory Leak in a Production Node.js App 2022 in Review My Car Accident I Migrated from a Postgres Cluster to Distributed SQLite with LiteFS I'm building EpicWeb.dev A review of my time at Remix Remix: The Yang to React's Yin How I help you build better websites Why I Love Remix The State Initializer Pattern How to React ⚛️ Get a catch block error message with TypeScript Building an awesome image loading experience How Remix makes CSS clashes predictable Introducing the new kentcdodds.com How I built a modern website in 2021 How to use React Context effectively Static vs Unit vs Integration vs E2E Testing for Frontend Apps The Testing Trophy and Testing Classifications Array reduce vs chaining vs for loop Don't Solve Problems, Eliminate Them Super Simple Start to Remix Super Simple Start to ESModules in Node.js JavaScript Pass By Value Function Parameters How to write a Constrained Identity Function (CIF) in TypeScript How to optimize your context value How to write a React Component in TypeScript TypeScript Function Syntaxes Listify a JavaScript Array Build vs Buy: Component Libraries edition Using fetch with TypeScript Wrapping React.useState with TypeScript Define function overload types with TypeScript 2020 in Review Business and Engineering alignment Hi, thanks for reaching out to me 👋 useEffect vs useLayoutEffect Super simple start to Firebase functions Super simple start to Netlify functions Super Simple Start to css variables Favor Progress Over Pride in Open Source Testing Implementation Details How getting into Open Source has been awesome for me useState lazy initialization and function updates Use ternaries rather than && in JSX Application State Management with React Use react-error-boundary to handle errors in React JavaScript to Know for React How I structure Express apps What open source project should I contribute to? When I follow TDD AHA Programming 💡 How I Record Educational Videos Should I write a test or fix a bug? Stop mocking fetch Intentional Career Building Improve test error messages of your abstractions Tracing user interactions with React Eliminate an entire category of bugs with a few simple tools Common mistakes with React Testing Library Super Simple Start to React Stop using client-side route redirects The State Reducer Pattern with React Hooks Function forms Replace axios with a simple custom fetch wrapper How to test custom React hooks React Production Performance Monitoring Should I useState or useReducer? Stop using isLoading booleans Make Your Test Fail Make your own DevTools An Argument for Automation Fix the "not wrapped in act(...)" warning Super Simple Start to ESModules in the Browser Implementing a simple state machine library in JavaScript 2010s Decade in Review Why users care about how you write code Why I avoid nesting closures Don't call a React function component Why your team needs TestingJavaScript.com Inversion of Control Understanding React's key prop How to Enable React Concurrent Mode Profile a React App for Performance
Confidently Shipping Code
2018-10-08 · via Kent C. Dodds Blog

Have you read the book "Start With Why"? If you haven't, I recommend it. At least watch the TED talk. The premise of the idea is that "People won't truly buy into a product, service, movement, or idea until they understand the WHY behind it." This concept hit home with me when I watched that talk and then read the book a few years ago, and it's shaped the way I communicate with you in my blog posts, talks, workshops, and courses.

I'd like to share my "why" about testing with you and invite you to consider what your own "why" might be.

Like many people, at the start of my career I didn't understand automated software testing. I was introduced to it by my friend Joe Eames, who was then fighting an uphill battle at the company where we both worked to get people to write tests. I was an intern at the time, and he took me under his wing a few times to teach me about automated testing. I thought it was pretty neat, but he moved on to another job before I really got testing ingrained in my workflow.

Later, when I started writing my first JavaScript library (geniejs), I realized quickly that spending time to manually verify that everything's working, every single time I fixed a bug or added a new feature, was pretty annoying. I decided to learn to test and write tests for my library. (The tests have been through a few testing framework refactorings, but they're still largely the same as when I originally wrote them all those years ago). Investing time into testing my library ended up saving me a TON of time, and I was able to integrate testing into my workflow.

I remember when I was actively working on angular-formly, I had a coworker who needed a new feature. It was a simple feature, so he sat by me and watched as I wrote the test, implemented the feature, and pushed the commit to trigger a release. He was shocked that I could rely on the tests so much that I was confident I didn't break anything. That was when it really occurred to me that testing had become more than a default workflow for saving time. It was a mechanism for giving me confidence.

At the time of this writing, I have 111 packages published on npm. Pretty much every one of those packages has 100% code coverage, meaning every line is run in the tests. I don't think I could possibly maintain them any other way. My libraries have received contributions from thousands of people. When someone opens a pull request with changes to one of my libraries, I have a continuous integration service (TravisCI) that kicks off to run all the tests. Sometimes it's been months or even years since I've touched the code. Past Kent, who had just barely written the code, probably knew instantly whether something broke. Present Kent? He usually has no idea, and it would take me a lot of time to evaluate. Having the tests in place is like Past Kent telling Present Kent: "It's ok. This is very unlikely to break anything." The tests save me time, and they give me — and all the users of my libraries — a great amount of peace of mind.

So why do I write tests? I write tests because they allow me to accomplish more than I could otherwise. I now have thousands of Kents in the form of automated tests telling me whether changes are breaking use cases. With that venerable army of robots, I'm able to rest easy and get more accomplished.

Now, I want to ask you a question: Why do you want to learn testing? Is it to further your career? Did a specific incident (i.e. a bug — yup, we've all been there) happen that prompted a need? Do you (like me) simply want to get more done, with more peace of mind?

Now my next question: What has been holding you back from starting?

Conclusion

Whether you're already testing, or you're interested in getting started, I've got something coming that I think you'll love. Especially if you've struggled to know what to test. I've been working hard putting together the most comprehensive work of my life, and I think it'll knock your socks off. Stay tuned.