Properties Testing: testing/quick or Gopter

xuanbao · · 477 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m trying to pick a method of handling properties testing in my Go project. There seems to be 2 options, testing/quick and gopter.</p> <p>testing/quick is built in to the language which is always a plus, but it seems to be feature dead as it&#39;s docs state no new features will be added to it.</p> <p>gopter on the other hand seems to be under active development, but is an external library and is basically unsearchable as it gets auto-corrected to gopher. </p> <p>Anyone have any opinions on either of these that can help guide me in making a choice?</p> <hr/>**评论:**<br/><br/>epiris: <pre><p>I&#39;m not sure what you&#39;re asking .. like mentioned already a concrete example would be useful. But since you mentioned testing/quick it&#39;s possible what you may want is <a href="https://github.com/dvyukov/go-fuzz" rel="nofollow">fuzzing</a>. Dynamically.. changing a bunch of arbitrary types though whatever that gopter package is doing is likely a false sense of security. The point of testing is to prove the correctness of your program, form strong invariants and prove them methodically. </p> <p>Fuzzing is something I would use for things that transition to many different states where it&#39;s not reasonable or in some cases mathematically viable to cover all possible transitions. It&#39;s nice for catching oob/ob1 and lots of other use cases, the repo will cover the topic in depth. Take away here being slinging mud at your functions through code generation has no value add for properly covered code.</p></pre>shovelpost: <pre><blockquote> <p>I&#39;m trying to pick a method of handling properties testing</p> </blockquote> <p>Properties testing? Please give an example and show why you cannot do your testing the standard way.</p></pre>

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

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