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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: How do you help junior developers learn finding edge cases?

7 点作者 twy30大约 4 年前
Edge cases are nature&#x27;s way of telling us how lousy our programming is. (*1)<p>Is there a systematic, step-by-step approach to help junior developers improve their awareness&#x2F;senses of edge cases?<p>There are some low hanging fruits that are easy to explain and demonstrate. For example, boundary-value analysis [1], division by 0, removal of an item from an empty container, etc. However, sometimes it feels more like art than science (i.e. <i>I know it when I see it.</i> ).<p>Any feedback and&#x2F;or idea is greatly appreciated. Thank you.<p>*1: Borrowed from Dick Guindon&#x27;s &quot;Writing is nature&#x27;s way of telling us how lousy our thinking is.&quot;<p>[1]: https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Boundary-value_analysis

5 条评论

brudgers大约 4 年前
Ask “what edge cases are there?” when first describing the task and let them go off and work a while.<p>Later ask “are there any other edge cases?” and let them work a while longer.<p>Repeat as appropriate.<p>Let them find them on their own for a while or two.<p>Let them miss them on their own for a while or two.<p>At the right time ask “have you thought about this potential edge case?”<p>If you want someone to learn to deal with edge cases, they need to see it is something you value and give them time to learn how to do it.<p>And how not to do it. “Not” in the logical sense not “not” in a punishment sense or job evaluation sense.<p>Edge cases are hard and everyone screws them up. The context needs to be safe enough that people can own their mistakes and learn something other than to hide their ignorance.<p>Good luck.
评论 #26497788 未加载
giantg2大约 4 年前
I find that the majority of edge cases come from the business system (the business has a system&#x2F;process that we turn into a technical system). I try to approach it like a lawyer trying to find a loophole. Try to ask questions that challenge assumptions about what conditions are possible in the system and ask questions that seem absurd but fit the requirements.<p>For example, if you&#x27;re building a financial system maybe ask if a negative balance is allowed. If you charge a fee based on balance (like using basis points), can the fee be negative or is there a set floor? A negative fee sounds stupid, which is why the business probably wouldn&#x27;t mention it in requirements, but it would be important to set the floor at $0 so if a negative balance occurred, we wouldn&#x27;t issue a fee.
评论 #26494204 未加载
afarrell大约 4 年前
The Rapid Software Testing course by James Bach is really good for teaching some metacognitive skills of this.<p>On a higher abstraction layer, iff you can filter for low-bullshit, some social justice stuff can indeed help someone master the main skills needed to spot diverse failure modes in different user stories. For example, this principle is useful: <a href="https:&#x2F;&#x2F;thingofthings.wordpress.com&#x2F;2014&#x2F;11&#x2F;15&#x2F;the-curb-cut-effect-or-why-it-is-basically-impossible-to-appropriate-from-disabled-people&#x2F;" rel="nofollow">https:&#x2F;&#x2F;thingofthings.wordpress.com&#x2F;2014&#x2F;11&#x2F;15&#x2F;the-curb-cut-...</a>
评论 #26498965 未加载
评论 #26500778 未加载
gostsamo大约 4 年前
List the properties of an object. List the operations performed. Fill in the matrix. Remember it mostly by remembering your own failures.<p>One should know about all versions of null and empty or overflowed, about stuff being too big, about operations being performed out of sync.<p>Maybe, the easiest is to ask yourself: What can go wrong? on every line of the code.
评论 #26490512 未加载
评论 #26500109 未加载
tmaly大约 4 年前
I would recommend they read the Mom Test book, then have them talk to the business side. You can learn a lot more than what was written down by doing this.
评论 #26517116 未加载