Christmas is here! 🎅
Your journey as a developer has probably taken many turns.
You probably had to troubleshoot and refactor a piece of code that you still have nightmares about.
You might have been stuck in a team when you never have time to improve your code base
because "We have to deliver more features"
.
Heck, you probably still are.
We feel you, and in the spirit of Christmas, you deserve a gift.
We have the privilege this year to bring to you the Advent of Craft. This is a journey into software craftsmanship.
Each day, you will be taken in a small aspect of software craftsmanship
. Each day, you will
have an exercise with a topic
to look at in a small bite approach and hopefully you will learn something
.
From refactoring to testing to reviewing, all aspects are going to be explored.
The objective of this journey is to learn new crafts and share with your peers, not to get lost in impossible algorithm exercises or to finish as fast as you can using chatGPT.
A repository is available and each day a topic will appear with a proposed solution for the day before.
We hope you enjoy the ride. Happy Crafting!
To facilitate the communication around challenges you can join us on Discord
by simply
clicking here.
Here are the instructions for the journey
Here are the different challenges :
- Day 1: Make your production code easier to understand.
- Day 2: One level of indentation.
- Day 3: One dot per line.
- Day 4: Identify the behavior under test and rewrite the tests.
- Day 5: No "for" loop authorized.
- Day 6: Parameterize your tests.
- Day 7: Simplify the run method by extracting the right behavior.
- Day 8: Using TDD rules, write a password validation program.
- Day 9: Fix the code.
- Day 10: Dot not use "if" statement.
- Day 11: Gather a dependency freshness metric.
- Day 12: Make your code open for extension.
- Day 13: Find a way to eliminate the irrelevant, and amplify the essentials of those tests.
- Day 14: Do not use exceptions anymore.
- Day 15: Put a code under tests.
- Day 16: Make this code immutable.
- Day 17: Design one test that has the impact of thousands.
- Day 18: Automatically detect Linguistic Anti-Patterns (LAP).
- Day 19: Loosing up dead weight.
- Day 20: No more exceptions in our domain.
- Day 21: Refactor the tests and production code to Output-Based tests.
- Day 22: Design a diamond program using T.D.D and Property-Based Testing.
- Day 23: Refactor the code after putting it under test.
- Day 24: Write the most complicated code you can.
- Day 25: Share with the world what you have learned.
A solution proposal will be published here every day during the Advent Of Craft
containing the code
and
a step by step
guide.
- Day 1: Make your production code easier to understand.
- Day 2: One level of indentation.
- Day 3: One dot per line.
- Day 4: Identify the behavior under test and rewrite the tests.
- Day 5: No "for" loop authorized.
- Day 6: Parameterize your tests.
- Day 7: Simplify the run method by extracting the right behavior.
- Day 8: Using TDD rules, write a password validation program.
- Day 9: Fix the code.
- Day 10: Dot not use "if" statement.
- Day 11: Gather a dependency freshness metric.
- Day 12: Make your code open for extension.
- Day 13: Find a way to eliminate the irrelevant, and amplify the essentials of those tests.
- Day 14: Do not use exceptions anymore.
- Day 15: Put a code under tests.
- Day 16: Make this code immutable.
- Day 17: Design one test that has the impact of thousands.
- Day 18: Automatically detect Linguistic Anti-Patterns (LAP).
- Day 19: Loosing up dead weight.
- Day 20: No more exceptions in our domain.
- Day 21: Refactor the tests and production code to Output-Based tests.
- Day 22: Design a diamond program using T.D.D and Property-Based Testing.
- Day 23: Refactor the code after putting it under test.
- Day 24: Write the most complicated code you can.
We have designed several learning paths
based on the challenges that you can follow if you want to deep dive into a
given concept:
Here are the libraries we use in the different days per supported language:
Topic | java | C# | kotlin | typescript |
---|---|---|---|---|
Test framework | junit | xUnit | Kotest | jest |
Fluent assertions | assertJ | FluentAssertions | Native kotest assertions |
Native jest assertions |
Mocking | mockito | NSubstitute | mockk | Native jest mocking features |
Approval testing | approvalTests | Verify.xUnit | approvalTests | approvals |
Property-Based testing | vavr-test | FSCheck | kotest-property | fast-check |
Fake data generator | instancio | Bogus | Not used | fakerjs |
Architecture tests | archunit | TngTech.ArchUnitNET.xUnit | archunit | N/A |
Functional library | vavr | LanguageExt.Core | arrow-kt | fp-ts |
Functional assertions | assertj-vavr | FluentAssertions.LanguageExt | kotest-extensions-arrow | Native jest assertions |
Yoan Thirion |
Yann Courtel |