From: Simon Strandgaard Date: 2004-03-22T08:09:31+09:00 Subject: Re: [ann] coverage 0.1 On Mon, 22 Mar 2004 07:45:26 +0900, Robert Feldt wrote: > Simon Strandgaard wrote: > >>Ruby - Coverage >> >> >> > Just wanted to note that you have some users of this... > > The students in my "Requirements Engineering and Verification and > Validation" course have done statement coverage analysis while testing. > They used a script based on a previous version of yours. > awesome, I have only played with it as an experiment. I have never thought it was being used. I feel bad making packages without doing test-first and supplying a testsuite to ensure the quality and robustness. Batsman reminded me that I had this experimental package.. I had completely forgotten about it (my brain contains only regexp+book). Sorry. I better make it more usable ;-) BTW: Any ideas how to test the outputted webpages ? > BTW, there is a rather delicate issue you might want to address: which > rb files not to include in the analysis. My students used this when > running their tests to see how well the tests covered the code. They > found that all required files are included though, even std rb files > like the ones in the lib needed for unit testing etc. Default might be > to exclude these files. Batsman has been kind to fix it. The problem was that #add_file, added too many files ;-) def add_file(file, line_marked) percent = calc_coverage(line_marked) path = File.expand_path(file) return nil if path =~ /\A#{Regexp.escape(CONFIG["rubylibdir"])}/ return nil if path =~ /\A#{Regexp.escape(CONFIG["sitelibdir"])}/ > Also they mentioned that the html files should be saved to a dir local > to where the script is run and not in the absolute path of the > corresponding rb file. A local dir.. I will add that to the todo list right away. Will fix this tonight if im not getting too tired. > Maybe you have already fixed these issues... yes/no. Thanks for the suggestions. > BTW, I hacked up something similar to nounit.sf.net for them to use in > their project but never had the time to finish it. Maybe we should merge > our efforts into some kind of test evaluation package? > I will check that project out. Merge.. Sounds good. BTW: does there exists any static analysis tools for Ruby ? -- Simon Strandgaard