Spy is a flexible and open framework for designing and implementing program monitor. Spy enables test coverage, code profiling and type inference.
Note that code profiling require sensitive code instrumentation mechanism. Although we are putting a great deal of effort on the stability and reliability of this tool, it could however lead to a freeze and/or crash or your image.
Execution profiling:
More example related to execution profiling may be found in the class ProfilingPackageSpyProfilingPackageSpy
viewProfiling: [
| view |
view := MOViewRenderer new.
view nodes: (1 to: 100) forEach: [:each | view nodes: (1 to: 100)].
view root applyLayout
]
inPackage: 'Mondrian'
Extracting the type information of Moose from the unit test execution:
TypingPackageSpy runTestAndViewTypesForPackageNamed: ’Mondrian’
Test coverage may be also obtained. The following expression computes and render the test coverage of Moose:
CoveragePackageSpy viewCoverageForPackagesMatching: ’Mondrian*’
The source code may be browsed online and downloaded from http://www.squeaksource.com/Spy.html To install Spy, just do it:
Gofer new
squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfSpy';
load.(Smalltalk at: #ConfigurationOfSpy) perform: #loadDefault