Add unit tests for SPM.