TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Best resources to learn code testing

6 点作者 deanmoriarty超过 1 年前
I have more than a decade of experience in software development (now team lead at a FAANG, working on higher level systems) and I embarrassingly realize I still do not know how to write good tests and testable code. Specifically:<p>- How to structure production code so that it’s testable<p>- How to effectively deal with dependency injection for testing<p>- The surface area and granularity of unit tests (what behavior should be tested vs not)<p>- When to use mocks&#x2F;stubs&#x2F;fakes<p>What are the best resources to fix my gaps? Open to books, courses, videos, etc.

3 条评论

hyling超过 1 年前
This book was really helpful for me. It broke down how to structure tests, what results in brittle tests, what to avoid to keep tests maintainable. I believe it answers most of your questions. Software Engineering at Google, Chapters 11-14 Testing: <a href="https:&#x2F;&#x2F;www.oreilly.com&#x2F;library&#x2F;view&#x2F;software-engineering-at&#x2F;9781492082781&#x2F;ch11.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.oreilly.com&#x2F;library&#x2F;view&#x2F;software-engineering-at...</a>
az09mugen超过 1 年前
Depends on your language for ressources and what you are looking for.<p>Unit testing is supposed to test the code alone with no external dependecy (db, API,...), that&#x27;s when you need mocks&#x2F;stubs. Unit testing helps a lot with refactoring and code quality.<p>Integration tests are here to ensure your app&#x2F;module will work fine once deployed.<p>I don&#x27;t have any particular recommendation for a site or else, I think the best is to do some research, make up your own mind and see what suits best your case&#x2F;needs.
simne超过 1 年前
Sorry, I read your previous comments, and you are now really mystery person for me.<p>What I mean, I can&#x27;t believe, how it is possible :)<p>I have hear about TDD for about 10 years. Thinking, it is obvious thing. Thinking, everybody learn it now from first steps.<p>Sorry for so many words, now answer.<p>Just google &quot;best software testing books&quot;, QA resources (yes, just lear QA). For example known name Copeland; also good Myers; other big figures, Jorgensen, Dorothy Graham.<p>Good luck!