验收测试与单元测试示例
好的,所以我一直在尝试查看有关测试、不同测试库等的信息。
在我看来,人们总是明确地将这些测试的区别定义为高水平和低水平。并且经过正确测试的应用程序将包含样式测试以及集成测试等。
但似乎每一篇关于测试类型的文章都以“在实践中很难看出实际差异是什么”结尾。 ”。我觉得很奇怪的是,人们似乎如此说教,以至于你必须同时进行测试才能达到任何类型的完整代码覆盖率,同时又没有任何关于每个测试可能是什么样子的好的信息/示例。
我这么问是因为我正在开始一个新项目,这个项目有望比我过去所做的任何事情都更大、更投入。我希望在测试中保持良好的工作流程,并确保我不会在测试中产生间隙(在过去的项目中,间隙很小,我可能存在的任何间隙似乎都不会导致任何重大问题)在生产中这并不简单 t0 正确)
我知道这似乎是一个很好的验收测试,自然会引导您进行单元测试,一旦您得到它,就会发生这种神奇的事情,您的开发生活也会更加幸福。
不管怎样,有谁知道关于开始良好的测试工作流程的任何好的讨论,其中讨论了在验收/集成测试到单元测试之间的转换。
.net 的例子会很棒,但由于大多数测试框架 cucumber(gherkin)/rspec 等都意味着具有相当的可读性,因此任何示例都应该很好。
OK, so I have been trying to look at information on testing, different testing libraries what not and so forth.
It seems to me that people always clearly define the difference of these test as one being high level and one being low level. And that a properly tested out application would contain both style tests as well as integration test, etc. etc.
But it seems like every article about the test types ends with something like "in practice it could be hard to see what the difference actually is". I find it weird that people seem so preachy that you must have both test to even reach any sort of full code coverage and at the same time not have any good info/examples on what each might look like.
I am asking because I am starting a new project, that promises to be much bigger and more involved than anything i have done in the past. I would like to keep a good workflow with my test and make sure I am not creating gaps in my testing as I go (in the past projects have been small, and any gaps I might have had don't seem to cause any major issues in production that weren't simple t0 correct)
I know that it seems a good Acceptance Test, naturally leads you to your unit test and once you get it, it is this magical thing that happens and your development life because just that much more blissful.
Anyway, does anyone know of any good discussions on getting started on a good testing workflow, one that talks about moving between your acceptance/integration tests to you unit test and what not.
example for .net would be great, but since most testing frameworks cucumber(gherkin)/rspec etc. are all meant to be fairly readable any example should be good.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“实际上,很难看出实际差异是什么”
:我只能提供一般性的测试建议。大型软件项目通常涉及某种层次结构。
为了使测试有效,每个级别都依赖于在较低级别中测试的完全预先测试的组件。否则,更高的测试级别必须包括其组件的基本功能,但只能使用黑盒测试(必须假设最坏的情况,即要测试的功能之间的依赖关系)。因此测试用例的数量呈指数级增长,使得全覆盖的测试变得不可能。
分层方法优化了这里的测试工作。
"in practice it could be hard to see what the difference actually is"
:I can only give general testing advice. Big software projects normally involve some kind of hierarchy.
In order for testing to be effective, each level relies on fully pretested components tested in a lower level. Otherwise a higher testing level would have to include basic functionality of its components, but can only use black box testing (which has to assume the worst case, that is dependencies between features to test). So the number of test cases is increasing exponentially, making testing with full coverage impossible.
The hierarchical approach optimizes test efforts here.
请参阅有关不同类型测试的视频。不同类型的测试技术通过表格进行比较。
Refer to the video on different types of testing. Different types of test techniques are compared with a table.