CodeTools[Profiling][Coverage] - Maple Programming Help

Home : Support : Online Help : Programming : Profiling : CodeTools Profiling Subpackage : Coverage : CodeTools/Profiling/Coverage/PercentSelect

CodeTools[Profiling][Coverage]

 PercentSelect
 select procedures based on their coverage percent

 Calling Sequence PercentSelect(proc1, proc1, ..., tab1, tab2, ..., opts)

Parameters

 proc1, proc2, ... - (optional) procedure tab1, tab2, ... - (optional) table of profiling data opts - (optional) equation(s) of the form option=value where option is one of the following 'compare', 'depth', or 'percent'; specify options for the PercentSelect command

Description

 • The PercentSelect() command selects from the procedures for which it has profiling data those procedures that satisfy the coverage percent comparison.
 The coverage percent of a procedure is the number of lines covered divided by the total number of lines in the procedure.
 • The PercentSelect(proc1, proc2, ...) command selects from the specified procedures, proc1, proc2, ..., those procedures that satisfy the coverage percent comparison.
 • The opts parameter can contain any of the following equations that specify options for the PercentSelect command.
 'compare'=procedure
 Specifies a comparison procedure.  The 'compare' option can be any boolean valued procedure that accepts two numeric arguments.  The first is the calculated coverage percentage, the second is the specified percentage.  By default, <= is used.
 'depth'=posint
 Specifies the number of times that a statement has to be executed to be considered covered.  A statement is considered covered if it is executed greater than or equal to a certain number of times.  The default is one.
 'percent'=numeric
 Specifies the percentage to which to compare.  It is specified as a number in the range 0 to 1. The default is 0.5.
 • PercentSelect reads profiling data from currently profiled procedures and from any specified tables of profiling data.  If a procedure appears more than once in any of these sources, the profiles are joined together (as in Merge) and the data from the merged profiles is used.
 • PercentSelect returns a table containing the profiling data for the selected procedures.

Examples

 > $\mathrm{with}\left(\mathrm{CodeTools}\left[\mathrm{Profiling}\right]\right):$
 > $\mathrm{t1}≔\mathrm{Build}\left(\mathrm{commands}='\mathrm{limit}\left(\frac{\mathrm{sin}\left(x\right)}{x},x=0\right)'\right):$
 > $\mathrm{Coverage}\left[\mathrm{Percent}\right]\left(\mathrm{t1}\right)$
 signum 9.86% tools/eval_foo/do 35.71% limit/MrvRight0 45.45% tools/truncateSeries 23.81% type/arctrig 66.67% tools/eval_foo 59.09% limit/mrv/MrvLeadTerm0 10.46% limit/MrvRight 100.00% ListTools:-Reverse 100.00% limit/mrv/mrv 100.00% anames 100.00% @ 26.83% limit/mrv/PreProcess0 46.67% forget:-ModuleApply 44.00% type/simplify/* 100.00% type/taylor 100.00% series/trig 50.00% expand/sin 18.75% type/freeof 60.00% factor 2.56% limit/mrv/compare 100.00% simplify/size/length 100.00% series/frontend 100.00% simplify/trig 39.26% limit/ThawRange 100.00% collect 57.14% limit/mrv/LeadingExpon 37.50% combine/power 31.43% tools/map/function 37.50% limit/dosubs 42.31% type/point 50.00% simplify/nosize 100.00% type/nothing 100.00% forget:-do_unread 66.67% trig/normal 3.28% depends:-Main 36.67% limit/mrv/mrv0 47.06% depends:-ModuleApply 71.43% combine 51.52% limit 19.03% expand/cos 18.75% forget:-forget_proc 51.85% simplify/normal/check 23.33% collect/recursive 8.70% series/leadterm 46.51% PackageManagement:-pmember 11.76% hasassumptions 50.00% limit/limit/piecewise 12.00% type/polynom 53.85% limit/mrv/limsimpl 28.89% simplify 26.92% type/laurent 100.00% trig/linear_in_Pi 50.00% tools/sign 19.05% packages 100.00% limit/mrv/EXP 75.00% combine/cmbpwr 53.85% simplify/normal 38.46% sin/normal 57.14% type/algnum 33.33% limit/MrvRight/limsimp 58.33% type/SymbolicInfinity 100.00% limit/mrv/compare0 16.67% limit/MrvLimit0 42.86% ceil 10.26% limit/return 75.00% tools/map 4.44% simplify/trig/multiply_and_choose 80.00% limit/topright 14.08% simplify/do 16.00% simplify/RootOf 10.64% type/builtin 100.00% tools/membertype 100.00% limit/IndetsRange 100.00% type/simplify/+ 100.00% limit/MrvLimit 12.64% limit/mrv/Testzero 3.85% simplify/trig/recurse 25.00% combine/wrt 64.71% limit/mrv/MrvLeadTerm 100.00% convert/sincos 50.00% type/arctrigh 66.67% series/sin 75.00% limit/easy 52.94% limit/left=right 7.14% type/suffixed 8.57%
 > $\mathrm{t2}≔\mathrm{Coverage}\left[\mathrm{PercentSelect}\right]\left(\mathrm{t1},'\mathrm{percent}'=0.3\right):$
 > $\mathrm{Coverage}\left[\mathrm{Percent}\right]\left(\mathrm{t2}\right)$
 signum 9.86% tools/truncateSeries 23.81% limit/mrv/MrvLeadTerm0 10.46% @ 26.83% expand/sin 18.75% factor 2.56% trig/normal 3.28% limit 19.03% expand/cos 18.75% simplify/normal/check 23.33% collect/recursive 8.70% PackageManagement:-pmember 11.76% limit/limit/piecewise 12.00% limit/mrv/limsimpl 28.89% simplify 26.92% tools/sign 19.05% limit/mrv/compare0 16.67% ceil 10.26% tools/map 4.44% limit/topright 14.08% simplify/do 16.00% simplify/RootOf 10.64% limit/MrvLimit 12.64% limit/mrv/Testzero 3.85% simplify/trig/recurse 25.00% limit/left=right 7.14% type/suffixed 8.57%
 > $\mathrm{t2}≔\mathrm{Coverage}\left[\mathrm{PercentSelect}\right]\left(\mathrm{t1}\right):$
 > $\mathrm{Coverage}\left[\mathrm{Percent}\right]\left(\mathrm{t2}\right)$
 signum 9.86% tools/eval_foo/do 35.71% limit/MrvRight0 45.45% tools/truncateSeries 23.81% limit/mrv/MrvLeadTerm0 10.46% @ 26.83% limit/mrv/PreProcess0 46.67% forget:-ModuleApply 44.00% series/trig 50.00% expand/sin 18.75% factor 2.56% simplify/trig 39.26% limit/mrv/LeadingExpon 37.50% combine/power 31.43% tools/map/function 37.50% limit/dosubs 42.31% type/point 50.00% trig/normal 3.28% depends:-Main 36.67% limit/mrv/mrv0 47.06% limit 19.03% expand/cos 18.75% simplify/normal/check 23.33% collect/recursive 8.70% series/leadterm 46.51% PackageManagement:-pmember 11.76% hasassumptions 50.00% limit/limit/piecewise 12.00% limit/mrv/limsimpl 28.89% simplify 26.92% trig/linear_in_Pi 50.00% tools/sign 19.05% simplify/normal 38.46% type/algnum 33.33% limit/mrv/compare0 16.67% limit/MrvLimit0 42.86% ceil 10.26% tools/map 4.44% limit/topright 14.08% simplify/do 16.00% simplify/RootOf 10.64% limit/MrvLimit 12.64% limit/mrv/Testzero 3.85% simplify/trig/recurse 25.00% convert/sincos 50.00% limit/left=right 7.14% type/suffixed 8.57%
 > $\mathrm{t2}≔\mathrm{Coverage}\left[\mathrm{PercentSelect}\right]\left(\mathrm{t1},'\mathrm{percent}'=0.80\right):$
 > $\mathrm{Coverage}\left[\mathrm{Percent}\right]\left(\mathrm{t2}\right)$
 signum 9.86% tools/eval_foo/do 35.71% limit/MrvRight0 45.45% tools/truncateSeries 23.81% type/arctrig 66.67% tools/eval_foo 59.09% limit/mrv/MrvLeadTerm0 10.46% @ 26.83% limit/mrv/PreProcess0 46.67% forget:-ModuleApply 44.00% series/trig 50.00% expand/sin 18.75% type/freeof 60.00% factor 2.56% simplify/trig 39.26% collect 57.14% limit/mrv/LeadingExpon 37.50% combine/power 31.43% tools/map/function 37.50% limit/dosubs 42.31% type/point 50.00% forget:-do_unread 66.67% trig/normal 3.28% depends:-Main 36.67% limit/mrv/mrv0 47.06% depends:-ModuleApply 71.43% combine 51.52% limit 19.03% expand/cos 18.75% forget:-forget_proc 51.85% simplify/normal/check 23.33% collect/recursive 8.70% series/leadterm 46.51% PackageManagement:-pmember 11.76% hasassumptions 50.00% limit/limit/piecewise 12.00% type/polynom 53.85% limit/mrv/limsimpl 28.89% simplify 26.92% trig/linear_in_Pi 50.00% tools/sign 19.05% limit/mrv/EXP 75.00% combine/cmbpwr 53.85% simplify/normal 38.46% sin/normal 57.14% type/algnum 33.33% limit/MrvRight/limsimp 58.33% limit/mrv/compare0 16.67% limit/MrvLimit0 42.86% ceil 10.26% limit/return 75.00% tools/map 4.44% simplify/trig/multiply_and_choose 80.00% limit/topright 14.08% simplify/do 16.00% simplify/RootOf 10.64% limit/MrvLimit 12.64% limit/mrv/Testzero 3.85% simplify/trig/recurse 25.00% combine/wrt 64.71% convert/sincos 50.00% type/arctrigh 66.67% series/sin 75.00% limit/easy 52.94% limit/left=right 7.14% type/suffixed 8.57%
 > $\mathrm{t2}≔\mathrm{Coverage}\left[\mathrm{PercentSelect}\right]\left(\mathrm{t1},'\mathrm{percent}'=0.80,'\mathrm{compare}'=\mathrm{>}\right):$
 > $\mathrm{Coverage}\left[\mathrm{Percent}\right]\left(\mathrm{t2}\right)$
 limit/MrvRight 100.00% ListTools:-Reverse 100.00% limit/mrv/mrv 100.00% anames 100.00% type/simplify/* 100.00% type/taylor 100.00% limit/mrv/compare 100.00% simplify/size/length 100.00% series/frontend 100.00% limit/ThawRange 100.00% simplify/nosize 100.00% type/nothing 100.00% type/laurent 100.00% packages 100.00% type/SymbolicInfinity 100.00% type/builtin 100.00% tools/membertype 100.00% limit/IndetsRange 100.00% type/simplify/+ 100.00% limit/mrv/MrvLeadTerm 100.00%
 > $\mathrm{Coverage}\left[\mathrm{Percent}\right]\left(\mathrm{t1},'\mathrm{depth}'=2\right)$
 signum 9.86% tools/eval_foo/do 0.00% limit/MrvRight0 0.00% tools/truncateSeries 23.81% type/arctrig 66.67% tools/eval_foo 4.55% limit/mrv/MrvLeadTerm0 0.42% limit/MrvRight 100.00% ListTools:-Reverse 0.00% limit/mrv/mrv 100.00% anames 100.00% @ 2.44% limit/mrv/PreProcess0 46.67% forget:-ModuleApply 0.00% type/simplify/* 0.00% type/taylor 100.00% series/trig 45.45% expand/sin 0.00% type/freeof 60.00% factor 0.00% limit/mrv/compare 0.00% simplify/size/length 100.00% series/frontend 100.00% simplify/trig 2.22% limit/ThawRange 100.00% collect 57.14% limit/mrv/LeadingExpon 0.00% combine/power 3.57% tools/map/function 0.00% limit/dosubs 42.31% type/point 0.00% simplify/nosize 100.00% type/nothing 100.00% forget:-do_unread 0.00% trig/normal 3.28% depends:-Main 36.67% limit/mrv/mrv0 8.82% depends:-ModuleApply 57.14% combine 51.52% limit 0.00% expand/cos 0.00% forget:-forget_proc 0.00% simplify/normal/check 3.33% collect/recursive 8.70% series/leadterm 9.30% PackageManagement:-pmember 0.00% hasassumptions 0.00% limit/limit/piecewise 12.00% type/polynom 7.69% limit/mrv/limsimpl 17.78% simplify 26.92% type/laurent 100.00% trig/linear_in_Pi 50.00% tools/sign 19.05% packages 0.00% limit/mrv/EXP 0.00% combine/cmbpwr 0.00% simplify/normal 38.46% sin/normal 57.14% type/algnum 0.00% limit/MrvRight/limsimp 0.00% type/SymbolicInfinity 100.00% limit/mrv/compare0 0.00% limit/MrvLimit0 0.00% ceil 10.26% limit/return 0.00% tools/map 0.00% simplify/trig/multiply_and_choose 0.00% limit/topright 14.08% simplify/do 16.00% simplify/RootOf 0.00% type/builtin 0.00% tools/membertype 100.00% limit/IndetsRange 0.00% type/simplify/+ 0.00% limit/MrvLimit 0.00% limit/mrv/Testzero 3.85% simplify/trig/recurse 0.00% combine/wrt 64.71% limit/mrv/MrvLeadTerm 100.00% convert/sincos 0.00% type/arctrigh 0.00% series/sin 75.00% limit/easy 0.00% limit/left=right 0.00% type/suffixed 0.00%
 > $\mathrm{t2}≔\mathrm{Coverage}\left[\mathrm{PercentSelect}\right]\left(\mathrm{t1},'\mathrm{depth}'=2,'\mathrm{percent}'=0.3\right):$
 > $\mathrm{Coverage}\left[\mathrm{Percent}\right]\left(\mathrm{t2},'\mathrm{depth}'=2\right)$
 signum 9.86% tools/eval_foo/do 0.00% limit/MrvRight0 0.00% tools/truncateSeries 23.81% tools/eval_foo 4.55% limit/mrv/MrvLeadTerm0 0.42% ListTools:-Reverse 0.00% @ 2.44% forget:-ModuleApply 0.00% type/simplify/* 0.00% expand/sin 0.00% factor 0.00% limit/mrv/compare 0.00% simplify/trig 2.22% limit/mrv/LeadingExpon 0.00% combine/power 3.57% tools/map/function 0.00% type/point 0.00% forget:-do_unread 0.00% trig/normal 3.28% limit/mrv/mrv0 8.82% limit 0.00% expand/cos 0.00% forget:-forget_proc 0.00% simplify/normal/check 3.33% collect/recursive 8.70% series/leadterm 9.30% PackageManagement:-pmember 0.00% hasassumptions 0.00% limit/limit/piecewise 12.00% type/polynom 7.69% limit/mrv/limsimpl 17.78% simplify 26.92% tools/sign 19.05% packages 0.00% limit/mrv/EXP 0.00% combine/cmbpwr 0.00% type/algnum 0.00% limit/MrvRight/limsimp 0.00% limit/mrv/compare0 0.00% limit/MrvLimit0 0.00% ceil 10.26% limit/return 0.00% tools/map 0.00% simplify/trig/multiply_and_choose 0.00% limit/topright 14.08% simplify/do 16.00% simplify/RootOf 0.00% type/builtin 0.00% limit/IndetsRange 0.00% type/simplify/+ 0.00% limit/MrvLimit 0.00% limit/mrv/Testzero 3.85% simplify/trig/recurse 0.00% convert/sincos 0.00% type/arctrigh 0.00% limit/easy 0.00% limit/left=right 0.00% type/suffixed 0.00%
 > $\mathrm{t2}≔\mathrm{Coverage}\left[\mathrm{PercentSelect}\right]\left(\mathrm{t1},'\mathrm{depth}'=2,'\mathrm{compare}'=\mathrm{=}\right):$
 > $\mathrm{Coverage}\left[\mathrm{Percent}\right]\left(\mathrm{t2},'\mathrm{depth}'=2\right)$
 trig/linear_in_Pi 50.00%
 > $\mathrm{t2}≔\mathrm{Coverage}\left[\mathrm{PercentSelect}\right]\left(\mathrm{t1},'\mathrm{depth}'=2,'\mathrm{percent}'=0.80\right):$
 > $\mathrm{Coverage}\left[\mathrm{Percent}\right]\left(\mathrm{t2},'\mathrm{depth}'=2\right)$
 signum 9.86% tools/eval_foo/do 0.00% limit/MrvRight0 0.00% tools/truncateSeries 23.81% type/arctrig 66.67% tools/eval_foo 4.55% limit/mrv/MrvLeadTerm0 0.42% ListTools:-Reverse 0.00% @ 2.44% limit/mrv/PreProcess0 46.67% forget:-ModuleApply 0.00% type/simplify/* 0.00% series/trig 45.45% expand/sin 0.00% type/freeof 60.00% factor 0.00% limit/mrv/compare 0.00% simplify/trig 2.22% collect 57.14% limit/mrv/LeadingExpon 0.00% combine/power 3.57% tools/map/function 0.00% limit/dosubs 42.31% type/point 0.00% forget:-do_unread 0.00% trig/normal 3.28% depends:-Main 36.67% limit/mrv/mrv0 8.82% depends:-ModuleApply 57.14% combine 51.52% limit 0.00% expand/cos 0.00% forget:-forget_proc 0.00% simplify/normal/check 3.33% collect/recursive 8.70% series/leadterm 9.30% PackageManagement:-pmember 0.00% hasassumptions 0.00% limit/limit/piecewise 12.00% type/polynom 7.69% limit/mrv/limsimpl 17.78% simplify 26.92% trig/linear_in_Pi 50.00% tools/sign 19.05% packages 0.00% limit/mrv/EXP 0.00% combine/cmbpwr 0.00% simplify/normal 38.46% sin/normal 57.14% type/algnum 0.00% limit/MrvRight/limsimp 0.00% limit/mrv/compare0 0.00% limit/MrvLimit0 0.00% ceil 10.26% limit/return 0.00% tools/map 0.00% simplify/trig/multiply_and_choose 0.00% limit/topright 14.08% simplify/do 16.00% simplify/RootOf 0.00% type/builtin 0.00% limit/IndetsRange 0.00% type/simplify/+ 0.00% limit/MrvLimit 0.00% limit/mrv/Testzero 3.85% simplify/trig/recurse 0.00% combine/wrt 64.71% convert/sincos 0.00% type/arctrigh 0.00% series/sin 75.00% limit/easy 0.00% limit/left=right 0.00% type/suffixed 0.00%