Test stub improvements

Remaining improvements for #504

<!---
@huboard:{"order":252.0,"milestone_order":1006,"custom_state":""}
-->