How and why programmers test their code (or don't)

agolangf · · 509 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Software testing is a topic which is dear to many people&#39;s hearts, but which can also be divisive (or fall by the wayside) in practice. I&#39;m running an anonymous survey to gather data on programmers and their use and/or non-use of testing. The results will be released in mid-October (and will now be the basis for a presentation).</p> <p>I do most of my coding these days in Go, and I&#39;ve been very happy with the way the tools for testing in Go have evolved and been fleshed out, release after release. I&#39;m really interested in what y&#39;all gophers have to say about this :)</p> <p>If you&#39;d like to contibute, please take a few minutes and <a href="https://docs.google.com/forms/d/11XZvtNbSzhLjkKrgKsb-lCyYGZR-WrHlYvTL5-4pPh8/viewform?usp=send_form">complete the survey</a>.</p> <p>Thank you for your time and help! (This survey was previously posted to <a href="/r/programming">r/programming</a>, <a href="/r/learnprogramming">r/learnprogramming</a>, <a href="/r/python">r/python</a>, and <a href="/r/perl">r/perl</a>.)</p> <hr/>**评论:**<br/><br/>mohi666: <pre><p>Sometimes unit tests speed up development process as well. Especially when your code hast to work with external systems or large data.</p></pre>BoTuLoX: <pre><blockquote> <p>How</p> </blockquote> <p>With a testing framework. Go has one in the standard library.</p> <blockquote> <p>Why</p> </blockquote> <p>To produce easier to maintain, less buggy software.</p> <p><a href="https://www.youtube.com/watch?v=D9GQ9nBHhIc" rel="nofollow">This is a good video on the topic</a></p></pre>quiI: <pre><p>Speaking from recent experience I cant understate how nice it is to work on an unfamiliar code base that has tests, and how not-nice the opposite is.</p> <p>Not only do well written tests document how a system works, but it also points you in the direction of how to change/add functionality. </p> <p>Crucially it gives you confidence that you&#39;re <em>not breaking it</em>. </p></pre>Ainar-G: <pre><blockquote> <p>What year did you begin programming?</p> </blockquote> <p>Does that mean &#34;When did you start working as a programmer?&#34; or just &#34;When did you first started to learn programming?&#34;?</p></pre>sboyette2: <pre><p>The latter: when you started programming, in any capacity.</p></pre>FIuffyRabbit: <pre><p>I started programming when I was 12 but that doesn&#39;t really have much influence on my style. TDD is pretty much a de facto standard now a days but I don&#39;t really do it. A lot of my personal programming is heavily based on trial and error because it is based on scraping web services or building apis. I could test my work but it isn&#39;t really worth my time. </p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

509 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传