# Throwaway types in tests

**URL:** https://discourse.julialang.org/t/throwaway-types-in-tests/4831
**Category:** General Usage
**Tags:** question
**Created:** [July 13, 2017, 8:58am UTC](https://discourse.julialang.org/t/throwaway-types-in-tests/4831 "2017-07-13T08:58:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [July 13, 2017, 8:58am UTC](https://discourse.julialang.org/t/throwaway-types-in-tests/4831/1 "2017-07-13T08:58:42Z")

</div>

For some unit tests, I find it advantageous to define various types which mimic some interface I want to test, and possibly provide additional functionality useful for debugging (eg a callable `struct` in place of a function, which collects the arguments it was called with).

However, since types are global (within a module), my namespace gets very rich quickly (which I don’t like as a matter of principle for unit tests), and when I am working on the tests interactively, redefinition is problematic.

What’s the most convenient workflow at the moment for this? Should I write a submodule for each type?
