# File organization and naming for tests

**URL:** <https://discourse.julialang.org/t/file-organization-and-naming-for-tests/24028>\
**Category:** General Usage\
**Tags:** question\
**Created:** [May 9, 2019, 12:53pm UTC](https://discourse.julialang.org/t/file-organization-and-naming-for-tests/24028 "2019-05-09T12:53:25Z")\
**Posts on this page:** 2\
**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:** [May 9, 2019, 12:53pm UTC](https://discourse.julialang.org/t/file-organization-and-naming-for-tests/24028/1 "2019-05-09T12:53:26Z")

</div>

I am looking for a way of organizing `test/` directories for large projects, mainly because if I settled on a way then I would not have to think about it 😉 (I found [this topic](https://discourse.julialang.org/t/rfc-test-file-organization-proposal/1170) which is loosely related.)

To make things concrete, suppose there is a project with

```nohighlight
src/
    Paper.jl
    parameters.jl
    model.jl
    solution.jl
    inference.jl

```

I generally would have a test file for each file in the `src/`, and in `test` I would also need some code, let’s call it `utilities.jl`, which just sets up simulated parameters and data. Eg possibly

```nohighlight
test/
    runtests.jl
    support/
        utilities.jl
    parameters.jl
    model.jl
    solution.jl
    inference.jl

```

Some questions I am thinking about:

1. whether test utilities should go into a separate directory, or even _multiple_ directories, and what to name them,

2. whether filenames should be the same for code and tests, or prefix tests with eg `test_`.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [May 9, 2019, 12:59pm UTC](https://discourse.julialang.org/t/file-organization-and-naming-for-tests/24028/2 "2019-05-09T12:59:48Z")

</div>

> [@Tamas\_Papp](#):
>
> whether filenames should be the same for code and tests, or prefix tests with eg `test_` .

I don’t really have any input for the full question, but I think it is easier to identify problems when the filenames differ, e.g. when quickly looking at a stacktrace from an error.
