Testing for performance, part 1: Assess the problem space
Article one of a three part series just posted on SearchSoftwareQuality.com. Along with some heavy references to some PerfTestPlus materials (hey it's where I learned performance testing), it's got some tidbits from my experience and I think accurately reflects how I approach most of the projects I work now days. I welcome feedback.

Now all I have to do is write those other two parts... *sigh*
Build a list of all files in a directory structure in Ruby
When testing web services it's often nice to be able to process a set of XML files. In other automation it can be nice to process batches of files as well. For some reason I can never find the following code when I need it and I always have to re-code it from scratch. That's always good practice, but it's annoying when I need it quickly.


def getFiles(directory)
returnFiles = []
Dir.glob(directory + '/*').each do | file |
if File.file?(file) then
returnFiles.push(file)
else
returnFiles.push(getFiles(file))
end
end
return returnFiles
end



So there it is. Google can now help me find my code whenever I need to build a list of all files in a directory structure.

Here is an example of how I might use that:


getFiles("C:/Regression Files").each do | testCaseFile |
resultsFile.puts(testCaseFile.to_s.split('/')[-1].chomp +
', methodName, ' + object.methodName(testCaseFile))
end