About the MagmaTester
Last updated at 2:38 am UTC on 24 August 2007
MagmaTestCase and MagmaCollectionTester test most of the functionality of Magma. If you make any changes to Magma code, it is highly recommended that you run these test suites as a regression check.
They test Magma in a multi-user fashion via the Ma Armored Code framework, using multiple Squeak images that may run on the same or different computers. OSProcess is recommended if you want the convenience running the entire test suite with "one-click".
Running the test
To test the class-evolution function, changes to test-classes MagmaContact and MagmaPerson are made. Extract these files to your image directory before running the tests.
MagmaContact.st
MagmaPerson.st
Then run the following:
MagmaTestCase kickoff
A warning message will appear describing what's about to happen. If present, OSProcess will be used to launch four images; "client1", "client2", "server" and "test-conductor".
On my circa-2004 laptop computer, the tests take over an hour to run.
Functions tested with the SUnit test scripts
The following functions are specifically tested by the SUnit test scripts. This proves that these functions work in at least one scenario. For more information, see MagmaTestCase and its subclass.
- commit and read many different kinds of objects including BlockContexts, MethodContexts, CompiledMethods, Projects, PasteUpMorphs, BookMorphs, SoundBuffers, Klatt and many others (see below, see also MaFixtureFactory).
- changed detection and automatic refreshing of one kind of object.
- class evolution, schema (add an instVar) and rename
- two separate disaster/recovery tests, one for corruption another for data-loss.
- buffer relocation; i.e., a Set grows or an instance variable added to a fixed object requires relocation of its buffer
- multiple-updates to the same object between a single transaction boundary for another client is correctly refreshed in that client
- concurrency tests, a refresh test
- ReadStrategy verification; to ensure Magma follows developer-suggested depths when reading objects
- extensive tests on MagmaCollections including various indexing tests
- Stale proxy auto-reconnecting tests
- Forwarding-proxy tests, including auto-connection.
- Magma database compression utility
- (too many more to keep this list up to date...)
It's important to understand that these tests run one particular scenario of each function. While I tried to make many of the scenarios robust instead of minimalist, it is still just one-scenario per function. For example, for the class-schema evolution test, it adds an instance variable to a superclass AND renames it at the same time.
In the real world, all scenarios are possible, it is therefore best to expect the unexpected.
More fundamental-level tests
Magma depends on the services of lower-level frameworks. These frameworks are assumed to work correctly for Magma to work correctly. Here are tests for the most critical supporting frameworks.
MaClientServerTester tests client-server module only, no Magma code is run.
MaClientServerTester kickoff
The following are standard SUnit testcases, runnable from the SUnit Test Runner browser:
- MaObjectSerializationTester tests the serialization module only, no client-server or Magma code is run.
- MakoTestCase tests the KryptOn security framework used by Magma.
- MaHashIndexTester and MaHashIndexRecordTester tests the back-end support for MagmaCollections at a lower-level. Both are medium-volume tests and may take a while to run.
- MaHashIndexRecordTester tests the formulas that enshape the MaHashIndexRecord structure.