Anatoliy Kolesnick
banner
kolesnick.bsky.social
Anatoliy Kolesnick
@kolesnick.bsky.social
✨ Making Unit Testing & Refactoring fun for developers
👨‍💻 20+ years as a Software Architect (.NET, Desktop/Web/Mobile/Game Dev)
🌐 Ex-Microsoft consultant, advisor to United Nations & World Bank
🔗 https://linktr.ee/kolesnick.eu
Do you have any ideas on how to further enhance it? Or perhaps ideas for another Kata? Share them! And if you manage to complete the maximal (extended and expanded) Kata in 30 minutes, let me know :) 🧵 15/15 👍
April 24, 2025 at 6:20 PM
I recommend adding these steps once you can complete the basic Kata within 30 minutes. 🧵 14/15 👇
April 24, 2025 at 6:20 PM

"//[===]
10===20===10"
-> 40

🧵 10/15 👇
April 24, 2025 at 6:20 PM
8️⃣ Ignore >1000. The calculator should ignore numbers greater than 1000.

"2,1001,2" -> 4

🧵 7/15 👇
April 24, 2025 at 6:20 PM
The extended version implies that you start the Kata as usual and follow the same rules. You complete the basic 7 steps and additionally proceed with 3 more steps, which I will describe below. Thus, your extended Kata will consist of 10 steps. 🧵 3/15 👇
April 24, 2025 at 6:20 PM
So, what do you think, is this analogy plausible or is it too far from the truth? 🧵 11/11 👍
April 23, 2025 at 6:13 PM
If Assert discovers a problem in the logic, the programmer fixes it and reruns the test, repeating the testing cycle. 🧵 8/11 👇
April 23, 2025 at 6:13 PM
Production is the most costly and interesting part of movie making. Act is the core part, where we execute the logic being tested. 🧵 5/11 👇
April 23, 2025 at 6:13 PM
This analogy came to mind when I was explaining why it is necessary to divide tests into Arrange Act Assert blocks. At that time, I chose not to elaborate it to avoid confusing you with excess information :) 🧵 2/11 👇
April 23, 2025 at 6:13 PM
The Arrange—Act—Assert blocks in a unit test represent such a convention, which not only enhances the readability of the test but also enforces best practices. However, that's a topic for another discussion. 🧵 8/8 👍
April 22, 2025 at 7:53 PM
Unfortunately, I couldn't find the exact study that stuck in my memory. However, I did find a very similar one from the year 1984: Empirical Studies of Programming Knowledge http://www.ics.uci.edu/~redmiles/inf233-FQ07/oldpapers/SollowayEhrlich.pdf 🧵 4/8 👇
April 22, 2025 at 7:53 PM
Good luck with your testing!
How often have you encountered false negative tests that missed real issues? 🧵 10/10 👍
April 21, 2025 at 1:33 PM
This situation can easily be avoided by writing an additional test to ensure the analyzed collection is not empty. For example: 🧵 7/10 👇
April 21, 2025 at 1:33 PM
The examples can go on, but I think you get the main idea. 🧵 4/10 👇
April 21, 2025 at 1:33 PM
This example concerns any test that "sifts" through certain elements to find the "bad" ones. Or a test that has test cases, which in turn are defined dynamically.
To make it clear, let me provide a few examples: 🧵 2/10 👇
April 21, 2025 at 1:33 PM
And you, do you strive to achieve 100% code coverage with tests, or do you choose what to test and what not? If so, could you share how you make this choice? 🧵 10/10 👍
April 18, 2025 at 1:04 PM
But if we're talking about a component responsible for loading the application, then if such handling stops working, firstly it won’t be immediately obvious and the code might easily slip into production. 🧵 6/10 👇
April 18, 2025 at 1:04 PM
The most important branches for you are the ones that would cause the most damage to the business if they start malfunctioning. Therefore, those are the branches you should cover with tests first, gradually moving to others that have less business impact. 🧵 2/10 👇
April 18, 2025 at 1:04 PM
How often do you refactor your code? Or has refactoring become an essential part of your programming habits? 🧵 11/11 👍
April 17, 2025 at 1:59 PM
4️⃣ I also suspect that some might have wanted to save time by skipping the intermediate refactoring, but I'm not entirely sure. 🧵 9/11 👇
April 17, 2025 at 1:59 PM