> For the complete documentation index, see [llms.txt](https://yoan-thirion.gitbook.io/knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yoan-thirion.gitbook.io/knowledge-base/software-craftsmanship/testing/clean-tests.md).

# Clean Tests

### Connection - Mythbusters

Connect participants to the topic by making them relate on Facts and Myths regarding Unit Tests

![](/files/E4v6mBbwTJrRnkSLPyBw)

Debriefing is available in the slide deck

### Concepts

![](/files/4qEq1gX5tksHq8hVAQKv)Before going further regarding the concepts, invite them to reflect on they define :

* What is a Unit ?
* Which tests they would write on the giving piece of code ?
* How they would write it ?

![](/files/P1XR8jaty8IHbj7UFDqw)

Then explain all those concepts :

* Schools of testing
* Pillars of Good Unit Tests
* FIRST Principles
* Anatomy of Unit Tests
* How to name your Unit Tests
* Styles of Code

![](/files/DTM5wUnwr1CdD6zKupZl)

### Concrete Practice - Anti-Patterns

In groups, make them identify Unit Tests anti-patterns by using Code snippets or the repository provided in this page.

![](/files/o141GwRqKzLlnE8DTTDw)

You can debrief it directly on the Miro board or from the slides :

![](/files/B6hoHN6JcQABHimUwcy1)

![](/files/nAb9VP7A4PF6XBeQMpaV)

My identification logic and refactoring are explained in this step-by-step guide :&#x20;

{% embed url="<https://github.com/ythirion/clean-tests/blob/master/java/src/test/java/antipatterns/solution/step-by-step.md>" %}

### Conclusion

![](/files/4oLiSen0j8nuNOBnuLov)

### Resources

* Repository is available here : <https://github.com/ythirion/clean-tests>
* You can use the miro board here to facilitate this session : <https://miro.com/app/board/o9J_lpq9YGo=/?invite_link_id=764775433309>
* Slides are available here on speakerdeck :&#x20;

{% embed url="<https://speakerdeck.com/thirion/clean-tests>" %}
Clean Tests slides
{% endembed %}

* A lot of stuff from this workshop comes from the book "Unit Testing : Principles, Practices, and Patterns"by [Vladimir Khorikov](https://enterprisecraftsmanship.com/)

![](/files/vt2T5ifDcw0icgUEBPIu)
