10 Mar 2011 @ 9:15 PM 

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
Posted By: Eusebiu Blindu
Last Edit: 10 Mar 2011 @ 09:15 PM

EmailPermalink
Tags
Categories: General


 

Responses to this post » (One Total)

 
  1. Jon says:

    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

Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


 Last 50 Posts
 Back
  • Users » 2
  • Posts/Pages » 141
  • Comments » 148
Change Theme...
  • VoidVoid
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight « Default

bug bounties

  • No categories

bug bounty

  • No categories

Bugs

  • No categories

Carnivals

  • No categories

challenge

  • No categories

Classic Tests

  • No categories

conferences

  • No categories