I wanted to do a python script that compares two folders and checks differences in files, file size, permissions etc. Not only comparing a folder with another one in the same giving time, but also comparing the same folder with itself after some modifications were done, like a new build.
The purpose for that is to see potentials problems. If you identify a file that changed its size, you can then edit it and compare its content. For a log file it is expected to change, so you analyze that in a different way. But for other files the difference might be the key to see a failure.
There is a human instinct not to trust change, but still pursue it. The change is a new behavior, and new means unknown, or untested. People tend to go like cattle in similar directions because they assume someone else has done it before and its safe. So for example some shops has more visitors because other people saw there are many visitors. So they also go there, incrementing the visitors number.
As testers we have the same need. We need to check if the new stuff if its OK, if its safe.
Going back to my problem, that of comparing folders and checking the differences, because I didn’t understood the behavior change, I wanted to do somehow a time consuming python script.
But then I saw that following this steps:
ls -laR > folder1.txt
ls -laR> folder2.txt
diff folder1.txt folder2.txt
did the job.
It solved my problem and I gave up to an implementation that is universal (something that I can use in Windows maybe) or list the differences in a more human readable format.
That is partially because I am lazy
, but also because my purpose is to test, not to implement code. It is to take more responsibility to prevent the possible issues rather then creating stuff that only appears to be useful.
ShareThis

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Back
Void
Life
Earth
Wind
Water
Fire
Light « Default
Here is an equivalent in Windows though not native as it requires sed:
dir /B /S folder1 | sed “s/.*folder1\\//ig” > folder1.txt
dir /B /S folder2 | sed “s/.*folder2\\//ig” > folder2.txt