Test script for QM