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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Poll: How do you approach testing at work?

3 点作者 pkkm4 个月前
There&#x27;s a lot of debate around testing. I&#x27;m interested to see how people approach it at work and how satisfied they are with their approach.<p>To preempt arguments about terminology, here&#x27;s how I&#x27;ll define the terms for the purposes of this thread. If the test doesn&#x27;t touch any external service, it&#x27;s a unit test, even if it executes thousands of lines of code. If it runs against a real Postgres instance or a real filesystem, it&#x27;s an integration test. If the test is done entirely through the program&#x27;s UI and public APIs, then it&#x27;s an end-to-end test.

2 条评论

sixothree4 个月前
I think my testing is pretty standard. Both in approach and amount.<p>But I’ve been more focused on integration tests lately as part of my development cycle. First unit tests for the small things like the mappings we tend to do so much of. Then the integration tests as a key part of my actual development. And then lastly I incorporate it into my application without much worry. Using this code in the application is now the least of my work because I already know all of the processes already work as expected. It’s just a matter of wiring it up correctly.<p>Unit tests are unit tests. But the part you may be interested in is that integration test for me lately have been very much literally “how I develop”. I encapsulate units of whatever process is at hand this push into my test. I might ingest documents from db, file, or api, and examine them with the debugger and see what I have available, what work that needs to be done elsewhere. Move forward and maybe use all of the mappings I mentioned (already unit tested), manipulate &#x2F; transform &#x2F; lookup (already unit tested). Move forward and examine the results of the ingest &#x2F;export &#x2F; process from whatever service is providing that feature.<p>I consider my integration tests to be anything that performs multiple actions for components that are already unit tested, maybe can handle an expected exception, maybe requires another component of the app to be running.<p>It’s definitely not TDD. But if it’s something QA is gonna analyze with excel or some validator api then it’s been unit tested. If it’s a process I want robustness out of, it’s been integration tested.<p>I think the switch for me happened when I decided not to create “that little console app” to wrap my work and aid development; and instead just write a test. I’m sure someone might critique the heck out of my thoughts here. But it’s working.
hitchstory4 个月前
Unit tests for complex logical or algorithmic code with simple interfaces.<p>Hermetic end to end tests for the rest.