1

I need some suggestions of how you handle your test data in manual UI tests. Our application needs data from a database to work and to being tested manually. Since we are dealing with sensitive data we are not allowed to make a dump of productive data for using it on our test system (or development machines).

How do you deal with this problem? I am thinking about the possibility of masking productive data for using it in the tests, are there any free or open source tools for this? I would prefer this solution because of the possibility to produce mass data. I hope you have an idea, creating test data manually would be really time intensive.

Kai
  • 38,985
  • 14
  • 88
  • 103

3 Answers3

2

RedGate Sql Data Masker http://www.red-gate.com/labs/sql-data-masker/ was designed for this problem, but it's not free nor open-source. You could loop into some randomize function to just generate lots of junk, though it sounds like you're looking for a "buy" over a "build".

robrich
  • 13,017
  • 7
  • 36
  • 63
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!

Eren
  • 11
  • 1
0

If you access the data through a DAO (Data access object) you can create a mock of that object to test your code, I used Mockito for this in a project. If the code you are testing directly accesses the database you'll have to point it to a "testing database" of some kind...

An extra feature of mocking is so-called spy-objects, that is a mock wrapped around an underlying real object, where you can override some of the methods with testing code, i.e. disable deleting, create masks, etc, while all non-mock-overriden methods are passed directly to the underlying real object... check out: http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html

Tor P
  • 1,351
  • 11
  • 9
  • Okay, that´s true. I use Mockito already for unit tests. But for manual GUI tests on a test system that doesn't work. My requirement is to see huge amount of data in the client. – Kai Apr 28 '12 at 16:15
  • there is a couple of possible solutions: there is an extension to JUnit for database testing, might be possible to use: http://www.dbunit.org/howto.html . OR you can create your own JDBC driver to function as a filter on top of the real JDBC driver, see: http://www.javaworld.com/javaworld/jw-05-2002/jw-0517-jdbcdriver.html – Tor P Apr 28 '12 at 17:55
  • not the first time someone has asked about this: http://stackoverflow.com/questions/266370/how-do-i-unit-test-jdbc-code-in-java – Tor P Apr 28 '12 at 17:57
  • No, my question is about data masking particularly. So our idea with the own jdbc driver doesn't apply because I don't want to filter data. I want to transform productive data into a shape in which it is save to copy it on my testing server or development environment. – Kai Apr 28 '12 at 18:07
  • sorry, my bad... by filter I actually mean mask.. basically when creating your own JDBC driver that lies between your code and the actual driver, where you can inspect any data passing through and mask any data that should not be passed on to the test... – Tor P Apr 28 '12 at 18:51