自动化测试的最佳实践方法 [英] Best practice approach for automated testing

查看:175
本文介绍了自动化测试的最佳实践方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是建议一个非常奇怪的请求,我真切地感受到,没有真正的答案。在项目中,我在已经消耗逻辑运算,我归档这些项目的审计线索的缘故,并检查了计算上的错误或在后期证明correctiveness各种对象归档例程。我与实体框架工作,事情或许你自己的项目略有不同。

This is a very strange request for advice for which I truly feel there is no real answer. In my project I have archiving routines on various objects that have been consumed for logical calculations, I archive these items for the sake of audit trail and to check up on calculation errors or prove correctiveness at a later stage. I am working with Entity Framework and things are slightly different to perhaps your own project.

我消耗原来的对象,直接修改,创建修改项目的克隆,恢复从商店的原始项目,并相应地保存更改。一个对象不回复到原来如果从未通过计算所消耗,在这种情况下,我直接保存在该对象与该进一步的目的存在各种关系沿

I consume the original object, modify it directly, create a clone of the modified item, revert the original item from store and save changes accordingly. An object is not reverted to original if never consumed by a calculation, in these instances, I save directly over that object along with the various relationships that exist with further objects.

这听起来可能长篇大论,但我向你保证 - 它似乎最容易至今在我的情况我运作与EF方面

This may sound long winded, but I assure you - it seems the easiest so far in terms of my workings with EF in my situation.

我的这些归档例程麻烦的是,随着时间的推移,我采取进一步的功能 - 有时我,不知道,突破关键code到一个地步,我必须回归测试整个解决方案了,从开始到结束,以确保该归档要求保持不变。

My trouble with these archiving routines is, that over time as I introduce further functionality - I sometimes, without knowing, break critical code to a point where I have to regression test the entire solution over, from beginning to end, to ensure that the archiving requirements remain intact.

有没有单元测试方法或自动的方法测试这些各种各样的要求。这将加快包装削减我自己手动测试的部署。

Is there any unit test approach or automated methodology for testing these sorts of requirements. It would speed up deployment of packages cutting down on my own manual testing.

任何意见或链接simlar情况AP preciated。

Any advice or links to simlar situations appreciated.

推荐答案

我觉得有两件对这个问题你所描述的:

I think there are two pieces to this problem you are describing:


  1. 首先,你需要一些单元测试,你可以建立,这将重新系统present技术要求。想想单元测试作为您设置了在技术上达到最终用户期望的目标规则。这样一来,我就工艺单元测试,你可以放心,如果你已经对系统进行了技术假设不成立,因为code的变化将打破。记住要保持单元测试在单元级别,使您不必大量依赖交互失败测试。单元测试应该测试正好一件事。如果你这样做,当你code变化,你可以运行所有的单元测试,马上知道你有哪些现在没有得到满足系统进行了哪些假设。

  1. First you need some unit tests that you can build which will represent technical requirements of the system. Think of the unit tests as the rules which you have set up to technically accomplish the goal that the end user desires. In this way, I would craft unit tests that you can feel confident will break if a technical assumption you had made about the system fails because of a code change. Remember to keep the unit tests at the unit level so that you don't have a large amount of dependencies interacting to fail a test. A unit test should test exactly one thing. If you do this, when you make code changes you can run all your unit tests and immediately know what assumptions you had made about the system which are now not being met.

我还设置了某种这些自动化集成功能测试。我觉得在你的问题领域是明智设立综合测试这是类似单元测试(您可以使用相同的工具)。在这里,你将要迈出更大件的功能,也许管道的数据流通过该系统和测试了正确的一系列转换发生在数据

I would also set up some sort of integration functional tests which are automated. I think in your problem domain it would make sense to set up integrated tests which are similar to unit tests (you can use the same tool.) Here you will want to take bigger pieces of functionality, perhaps pipes which data flows through the system and test that the correct series of transformations occur on the data.

这篇关于自动化测试的最佳实践方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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