1

我需要一些关于如何在手动 UI 测试中处理测试数据的建议。我们的应用程序需要来自数据库的数据才能工作和手动测试。由于我们正在处理敏感数据,因此我们不允许转储生产数据以在我们的测试系统(或开发机器)上使用它。

你如何处理这个问题?我正在考虑屏蔽生产数据以在测试中使用它的可能性,是否有任何免费或开源工具可以做到这一点?我更喜欢这种解决方案,因为可以产生大量数据。我希望您有一个想法,手动创建测试数据将非常耗时。

4

3 回答 3

2

RedGate Sql Data Masker http://www.red-gate.com/labs/sql-data-masker/是针对这个问题设计的,但它不是免费的,也不是开源的。您可以循环进入一些随机化函数以生成大量垃圾,尽管听起来您正在寻找“购买”而不是“构建”。

于 2012-04-28T17:19:38.993 回答
1

There are various points to consider when masking. For example:

  • do you know where ALL the sensitive data resides within the database;
  • how important is referential integrity;
  • is consistency over time and across databases required;
  • to what extent are you hoping to de-identify each data;
  • do you really need to mask the entire database?

If you are able to manually satisfy these items, then it's great! However, if you are looking to get this done in a timely manner while keeping the cost down (not to mention protecting the company and its database from exposure), I suggest you take a look at the Best Practices to Data Masking on www.datamasking.com

Hope this helps!

于 2012-05-03T11:28:56.993 回答
0

如果您通过 DAO(数据访问对象)访问数据,您可以创建该对象的模拟来测试您的代码,我在项目中使用了 Mockito。如果您正在测试的代码直接访问数据库,您必须将其指向某种“测试数据库”......

模拟的一个额外功能是所谓的 spy-objects,它是一个围绕底层真实对象的模拟,您可以在其中使用测试代码覆盖一些方法,即禁用删除、创建掩码等,而所有非模拟- 覆盖的方法直接传递给底层的真实对象...查看:http ://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html

于 2012-04-28T16:00:01.123 回答