Spy

You are here:

Spy is a flexible and open framework for designing and implementing program monitor. Spy enables test coverage, code profiling and type inference.

Code example:

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:

ProfilingPackageSpy 
viewProfiling: [
| view |
view := MOViewRenderer new.
view nodes: (1 to: 100) forEach: [:each | view nodes: (1 to: 100)].
view root applyLayout
]
inPackage: 'Mondrian'

More example related to execution profiling may be found in the class ProfilingPackageSpy

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*’ 

Download

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

License: BSD