# Best practices for combinging Juno debug and Test

**URL:** <https://discourse.julialang.org/t/best-practices-for-combinging-juno-debug-and-test/34371>\
**Category:** Juno\
**Tags:** debug\
**Created:** [February 9, 2020, 11:26am UTC](https://discourse.julialang.org/t/best-practices-for-combinging-juno-debug-and-test/34371 "2020-02-09T11:26:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marty0801](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marty0801/32/12715_2.png) [@marty0801](https://discourse.julialang.org/u/marty0801)\
**Post date:** [February 9, 2020, 11:26am UTC](https://discourse.julialang.org/t/best-practices-for-combinging-juno-debug-and-test/34371/1 "2020-02-09T11:26:08Z")

</div>

I’m developing a package called MyPkg in Juno with the following directory structure:

```julia
MyPkg/
- MyPkg.jl 
- test/
-- runtests.jl

```

How do I…

1. do test-driven development (using MyPkg/test/runtests.jl)  
AND
2. use the Juno debugger to easily debug functions executed by runtests  
easily?

I’d like to do both easily from the Juno console, but everything I’ve tried is awkward/broken. Rather than regurgitate all my failed approaches, would someone more experienced please explain how you set up your paths/environment/workflow to accomplish the above? Or if you think I’m asking the wrong question–meaning, there are better ways to test–please let me know what the right question is.

Note: I have already read the Julia Unit Test docs and Juno Debugging docs. Thanks!

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [February 9, 2020, 12:24pm UTC](https://discourse.julialang.org/t/best-practices-for-combinging-juno-debug-and-test/34371/2 "2020-02-09T12:24:00Z")

</div>

Did you see

[![](https://global.discourse-cdn.com/julialang/original/3X/c/d/cdeaf49ea8378ff205c081fa51f248103449e62b.jpeg "Using Juno for Interactive Test-Driven Julia Package Development") ](https://www.youtube.com/watch?v=i5iGVkI7XOI)

---

<div class="post-metadata">

**Author:** ![pbayer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbayer/32/11675_2.png) [@pbayer](https://discourse.julialang.org/u/pbayer)\
**Post date:** [February 9, 2020, 12:34pm UTC](https://discourse.julialang.org/t/best-practices-for-combinging-juno-debug-and-test/34371/3 "2020-02-09T12:34:09Z")

</div>

Roughly I follow the workflow as outlined by @ChrisRackauckas in [his video](https://www.youtube.com/watch?v=QVmU29rCjaA).

Honestly I quite never use the debugger. I have for my major source files test files, which I include in `runtests.jl`. There I try to cover every source code line with a test case (following the display in codecov and coveralls).

1. I work inside `MyPkg`, `activate .`, using Revise from my start script, then
2. after saving my source from I do in the repl `include("test/runtests.jl")`.
3. In case of a bug, I can directly (with one click) jump from the displayed stack trace to the source code, which is enough in 99.9% of the cases to fix it.

For sure there are better workflows and I’m curious to hear about them.

---

<div class="post-metadata">

**Author:** ![marty0801](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marty0801/32/12715_2.png) [@marty0801](https://discourse.julialang.org/u/marty0801)\
**Post date:** [February 29, 2020, 5:52pm UTC](https://discourse.julialang.org/t/best-practices-for-combinging-juno-debug-and-test/34371/4 "2020-02-29T17:52:59Z")

</div>

thank you! Exactly what I was missing.
