ilari100 ilari100 - 1 year ago 63
MySQL Question

MySQL: identifying duplicated data

I have a database designed this way to store software testing data: design

I have got the INSERT and SELECT queries working fine but I faced a problem. If I test same software again on same configuration that it has been tested on before, the stored data in table

isn't related to a specific test run. It is just related to a specific software and specific configuration.

To sum it up: If I test the same software on the same configuration now and a year later I want to be able to relate the found faults to specific testing time. How should I change the design?

Thank you.

Answer Source

I see only one proper way to fix this: you should add a table handling your test session atop of the configuration table.

For instance:

Table test_session

session_id  INT
start-ts    timestamp
end-ts      timestamp
tester      VARCHAR(30)
comments    VARCHAR(200)

Table configuration

configuration_id   INT
test_session_id    INT
configuration_name VARCHAR(45)

In the application you should add a mechanism to handle sessions. When you start a new session you should enter it's data somewhere and then INSERT a record in the test_session table, and assign its id to the configuration.

This design offers you more than just "be able to relate the found faults to specific testing time". You will also be able to compare the same configurations and thus have a history and see the evolution of your configurations over time

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download