敏捷方式:集成测试与功能测试还是两者兼而有之? [英] The Agile Way: Integration Testing vs Functional Testing or both?

查看:35
本文介绍了敏捷方式:集成测试与功能测试还是两者兼而有之?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个办公室工作,现在已经在做敏捷一段时间了.我们使用 Scrum 进行项目管理并混合 XP 的工程实践.它运作良好,我们不断吸取教训并改进我们的流程.

I work in an office which has been doing Agile for a while now. We use Scrum for project management and mix in the engineering practices of XP. It works well and we are constantly learning lessons and refining our process.

我想告诉您我们通常的测试做法并获得有关如何改进的反馈:

I would like to tell you about our usual practices for testing and get feedback on how this could be improved:

TDD:第一道防线我们非常热衷于单元测试,我想说我们的开发人员也有足够的经验来编写全面的测试,并且总是用模拟来隔离 SUT.

TDD: First Line of Defense We are quite religious about unit testing and I would say our developers are also experienced enough to write comprehensive tests and always isolate the SUT with mocks.

集成测试对于我们的使用,集成测试与单元测试基本相同,只是不使用模拟.这往往会发现一些在单元测试中漏掉的问题.这些测试往往难以阅读,因为它们通常在规范框架的 before_eachafter_each 部分涉及很多或工作,因为系统必须经常达到某种状态为了使测试有意义.

Integration Tests For our use, integration tests are basically the same as the unit tests just without using the mocks. This tends to catch a few issues which slipped through the unit tests. These tests tend to be difficult to read as they usually involve a lot or work in the before_each and after_each sections of the spec framework as the system has to often reach a certain state in order for the tests to be meaningful.

功能测试我们通常以结构化但手动的方式执行此操作.我们玩过 Selenium 和 Windmill,它们很酷,但至少对我们来说还没有.

Functional Testing We usually do this in a structured, but manual fashion. We have played with Selenium and Windmill, which are cool, but for us at least not quite there yet.

我想听听其他人是如何做事的.您认为如果集成测试或功能测试做得足够好,另一个可以忽略吗?

I would like to hear how anyone else is doing things. Do you think that if Integration Tests or Functional Testing are being done well enough the other can be disregarded?

推荐答案

单元、集成和功能测试虽然使用相同的代码,但却从不同的角度对其进行攻击.正是这些观点产生了影响,如果你放弃一种类型的测试,那么某些东西可以从那个角度发挥作用.

Unit, integration and functional testing, though exercising the same code, are attacking it from different perspectives. It's those perspectives that make the difference, if you were to drop one type of testing then something could work its way in from that angle.

此外,单元测试并不是真的要测试您的代码,尤其是当您正在练习 TDD 时.TDD 帮助您更好地设计代码的过程,您只需在结束时获得一套测试的额外奖励.

Also, unit testing isn't really about testing your code, especially if you are practising TDD. The process of TDD helps you design your code better, you just get the added bonus of a suite of tests at the end of it.

您没有提到您是否有持续集成服务器在运行.我强烈建议设置一个(Hudson 很容易设置).然后,您可以针对每次代码签入运行集成和功能测试.

You haven't mentioned whether you have a continuous integration server running. I would strongly recommend setting one up (Hudson is easy to set up). Then you can have your integration and functional tests run against every check in of the code.

这篇关于敏捷方式:集成测试与功能测试还是两者兼而有之?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆