用于测试分布式系统的集成测试框架? [英] Integration testing frameworks for testing a distributed system?
问题描述
我有一个分布式系统,组件分布在多个盒子中.他们使用tcp或多播相互通信.每个组件彼此交换消息-这些基本上是被序列化的数据结构.
I have a distributed system with components spread across multiple boxes. They talk to each other using tcp or multicast. Each components interchanges messages with each other - these are basically data structures that get serialized.
对于此类测试系统,我们有哪些集成测试框架?我对红宝石很熟悉,所以基于红宝石的东西肯定会有所帮助.
What integration test frameworks do we have for testing systems like these? I am familiar with ruby so something ruby based would definitely help.
推荐答案
我想有不同的方法可以做到这一点.我会尽量避免进行集成测试,但是当然有必要这样做.这只是我的建议:
I suppose there are different ways of doing it. I try to avoid integration testing as much as I can but at some point is needed ofcourse. This is just a suggestion what I would do:
- 使用行为驱动方法明确定义要测试的方案.
- 执行单元测试(否模拟来对应该使用其他模块输入的过程进行单元测试. .测试当前其他模块的逻辑.
- 执行烟雾测试,这种类型的测试将确保您的模块之间可以相互通信(这是一种集成测试).我认为冒烟测试仅是足够的集成测试.如果您想一想:为什么模块上要关心其他模块的作用?(让每个部分去做他们想做的事,而只在乎如何与它们通信)
- Using a behavior driven approach define clearly the scenarios you want to test.
- Do unit testing(No integration), to the procedures that will represent the outputs of a module.
- Unit test the procedures that are supposed to use inputs from other modules, but by using mocks. Testing the logic of another module in the current.
- Perform smoke tests, this type of test will ensure that your modules can communicate between each other(This is a type of integration testing). I think smoke test is just enough integration testing. If you think about it: why would on module care about what other module does?(Lets leave each part do whatever they want, but only care about what how to communicate with them)
我个人认为,在测试方法中将对象从一个分布式模块调用到另一个模块不是一个好习惯.是的,那将是一个集成测试,但是我认为它非常容易可靠.
Personally I think that calling objects from one distributed module into another in test methods, is not a good practice. Yes that would be an integration test, but I think it is very easy reliable.
始终牢记测试的金字塔,请记住,集成测试和端到端测试可能非常昂贵.因此,明智地选择何时使用它们:
Always have in mind the pyramid of testing, remember that integration tests and end to end tests can be very expensive. So choose wisely when to use them:
我来自Java世界,以下只是一些我认为也与此主题相关的额外信息,可能与您有关:
I come from the Java world, this following is just some extra information that I think is also related to the topic and might be of your interest:
- 数据传输对象模式很有趣
- RMI vs EJB vs HTTP (关于远程调用技术之间的差异的一些有趣评论)
- Spock Java开发人员的BDD框架.(如果您完全了解业务规则,那么测试更容易)
- The Data Transfer Object pattern, is interesting
- RMI vs EJB vs HTTP(Some interesting comment on differences between remote invocation technologies)
- Spock a BDD framework for java developers.(If you perfectly understand the business rules then testing is a way easier)
希望您发现它有用.
这篇关于用于测试分布式系统的集成测试框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!