How to test and solve Data Duplication

The test engineers who are working with forms... this information might help them to test the form better. The term data duplication refers to a problem when we deal with web page form submission. Say you filled up a page( form ) and then clicked on submit.The data of the page go to database.Till this point everything is good. But problem starts when you click on refresh button. The data will be saved again!!!!!!!!!!

Yes... some of the pages have this code leakage. So same record will be inserted.

Now try to refresh the page n numbers of times.....database will contain n+1 number of same records.

This is a good validation for Test engineers but still a pain area for customers right ? Let us see how we can solve this case.
The solve can be of two ways..
1. Scripted validation in front end
2. Validation in Back end.

The frontend validation refers to scriptlet or scripted part of any webpage. use of javascript that will clear the form after successful press to submit button.
The algo will be
 Save the form
Clear the form
Now again more customization can be implemented How??

We will be checking the blank value of any text box or mandate field and will throw error message...Normal validation error message only .
So if we press the refresh button once again it will try to enter null value and our validation logic will stop it from entering null value.


A smart solution can be to navigate to a next page after saving the data.

This is like ..on saving the data a page came saying that data have been successfully  saved . Now you can disable the back button.

2. Checking the back end will also have several techniques...

1. In presence of a unique key or a unique filed...Say you have email id or might be an employee id inside the form. What you can do you can check the database first if it is having the same field present then the second entry is a duplicate one.That means we will not save this.

2. where there is no unique id present you can create a temp file with the coloumn of ipaddress and time.
Now while saving any record just check when the last saved happen and what was the ip. If the same request is coming from a same ip within 10 secs(The business team will be saying the time) do not save.
How to test and solve Data Duplication How to test and solve Data Duplication Reviewed by Animesh Chatterjee on November 25, 2010 Rating: 5

No comments:

Powered by Blogger.