Machine define and apply with test