links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
VM Tests
Last updated at 11:04 pm UTC on 20 March 2007


Brian Rice (Google Account: BrianTRice)

Project Outline

We are comfortable that the VM behaves the same on all platforms, what is missing is verification that the platform dependent apis behave the same.
What needs to be done is
  1. identify all the external api in the standard VM across all the platforms (windows, mac, unix, risc). And document their behavior.
  2. write Sunits to test all the api interfaces.
  3. ensure each api does proper sanity checks to prevent a crash, or exploit.

Exupery has tests for most of the core VM functionality. They only test compiled code but should be easily extended to cover interpreted execution by subclassing and not compiling. The tests are in the class ExuperyStoryTests, a few tests are Exupery specific but they could be factored out.

In a normal Squeak system there are two ways of executing code, using the instruction simulator which the debugger uses for single stepping and running directly on the VM. With Exupery there are three ways to execute a method as it can be compiled to native code as well. Having a single set of tests that covered all three execution engines would be useful.

It's probably worthwhile separating bytecode testing (the raw interpreter) from primitives. A few primitives are so heavily used that they should be considered as bytecodes for testing but many are special purpose and not needed by all images. Primitives can also be used to interface with external systems so have testing complexities of their own.

Extra error handling in the VM may not be a good thing. For instance instance variable access bytecodes do
not check that the object contains enough instance variables, they will happily read after the end of the object. It's the responsibility of the bytecode compiler to generate good bytecodes. Making the VM re-do
those checks just adds a performance cost for no extra practical safety.

Technical Details

Benefits to the Student

Benefits to the Community