<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pietro Di Bello on Medium]]></title>
        <description><![CDATA[Stories by Pietro Di Bello on Medium]]></description>
        <link>https://medium.com/@pierodibello?source=rss-fa11d2cf58d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UjlFllEOuZWUMYrKAzpmlw.png</url>
            <title>Stories by Pietro Di Bello on Medium</title>
            <link>https://medium.com/@pierodibello?source=rss-fa11d2cf58d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 21:46:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pierodibello/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why you should prefer T::from(U) over U.into()]]></title>
            <link>https://pierodibello.medium.com/from-me-to-you-prefer-t-from-u-over-u-into-in-rust-e66f7067cf8a?source=rss-fa11d2cf58d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e66f7067cf8a</guid>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[rustlang]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[opinion]]></category>
            <dc:creator><![CDATA[Pietro Di Bello]]></dc:creator>
            <pubDate>Sat, 09 Nov 2024 18:59:39 GMT</pubDate>
            <atom:updated>2024-11-11T22:32:30.032Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Disclaimer: This is my first article on Rust, and I’m still a beginner learning the nuances of the language. If you have any feedback, suggestions, or differing opinions, I would love to hear them. Your insights will help me learn and grow as a Rustacean!</em></p><p>When writing Rust code, choosing between using T::from(U) and U.into() for type conversions significantly impacts readability and code navigation. I want to propose here to prefer T::from(U) over U.into() as it can lead to better code readability, discoverability, and reduces the cognitive load required when reading code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bUHbAVFJRjxW8gJNO9YXkg.png" /><figcaption>Discoverability and readability are two very important qualities you should strive to achieve in your code.</figcaption></figure><h3>Example: T::from(U) vs. U.into()</h3><p>Consider the following example:</p><pre>fn main() {<br>    let user = User {<br>        name: &quot;Alice&quot;.to_owned(),<br>        age: 30,<br>    };<br>    let s = String::from(user);<br>    println!(&quot;{}&quot;, s);<br>}<br><br>struct User {<br>    name: String,<br>    age: u32,<br>}<br><br>impl From&lt;User&gt; for String {<br>    fn from(user: User) -&gt; String {<br>        format!(&quot;{} ({})&quot;, user.name, user.age)<br>    }<br>}</pre><p>In this snippet, let s = String::from(user); explicitly converts a User into a String. This makes the conversion type clear, but more importantly, <strong>it makes it easier for developers to navigate to the implementation of the </strong><strong>From function</strong>, which is crucial for understanding how the conversion is performed.</p><p>If we instead use user.into(), the code would look like this:</p><pre>fn main() {<br>    let user = User {<br>        name: &quot;Alice&quot;.to_owned(),<br>        age: 30,<br>    };<br>    let s: String = user.into();<br>    println!(&quot;{}&quot;, s);<br>}</pre><p>With user.into(), navigating to the actual implementation of the From function can be very difficult, as an IDE will often direct you to the generic Rust implementation of the into method rather than the specific From implementation.</p><h3>Advantages of Using T::from(U)</h3><p>To recap, the main benefits of using the from function are:</p><ol><li><strong>Code Navigation</strong>: IDEs can easily locate the From implementation, which helps in understanding how the conversion is performed. This is especially important when working with custom types.</li><li><strong>Readability</strong>: Explicitly specifying the target type (T::from(U)) makes the code easier to read, improving comprehension in more complex or unfamiliar codebases.</li><li><strong>Explicit Implementation</strong>: String::from(user) makes it clear which type the conversion is targeting, enhancing readability and reducing ambiguity.</li></ol><h3>Considering Alternatives: Explicit Into Implementation and Custom Conversion Functions</h3><p>Someone might ask: what about implementing the Into trait explicitly when you need to use into(), so that navigating from usage to definition is easier with any good IDE?</p><p>Let’s see:</p><pre>fn main() {<br>    let user = User {<br>        name: &quot;Alice&quot;.to_owned(),<br>        age: 30,<br>    };<br>    let s: String = user.into();<br>    println!(&quot;{}&quot;, s);<br>}<br><br>// Let&#39;s replace the From implementation with an Into implementation:<br>impl Into&lt;String&gt; for User {<br>    fn into(self) -&gt; String {<br>        format!(&quot;{} ({})&quot;, self.name, self.age)<br>    }<br>}</pre><p>It works! You might think this is a clever workaround.</p><p>Wait, there’s a problem, and its name is Clippy:</p><pre>warning: an implementation of `From` is preferred since it gives you `Into&lt;_&gt;` for free where the reverse isn&#39;t true<br>  --&gt; src/main.rs:15:1<br>   |<br>15 | impl Into&lt;String&gt; for User {<br>   | ^^^^^^^^^^^^^^^^^^^^^^^^^^<br>   |<br>...<br>help: replace the `Into` implementation with `From&lt;User&gt;`</pre><p>So, yes, you could do that, but you should be ready to ignore this Clippy rule.</p><p>Another approach — which is still reasonable — is to not rely on the From / Into traits to implement your type conversion logic, but instead implement a custom function. Pros: easier navigation from usage to implementation and vice versa. Cons: it’s less idiomatic for Rust and may reduce consistency with community practices.</p><h3>Conclusion</h3><p>In conclusion, while both T::from(U) and U.into() are valid ways to handle type conversions in Rust, the choice between them can significantly impact the readability, maintainability, and discoverability of your code. Preferring T::from(U) makes your code more explicit, enhances navigation, and aligns well with idiomatic Rust practices.</p><p>While alternatives like explicit Into implementations or custom conversion functions can work, they come with trade-offs that can complicate code maintenance or diverge from community conventions. By adopting T::from(U) where possible, you make your code easier to understand for others and yourself, ultimately leading to more robust and maintainable software.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e66f7067cf8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Highlights from the first four days in Casavo]]></title>
            <link>https://pierodibello.medium.com/highlights-from-the-first-four-days-in-casavo-769b8b50cab1?source=rss-fa11d2cf58d------2</link>
            <guid isPermaLink="false">https://medium.com/p/769b8b50cab1</guid>
            <dc:creator><![CDATA[Pietro Di Bello]]></dc:creator>
            <pubDate>Mon, 10 Jan 2022 16:43:08 GMT</pubDate>
            <atom:updated>2022-01-11T20:51:46.082Z</atom:updated>
            <content:encoded><![CDATA[<p>The first week in <a href="https://casavo.com/"><strong>Casavo</strong></a> is gone now, and I’m overwhelmed by how many stuff I saw and heard.<br>As I said to many friends asking how it was going: after the first 4 days in Casavo my brain was almost on fire 🤯</p><p>Within the first 3 days I already:</p><ul><li>followed a business onboarding on the domain of Casavo and specifically on the domain of our tribe “Sellers”,</li><li>followed a similar onboarding on the tech part of the same domain,</li><li>learned the lifecycle of our software systems, specifically how they are automatically built, tested and deployed on a kubernetes cluster on AWS,</li><li>participated in an brainstorming session for defining the Q1 2022 OKRs of our tribe,</li><li>learned the main events of our squad, which follow a quite classical Scrum cadence,</li><li>merged my first pull request 😅,</li><li>joined a design and tech debt session on the backend of one of our software systems,</li><li>explored how events are keys in driving the behaviour of our systems,</li><li>talked about a bug in production (an issue with an unexpected event) and how to fix it (very quickly!),</li><li>learned about the <a href="https://www.conventionalcommits.org/en/v1.0.0/">git commit convention</a> followed by the squad,</li><li>asked questions here and there on Slack,</li><li>talked with the squad coach, and share with him some insights and cool topics to study (e.g. the <a href="https://www.youtube.com/watch?v=c1W6U2duXdI">great talk by Henrik Kniberg on being a change agent</a>),</li><li>chatted with my onboarding buddy on several topics.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*62oAcJC8eJ0pmt6XB_F_Hg.jpeg" /><figcaption>My Casavo welcome pack arrived just in time the first day of work 😀</figcaption></figure><p>This Friday I stopped for a moment to reflect on those first days… here are some of my highlights:</p><h3>Data is important</h3><p>Data is important, damn important for a fast-moving company like Casavo: as a squad, when working on new features, you have to remember that developing the plain feature is not enough; you have to take care of collecting proper business data, so that other systems can process and display those data and help business experts to learn and take further business decisions.</p><h3>A product company is different, for real</h3><p>I worked almost all my life in tech consulting companies, and this is my first experience in a real product company. I felt the difference almost the second day when I joined a tribe-wide session to define (together!) the OKRs for this quarter!<br>The cool thing is that in Casavo everyone can really contribute and have a word on those topics, as the business experts are open to discuss and explain their perspective on the business, and welcome ideas and feedbacks.<br>Also, in Casavo you can really decide how you want to have an impact on the product: everyone is a product contributor, so it’s up to you how to contribute to meet the goals of Casavo and the OKRs of your tribe. <br><strong>Autonomy</strong>, <strong>Mastery</strong> and <strong>Purpose</strong> are not void words here, as far as I saw this week.</p><figure><img alt="The Casavo product development manifesto" src="https://cdn-images-1.medium.com/max/1024/1*mjv1YdzFCbUZkIebTZcBzw.png" /><figcaption>Our manifesto!</figcaption></figure><h3>Start from the product</h3><p>As a tech person, when starting in a company like Casavo, the best way to spend your time is to understand the new business context, understand how the market works, talk to the business experts and product managers, listen to the words they use, ask a ton of questions (taking the risk to be hated 😅), understand the various user journeys, testing the actual product on the stage env, etc.<br>Luckily enough, I had the chance to also walk the Figma wireframes and the high-level event storming, which help a lot in having a visual understanding of the whole end-to-end flow.</p><h3>Passion counts ❤️</h3><p>All the people I talked to were really passionate about the business and the products they were contributing. I’m really happy to find passion in so many young people (the average age in my squad is 24–25 years!).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=769b8b50cab1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My notes on Kent Beck’s TDD course]]></title>
            <link>https://pierodibello.medium.com/my-notes-on-kent-becks-tdd-course-8a1a7c8b7a95?source=rss-fa11d2cf58d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a1a7c8b7a95</guid>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[clean-code]]></category>
            <dc:creator><![CDATA[Pietro Di Bello]]></dc:creator>
            <pubDate>Fri, 02 Apr 2021 14:17:28 GMT</pubDate>
            <atom:updated>2021-05-07T21:47:11.993Z</atom:updated>
            <content:encoded><![CDATA[<p>In 2010 <a href="https://medium.com/u/a8ff3eaa42c">Kent Beck</a>, the inventor of Test-Driven Development, recorded a course in the “Pragmatic Screencasts” series.<br>After ten years, I had the chance to follow the four-set videos, finally! 🎺<br>In the 2-hours session, Kent develops a small Java client for Tyrant DB (a simple and very efficient key-value store).</p><p>While watching Kent’s screencasts, I took some notes and made a couple of reflections, that I want to share with you.</p><p>I tried to put every Kent sentence as a quote, to be more understandable.<br>Otherwise, I tried to express my understanding of his recommendations.</p><h3>The test list ☑️</h3><blockquote>First step in TDD for me is always <strong>a list of the tests</strong> that I want to have passing.</blockquote><p>💡 Keep a TODO list, put things there as new ideas or issues arise.</p><figure><img alt="Kent Beck’s initial test list" src="https://cdn-images-1.medium.com/max/706/1*qQL-34-xKPSMbi7mSKl8Hg.png" /><figcaption>Kent Beck’s initial test list</figcaption></figure><h3>Looking for the fastest feedback possible ⏩</h3><p>In the beginning especially, look for the fastest feedback going end to end, as quickly as possible.</p><h3>Tests should tell stories 😮</h3><blockquote><strong>Test names</strong> should tell little stories.</blockquote><p>A test should tell a story!</p><h3>How big is the step we are willing to take? ⾡</h3><p>Small steps, small tests.</p><blockquote>If I make a long step and I fail, I have a cascade of decisions to review: <strong>which one was wrong</strong>?</blockquote><h3>TDD as if you meant it…</h3><p>He writes the first implementation in the very same test, like the <a href="https://cumulative-hypotheses.org/2011/08/30/tdd-as-if-you-meant-it/"><em>“TDD as if you meant it”</em></a> approach!</p><figure><img alt="implementation in the test" src="https://cdn-images-1.medium.com/max/1024/1*aHXMpTC5dEphTw9BJ4Jgog.png" /><figcaption>the first implementation written in the same test</figcaption></figure><p>…then he extracts methods to have a shorter and clearer test, then finally move the methods to an actual application class.</p><figure><img alt="finally a separated class!" src="https://cdn-images-1.medium.com/max/1024/1*8kJf5i5LU0kz9JPN1cG32w.jpeg" /><figcaption>the class has been extracted, but it’s still an inner class of the test (small steps, feedback sooner!)</figcaption></figure><h3>Isolated Tests 🤞</h3><blockquote>Isolated tests: tests that leave the world the same way that they found it.</blockquote><p>“Isolated test” means something very different to different people!</p><p>A good description of this good property of tests is explained in this article <a href="https://medium.com/@kentbeck_7670/test-desiderata-94150638a4b3">https://medium.com/@kentbeck_7670/test-desiderata-94150638a4b3</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*13oWoi5GdgWprZZ_.png" /><figcaption><a href="https://medium.com/@kentbeck_7670/test-desiderata-94150638a4b3">Kent Beck’s Test Desiderata article</a></figcaption></figure><p>There’s also this episode dedicated to this specific topic:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHApI2cspQus&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHApI2cspQus&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FHApI2cspQus%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/be5f324890fc39ccab09ca4941750c97/href">https://medium.com/media/be5f324890fc39ccab09ca4941750c97/href</a></iframe><p>Saying “isolated tests” is like saying that they should be <strong>deterministic</strong>: I can execute the single test and it should pass, I can execute it in a group and it should still pass (and also the other should pass), and I can run them in random order and they should always pass.</p><h3>Each test should clean up at the end 💚</h3><blockquote>Each test is responsible to leave the world in the same exact state as it found it.</blockquote><p>Each test should clean after its execution, bringing the world to the state it was before the test was run.<br>Cleaning <em>after</em> and also <em>before</em> is not the right thing to do: every test should just clean <em>after</em>.</p><p>He also writes tests that are already green, e.g. when he writes the test for the Tyrant#clear method.</p><p>In the name of the test he puts the name of the operation under test, e.g. removeRemovesKey</p><h3>Guard clauses 💂</h3><p>I also tend to like this style of handing guard conditions.<br>Kent explains this style in his book <a href="https://www.amazon.com/Implementation-Patterns-Addison-Wesley-Signature-Beck-ebook/dp/B004UAALDW/">“Implementation Patterns”</a>…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nD-TTOfxaWaReji3.png" /><figcaption>excerpt from “Implementation Patterns” book by Kent Beck</figcaption></figure><h3>Design 🖼</h3><blockquote>I’m glad to do a lot of design after the tests pass.</blockquote><h3>Fake it ‘till you make it 🌵</h3><blockquote>Sometimes I write a second test after the fake implementation, to “force” me to have a real implementation, other times I just slowly replace the fake implementation with a good one that keeps the tests passing.</blockquote><p>He seems to tolerate long methods more than I would…<br>Also, he seems to delay some kind of refactorings</p><ul><li>does not immediately extract all the constants for the Tyrant operation codes</li><li>keeps copying and pasting from test to test</li></ul><blockquote>Copy and paste is suspicious… but I want the green bar!</blockquote><h3>How many test cases?</h3><blockquote>Should we write a test to verify that clear can clear a map even with two objects inside? We already have a test that verifies that clear works with just one element in the map… is it enough?<em><br></em>I make this kind of decision every single moment when I do TDD…</blockquote><blockquote><em>[…] </em>I’m not testing Tyrant DB, I’m testing my client to Tyrant, so I don’t feel I need this new test.</blockquote><h3>Test case ordering</h3><p>Reorder tests to move closer tests that belong to the same behavior.</p><blockquote>…a test class should read like a story!</blockquote><h3>Symmetry ⚔️</h3><p><strong>Symmetry is an important driver</strong>: Kent avoids to extract a common snippet of code because that would introduce asymmetry in some of the methods where the extraction would not be applicable!</p><h3>Look for frequent feedback 💛</h3><blockquote>When tests are red I want to do the least to have them green again, then do the design to make it clean!</blockquote><blockquote><strong>Frequent feedback means I catch errors much sooner!</strong></blockquote><p>Break down a big problem to have feedback sooner.</p><h3>Calling the shot ⛳️</h3><blockquote>Before running tests, I call my shots: is this one gonna pass? <em>🤔 ….. 😮</em></blockquote><h3>Comparing TDD styles 🇺🇸 🇬🇧</h3><p>In <a href="https://medium.com/u/a8ff3eaa42c">Kent Beck</a>’s TDD style, you make the most of the design in the refactoring step, when your new test is green and so are the other tests.</p><p>In other styles of TDD, for example Sandro Mancuso’s, where there’s a greater use of mocking, I noticed that you actually do a lot of design (and take many design decisions) when writing the failing test, while you spend a little effort in designing the code while in the refactoring step.<br>A good example of this different TDD style is in these video episodes by Sandro Mancuso: <a href="https://youtube.com/playlist?list=PLgErHdaPCyhz1iJa98vdxCHAeBdzyYF8M">https://youtu.be/XHnuMjah6ps</a>.</p><h3>Slicing! ✂️</h3><blockquote>Making a “big” failing test pass gives me lots of opportunities to make mistakes!</blockquote><p>The problem is too big to be solved quickly, to reach quickly the green bar.</p><p>So, <strong>how can we slice the problem to have faster feedback?</strong></p><h4>Bottom-up 👆</h4><p>I can adopt a <strong>bottom-up style</strong>, where I think of smaller operations that will be needed in the “complete” solution, and so I start testing those small operations, and then compose the solution out of these small components from the bottom-up.</p><p>He adds a test for a more complex case (two elements in the map) and decides to delete the previous simpler case with just one element in the map.</p><h4>On testing private methods… 🏗</h4><p>He tests #reset e #getNextKey! But those methods should be <strong>private</strong>!!</p><p>After implementing the “complete” solution from the bottom-up, he <strong>deletes</strong> the tests of the (now) private methods (#reset and #getNextKey), which were useful to drive the implementation from the ground up, but now are no more useful.</p><blockquote>…these tests are no longer necessary…they’re like the <strong>scaffolding around a building</strong>: you don’t need them where you’ve finished.</blockquote><h3>TDD error conditions and happy path</h3><p>Question: with TDD you only test the happy path?</p><p><strong>No</strong>, it’s a choice: you can choose to only test happy path, but you can also choose to test error conditions (<em>“what if…”</em> conditions)</p><p>Can I receive a null for this parameter?</p><blockquote>If I was using this code internally and can be sure that null can never be passed, I would not write a null-check test.</blockquote><blockquote>If my code was going to be public though, and I open my code to callers that I cannot control, I cannot be sure a null could be passed, adding additional complexity makes sense!</blockquote><h3>Incremental design 📈</h3><blockquote>Gradually let the design get more and more differentiated.</blockquote><p>See how he starts with an implementation in the test itself!</p><p>Take a big task and break it into smaller tasks, to get intermediate and faster feedback.</p><p><strong>Permutation of task order is relevant</strong>: which tasks you do first makes a difference!</p><ul><li>may give you feedback quicker</li><li>may allow to change the direction of design sooner</li></ul><blockquote>Be aware of <strong>when</strong> you’re making the design decisions and <strong>how</strong> you make those decisions.</blockquote><h3>Kent Beck’s TDD game</h3><p>He propose to try solving a given problem using a different order of design decisions and see how the resulting design is affected and which order gives you more feedback along the way:</p><ul><li>try to write some code with an order of design decisions,</li><li>then erase and start again</li><li>try with another order of design decisions</li><li>…</li><li>until I find an order that is efficient and gives me lots of feedback</li></ul><h3>Rhythm 🥁</h3><p>Rhythm is important for a developer.</p><p><strong>TDD creates a rhythm</strong>, at micro-scale, e.g.</p><ul><li>write a test, make it pass</li><li>write a test, refactor, and make it pass</li><li>write a test, make it pass, and refactor</li><li>…</li></ul><p>At macro-scale there’s a rhythm too:</p><ul><li>problem statement</li><li>development</li><li>cleanup</li></ul><p>This “shaping of time” happens at various scales:</p><ul><li>every two hours</li><li>at the end of the day (take the last hour/half-hour to finish things)</li><li>at the end of the week</li><li>at the end of the month …</li><li>…</li></ul><p>like in storytelling.</p><h3>Do I want to write a test?</h3><p><em>Should I write a test for this case?</em></p><p><strong>Every test that you write is an expense</strong> (both short-term and long-term) and needs to pay for itself in the feedback that you get from the test:</p><ul><li>informational feedback</li><li>emotional feedback (<em>will it work?</em>)</li></ul><p>If you find those feedbacks valuable, go write the test!</p><p><strong>Every test that you don’t write is a risk</strong> (both short-term and long-term) you are creating (a feedback you’re not getting)</p><p>Are you sure that the test will pass? The risk is then tiny!<br>What if someone changes the implementation and accidentally breaks something that you decided not to test?</p><h3>TDD needs balance 🙏</h3><p>Every time you’re writing tests you have</p><ul><li><strong>costs</strong> involved (both short-term and long-term)</li><li><strong>benefits</strong> involved (both short-term and long-term)</li></ul><p>you need to be balancing between all that.</p><ul><li><strong>Management tasks</strong>: choosing which tests to write and in which order</li><li><strong>Design tasks</strong>: choosing which design decisions to make and in which order</li></ul><p>is what makes TDD so difficult, and needs a maturation process.</p><p>That’s all!</p><h3>Other reviews of the same course</h3><ul><li><a href="https://www.dapengli.com/2015/01/03/kent-beck-tdd/">https://www.dapengli.com/2015/01/03/kent-beck-tdd/</a></li><li><a href="https://markhneedham.com/blog/2010/07/28/kent-becks-test-driven-development-screencasts/">https://markhneedham.com/blog/2010/07/28/kent-becks-test-driven-development-screencasts/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a1a7c8b7a95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Divide et Impera!]]></title>
            <link>https://medium.com/claranet-italia/divide-et-impera-15ae5ffbd6fa?source=rss-fa11d2cf58d------2</link>
            <guid isPermaLink="false">https://medium.com/p/15ae5ffbd6fa</guid>
            <category><![CDATA[meetings]]></category>
            <category><![CDATA[coaching]]></category>
            <category><![CDATA[facilitation]]></category>
            <category><![CDATA[brainstorming]]></category>
            <dc:creator><![CDATA[Pietro Di Bello]]></dc:creator>
            <pubDate>Thu, 11 Feb 2021 16:40:48 GMT</pubDate>
            <atom:updated>2021-02-11T16:40:48.481Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Stanchi di lunghe e infruttuose call di “brainstorming”? Provate il potere delle breakout rooms!</em></h4><p>Quale voto date all’ultima retrospective alla quale avete partecipato? O all’ultima code review?</p><figure><img alt="Quale voto date all’ultima retrospective alla quale avete partecipato? O all’ultima code review?" src="https://cdn-images-1.medium.com/max/1024/0*GWNbiSZUsOFEs4Vj" /><figcaption>Photo by <a href="https://unsplash.com/@magnetme?utm_source=medium&amp;utm_medium=referral">Magnet.me</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Come technical coach, mi ritrovo spesso a partecipare a sessioni di brainstorming o planning (code review, sessioni architetturali, retrospectives, backlog refinement, etc) con tante persone, dev e non.<br>Una delle conseguenze che la pandemia di COVID-19 ha portato nel nostro lavoro è che tutte queste sessioni sono per forza di cose remote; siamo insomma diventati — volenti o nolenti — degli animali da videocall, e passiamo con <em>nonchalance</em> da una call Zoom/Teams/Google Meet/… all’altra.</p><p>Uno degli effetti più negativi che ho notato passando da sessioni co-localizzate a sessioni remote è la difficoltà di partecipazione di tutte le persone: vuoi per postura spesso passiva che assumiamo, stando tutti seduti davanti ad un monitor, vuoi per la facilità con la quale possiamo eclissarci, vuoi per altre distrazioni che ci arrivano dal nostro pc o dall’ambiente esterno, spesso noto che nelle sessioni remote intervengono sempre i “soliti noti”, o quelli molto sicuri di sé, o quelli estroversi, o quelli che si sentono in dovere di intervenire perché sono i “technical leaders”, lasciando nell’ombra i molti altri.<br>Tra l’altro da remoto si fa molta fatica ad interpretare le microespressioni facciali e il linguaggio del corpo dei partecipanti attraverso la loro webcam, e questo riduce ulteriormente la nostra capacità di intervenire per aiutare tutti a partecipare.</p><p>Non voglio con questo articolo proporre niente di rivoluzionario né in grado di risolvere tutti i problemi dovuti al lavoro da remoto (ché poi ha anche molti vantaggi, ben inteso).<br>Vorrei solo proporre una semplice tecnica che ho visto funzionare, che già adottavo nelle sessioni co-localizzate ma che ho tardato ad introdurre anche in quelle remote: la <strong>suddivisione dei partecipanti in piccoli gruppi</strong>.</p><p>Per farvi capire, vi racconto come si è svolta l’ultima sessione a cui ho partecipato come facilitatore: si trattava di un incontro per discutere di alcune scelte architetturali che avrebbero avuto impatti su tutti i team dell’organizzazione.</p><p>Innanzitutto ho cercato di non limitare la discussione solo ai senior dei vari team, ma di coinvolgere quanti più membri di tutti i team, per essere sicuro di averli tutti “a bordo”, attivi propositori del loro destino piuttosto che meri esecutori o “implementatori di specifiche”. <br>Il numero dei partecipanti non ci spaventava, anche perché lavorando per gruppi è facile suddividere un grosso numero di persone in tanti piccoli gruppi.</p><p>Per la call abbiamo usato Zoom, che è dotato dell’essenziale funzionalità di <em>“breakout rooms”</em> (le stanze virtuali nelle quali far lavorare i vari gruppi). Per fortuna tale feature è ora disponibile anche in Microsoft Teams e in Google Meet.<br>Abbiamo poi predisposto una board online (nel mio caso ho usato <a href="https://metroretro.io/">MetroRetro</a>, ma ottime alternative sono <a href="http://miro.com/">Miro</a>, <a href="http://mural.co/">Mural</a> o <a href="https://jamboard.google.com/">Google Jamboard</a>), assicurandomi che tutti avessero accesso alla board.</p><p>Dopo aver speso i primi 15 minuti a spiegare i motivi e gli obiettivi della sessione, per assicurarmi che tutti avessero le idee chiare su come contribuire, abbiamo diviso i partecipanti in gruppi di 4 persone (3–4 persone è il numero giusto in questi casi, non di più).</p><p>Nella successiva mezz’ora, ogni gruppo ha potuto confrontarsi, discutere e raccogliere le proposte e idee provenienti da ognuno.<br>Nel frattempo la board si è popola di post-it, segno che i gruppi stavano lavorando bene.</p><figure><img alt="una board piena di post-it è un buon segno che la riunione sta andando bene" src="https://cdn-images-1.medium.com/max/1024/1*SpeJswboAvPAnP60bBIW3w.png" /><figcaption>La board si riempie di post-it: buon segno!</figcaption></figure><p>Il facilitatore può in questi casi saltare da una stanza all’altra, per assicurarsi che il gruppo non sia bloccato nella discussione e mantenga il focus sul tema¹.</p><p>Quando la board era oramai quasi totalmente invasa di post-it, abbiamo riportato tutti i gruppi nella stanza principale di Zoom.<br>I gruppi si sono poi confrontati tra loro per ragionare sulle opzioni emerse e sulle considerazioni raccolte, raggruppando tematiche simili avvicinando tra loro i relativi post-it.</p><p>Quello che ho notato subito è che, nuovamente riunite insieme, tutte le persone hanno partecipato attivamente alle successive discussioni. <br>Questo è un primo effetto del lavoro in gruppi: <strong>le persone si “sbloccano” nel proprio gruppo, iniziano a sentirsi coinvolti e poi non si fermano più, anche una volta rientrati nella stanza “plenaria”.</strong></p><p>La suddivisione in gruppi è efficace in tutte le riunioni (remote e non) dove la partecipazione e il contributo di tutti è essenziale per il successo dell’iniziativa (e faccio fatica a trovare riunioni dove questo non sia necessario…).</p><p>D’altra parte non invento nulla, il primo riferimento all’uso di questa tecnica l’ho avuto anni fa venendo in contatto con <a href="https://www.liberatingstructures.com/"><strong>Liberating Structures</strong></a>, un insieme di tecniche di facilitazione molto efficaci e divertenti! Molti dei formati proposti in Liberating Structures fanno affidamento sulla divisione in gruppi, ad esempio <a href="https://www.liberatingstructures.com/1-1-2-4-all">“1–2–4-All”</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JiKRgE-d_Wv6UjV0" /><figcaption>Photo by <a href="https://unsplash.com/@cwmonty?utm_source=medium&amp;utm_medium=referral">Chris Montgomery</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>La stessa parte di sintesi finale può essere fatta in gruppi o tutti assieme: ad esempio il <em>“dot voting”</em> usato per prioritizzare le opzioni emerse si può fare dividendosi in gruppi (meglio se diversi da quelli adottati precedentemente), piuttosto che in modo individuale, così da “costringere” le persone a confrontarsi e a convergere sulle opzioni ritenute più valide.<br>Una tecnica che si può adottare qui è quella di dividere in gruppi da due persone, e dare loro 3 voti, così da costringerli a convergere con almeno un voto su una opzione condivisa.</p><p>Vorrei concludere con due ultime osservazioni.</p><p>Primo: la divisione in gruppi è uno strumento che potete usare in ogni momento della sessione, ma non potete fare affidamento solo a quello per il buon esito dell’incontro.<br>Due momenti decisivi sono l’avvio e la conclusione:</p><ul><li>nel momento introduttivo, tutti insieme, si condividono l’agenda dell’incontro, gli obiettivi e le regole della discussione</li><li>nella parte finale si trova la convergenza come intero gruppo, si mettono a fuoco i prossimi passi e si conclude.</li></ul><p>In particolare, dedicate il giusto tempo alla convergenza finale. Nessuno vi vieta di usare anche qui più giri di feedback usando dei gruppi ristretti e ruotando le persone che vi partecipano.<br>L’importante è poi convergere tutti assieme.</p><p>Infine, quando non è opportuno dividere in gruppi i partecipanti ad una discussione? Personalmente non ho ancora incontrato situazioni dove non dividere in gruppi sarebbe stato più efficace ai fini della partecipazione. <br>Forse, quando la discussione verte su temi valoriali (ad esempio se state facendo una sessione per far emergere i valori della vostra azienda) potrebbe essere meglio non ricorrere troppo ai gruppi, anche perché spesso in questi casi le persone non avranno problemi a dire la loro.</p><p>Provate quindi ad adottare questa tecnica nel vostro prossimo evento remoto di team, che sia una retrospective, un backlog refinement, una code review, o altro, e fateci sapere come è andata!</p><p><strong>Note</strong></p><p>[1] Riguardo a questo, il mio amico coach <a href="https://medium.com/u/c008ac2d9213">Moretto Nik</a> mi ha ricordato di fare attenzione a piombare nelle stanze dei gruppi, perché a volte si rischia di rompere l’equilibrio del gruppo o banalmente interrompere una loro discussione. <br>Piuttosto in questi casi basta rimanere nella stanza “plenaria” e spiegare ai gruppi che in caso di dubbi possono richiamare il facilitatore nella loro stanza oppure raggiungerlo nella stanza principale per chiedergli aiuto.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15ae5ffbd6fa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claranet-italia/divide-et-impera-15ae5ffbd6fa">Divide et Impera!</a> was originally published in <a href="https://medium.com/claranet-italia">Claranet Italia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One assertion per test?]]></title>
            <link>https://pierodibello.medium.com/one-assertion-per-test-732cc2a7d3d?source=rss-fa11d2cf58d------2</link>
            <guid isPermaLink="false">https://medium.com/p/732cc2a7d3d</guid>
            <category><![CDATA[design-smell]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[testability]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <dc:creator><![CDATA[Pietro Di Bello]]></dc:creator>
            <pubDate>Wed, 08 Apr 2020 21:00:51 GMT</pubDate>
            <atom:updated>2020-04-09T13:38:54.970Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How many times did you fight to give a test a good name? After all, as </em><a href="https://www.youtube.com/watch?v=4cVZvoFGJTU"><em>Michael Feathers said</em></a><em>, tests are another way of understanding our code.</em></p><p><em>Here’s a story of two programmers and their struggles with naming a test case. More importantly, it’s a story about how sometimes struggling with names can be a symptom of a very different problem.</em></p><p><strong><em>co-written by </em></strong><a href="https://github.com/xpepper/"><strong><em>Pietro Di Bello</em></strong></a><strong><em> and </em></strong><a href="https://github.com/joebew42/"><strong><em>Joe Bew</em></strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/0*kU2tyWSqd28MiWWL.jpg" /><figcaption>A Friend in Need (1903) — by Cassius Marcellus Coolidge</figcaption></figure><p>Over the last period, we are practicing together the <a href="http://codingdojo.org/kata/PokerHands/">Poker Hands Kata</a>, using TDD and following a strong “slicing strategy” as explained <a href="https://xp123.com/articles/slicing-functionality-alternate-paths/">here</a>. In our “simplified” world, a poker hand is composed of just two cards, but at the very beginning, we started with an even more simplified model where a poker hand was composed of just a single card. 😎</p><p>While developing our model incrementally and with small steps, we encountered this scenario, where we wanted to express that a poker hand with the cards four and three is lower than a poker hand with a four and a five because the latter hand has the highest card (a five).</p><pre><em>@Test</em><br>public void <strong>compare_hands_by_highest_card</strong>() {<br>  PokerHand hand = new PokerHand(four(), three());<br>  PokerHand otherHand = new PokerHand(four(), five());</pre><pre>  assertEquals(IS_LOWER, hand.compareTo(otherHand));<br>}</pre><p>As soon as we wrote the obvious implementation to make this test pass, we were ready to write our next test. Hooray!</p><p>A possible subsequent scenario could have been to compare two poker hands where the former is greater than the latter. We felt the temptation to write a new test to describe the “new” behavior, following the guideline of <em>one assertion per test</em>:</p><pre><em>@Test</em><br>public void <strong>foo</strong>() {<br>  PokerHand hand = new PokerHand(four(), three());<br>  PokerHand otherHand = new PokerHand(four(), five());</pre><pre>  assertEquals(IS_GREATER, otherHand.compareTo(hand));<br>}</pre><p>But then we stopped and reflect on a few idiosyncrasies we identified in this test:</p><ul><li>It’s hard to find a good name for this test (…how would you name it?)</li><li>We can re-use the Poker Hands of the previous test… it’s just a matter of having them swapped.</li><li>As we swapped the operands (hand with otherHand), we suddenly noticed we were describing the exact opposite condition, because in the end card numbers are just plain natural numbers, and they can be ordered and compared to each other.</li><li>The test is already passing (it’s <em>“green”</em>) without any change in the code. This could tell us that the behavior is already documented somewhere else!</li><li>Duplication! This test is essentially telling the same story of the previous one, from a different perspective, so the outcome will be the same (hence, the <em>“green bar”</em>).</li></ul><p>So, instead of forcing ourself into writing a new test, we could rather think to move the assertion as part of the first test:</p><pre>assertEquals(IS_GREATER, otherHand.compareTo(hand));</pre><p>In the end, we are using the same objects and the operation is “specular”:</p><pre><em>@Test<br></em>public void <strong>compare_hands_by_highest_card</strong>() {<br>  PokerHand hand = new PokerHand(four(), three());<br>  PokerHand otherHand = new PokerHand(four(), five());</pre><pre>  assertEquals(IS_LOWER, hand.compareTo(otherHand));<br>  assertEquals(IS_GREATER, otherHand.compareTo(hand));<br>}</pre><p>And the same rule of thumb can be applied to describe the case where we are trying to compare the same poker hand against itself:</p><pre>assertEquals(IS_TIE, hand.compareTo(hand));<br>assertEquals(IS_TIE, otherHand.compareTo(otherHand));</pre><p>These are assertions that will improve the documentation of the first scenario:</p><pre><em>@Test<br></em>public void <strong>compare_hands_by_highest_card</strong>() {<br>  PokerHand hand = new PokerHand(four(), three());<br>  PokerHand otherHand = new PokerHand(four(), five());</pre><pre>  assertEquals(IS_LOWER, hand.compareTo(otherHand));<br>  assertEquals(IS_GREATER, otherHand.compareTo(hand));</pre><pre>  assertEquals(IS_TIE, hand.compareTo(hand));<br>  assertEquals(IS_TIE, otherHand.compareTo(otherHand));<br>}</pre><p>So, we wondered, are we breaking the guideline that states that <em>“each test should have </em><a href="https://www.artima.com/weblogs/viewpost.jsp?thread=35578"><em>one</em></a><em> and </em><a href="https://osherove.com/blog/2006/10/3/avoid-multiple-asserts-in-a-single-unit-test-revisited.html"><em>only one</em></a><em> </em><a href="http://blog.jayfields.com/2007/06/testing-one-assertion-per-test.html"><em>assertion</em></a><em>”</em>?</p><p><em>“One assertion per test”</em> is a wise rule to keep in mind, because it helps you have tests that fail for a specific reason, and drives you to focus on a specific behavior at a time.</p><p>We should nevertheless remember that <strong>it’s not the rule what really matters, is the intention behind the rule</strong>, and here what matters is having <a href="https://medium.com/@kentbeck_7670/test-desiderata-94150638a4b3">well-focused tests</a> and not testing multiple paths, so <em>“one assertion per test”</em> is a good rule for a novice to follow.</p><p>In our case, could we say that we are testing <em>“different behaviors”</em>? We don’t think so. If the previous test fails, I know that the comparison between cards is somehow broken, and I know where to look at to spot what I should fix.</p><p>In other words, quoting <a href="https://medium.com/u/a8ff3eaa42c">Kent Beck</a> in his great writing <a href="https://medium.com/@kentbeck_7670/test-desiderata-94150638a4b3">“Test Desiderata”</a>, this test is still <em>“specific”</em>, because, if it fails, “<em>the cause of the failure should be obvious</em>”.</p><p>It’s having <em>“one assertion per test”</em> meaning you should have <em>exactly</em> one line of code asserting something? Or should we read it as <em>“assert just one behavior”</em>?</p><p>As usual, software development principles and heuristics are often forces that push you into different (sometimes opposite) directions, and you should trade-off and balance each time those forces, depending on the context and on what you and your pair think makes more sense at the moment.</p><p>The baseline here is that you should <a href="https://books.google.it/books?id=QJA3dM8Uix0C&amp;pg=PT88&amp;dq=growing+object-oriented+software+guided+by+tests+%22Listen+to+the+Tests%22&amp;hl=en&amp;sa=X&amp;ved=0ahUKEwjN67qr8tDoAhWB6aYKHSKzBRAQ6AEIKDAA#v=onepage&amp;q=growing%20object-oriented%20software%20guided%20by%20tests%20%22Listen%20to%20the%20Tests%22&amp;f=false"><strong>listen to your tests</strong></a> (as stated in the <a href="https://www.amazon.com/Growing-Object-Oriented-Software-Guided-Tests/dp/0321503627">“Growing Object-Oriented Software, Guided by Tests”</a> book by Steve Freeman and <a href="https://medium.com/u/d8035a96a67">Nat Pryce</a>): they are always telling you something.</p><p>In this case, each time you struggle with finding a good name for a test, you should ask yourself why this happens, and how should the code be designed so that this struggle disappears.</p><p>If you’re curious, here’s the git repository we’re using to practice this kata: <a href="https://github.com/xpepper/poker-hands-kata">https://github.com/xpepper/poker-hands-kata</a>.</p><h3>Key Take-Aways</h3><ul><li><strong>Listen to your tests</strong>: why am I struggling to find a good name for a test?</li><li><strong>Have well-focused tests</strong> so that if one fails, the cause of its failure should be obvious.</li><li><strong>One <em>behavior</em> per test</strong>: we might need multiple assertions to verify it.</li><li>It’s not the rule what really matters, it is the <strong>intention behind the rule</strong>.</li><li><strong>Trade-off and balance each time</strong>, depending on the context and on what you and your colleagues think make more sense at the moment.</li></ul><h4>References</h4><ul><li>Dave Astel’s <a href="https://www.artima.com/weblogs/viewpost.jsp?thread=35578">“One Assertion Per Test”</a></li><li>Roy Osherove’s <a href="https://osherove.com/blog/2006/10/3/avoid-multiple-asserts-in-a-single-unit-test-revisited.html">“Avoid multiple asserts in a single unit test: revisited”</a></li><li>Jay Fields’ <a href="http://blog.jayfields.com/2007/06/testing-one-assertion-per-test.html">“Testing: One assertion per test”</a></li><li>Kent Beck’s <a href="https://medium.com/@kentbeck_7670/test-desiderata-94150638a4b3">“Test Desiderata”</a></li><li>Growing Object-Oriented Software, Guided by Tests: <a href="https://books.google.it/books?id=QJA3dM8Uix0C&amp;pg=PT88&amp;dq=growing+object-oriented+software+guided+by+tests+%22Listen+to+the+Tests%22&amp;hl=en&amp;sa=X&amp;ved=0ahUKEwjN67qr8tDoAhWB6aYKHSKzBRAQ6AEIKDAA#v=onepage&amp;q=growing%20object-oriented%20software%20guided%20by%20tests%20%22Listen%20to%20the%20Tests%22&amp;f=false">“Listen to the tests”</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=732cc2a7d3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding Jacoco code coverage measurement to a Kotlin Gradle project (and then adding coverage…]]></title>
            <link>https://pierodibello.medium.com/adding-jacoco-code-coverage-measurement-to-a-kotlin-gradle-project-and-then-adding-coverage-491d99990d63?source=rss-fa11d2cf58d------2</link>
            <guid isPermaLink="false">https://medium.com/p/491d99990d63</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[jacoco]]></category>
            <dc:creator><![CDATA[Pietro Di Bello]]></dc:creator>
            <pubDate>Sun, 13 Oct 2019 20:52:44 GMT</pubDate>
            <atom:updated>2019-10-13T20:52:44.693Z</atom:updated>
            <content:encoded><![CDATA[<h3>Adding Jacoco code coverage measurement to a Kotlin Gradle project (and then adding coverage reports on a Jenkins pipeline)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oeqE0g9nkT4l-Slg0XkHew.jpeg" /></figure><h3>Add code coverage to a gradle project</h3><p>In order to have code coverage measurement enabled on your gradle project, you have to just add the jacocoplugin to the build.gradle “plugin” section:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/279c26c7c29731f06d2aac1d26dcf170/href">https://medium.com/media/279c26c7c29731f06d2aac1d26dcf170/href</a></iframe><p>When you now run ./gradlew test or other test tasks, you’ll see that the build folder now contains a jacoco folder, with a *.exec type of file (e.g. test.exec).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b7092a0ad4cf1f3a92e28f91dde44aa/href">https://medium.com/media/7b7092a0ad4cf1f3a92e28f91dde44aa/href</a></iframe><p>This *.execfile contains a binary code coverage report of the test run.<br>Nothing you can really read by yourself :-D</p><p>Fear not, for gradle is with you, giving you a couple of shiny new tasks:</p><ul><li>jacocoTestReport: the most important task! It generates a code coverage report (based on the last test run) in various formats (default is html)</li><li>jacocoTestCoverageVerification: it verifies code coverage metrics based on specified rules for the test task.</li></ul><p>So, if you now run ./gradlew jacocoTestReport, a new folder will appear under build:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/451aa2acd3f8220a473d67e47529db37/href">https://medium.com/media/451aa2acd3f8220a473d67e47529db37/href</a></iframe><p>This reports/jacoco is where the html reports will be generated.</p><p>You can add more customizations to jacoco setup (e.g. have reports in other formats, like csv or xml, or generating reports in a different folder): see <a href="https://docs.gradle.org/current/userguide/jacoco_plugin.html">https://docs.gradle.org/current/userguide/jacoco_plugin.html</a> to find all the details.</p><h3>Publish code coverage reports in a Jenkins pipeline</h3><p>This is where things start to become more fuzzy: the available documentation is really not that clear, and all the examples on Internet (e.g. stackoverflow) may be quite outdated.<br>Anyway, to have the code coverage report published in your Jenkins job, just add somewhere, inside a step, the jacoco() directive (no need to install special Jenkins plugins!).</p><p>The jacoco()directive has many sensitive defaults: chances are that those defaults will be fine for you (especially if the project is a classic Maven+Java project), but in case you have to tweak a bit the jacoco()command, see the <a href="https://jenkins.io/doc/pipeline/steps/jacoco">JaCoCo plugin Jenkins doc page</a> to have all the options.</p><p>To give you a practical example, this is the jacoco directive of my Kotlin declarative pipeline:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62c429db9cb70f3ec210c136aa53f4df/href">https://medium.com/media/62c429db9cb70f3ec210c136aa53f4df/href</a></iframe><ul><li>classPattern selects just the kotlin application classes (no need to have code coverage on my tests :-D )</li><li>sourcePattern selects the location of the source files (again, just application files, no tests)</li><li>sourceInclusionPattern is needed because the default (at least on my version of the jacoco Jenkins plugin) would select only Java files</li></ul><p>I put this jacococommand in the last post section of my declarative pipeline, where the artifacts are published and the build status notifications are sent. Other people prefer to put it just after the test execution… find the best thing for you and go for it. <br>A good place to make up your mind is <a href="http://vgaidarji.me/blog/2017/06/22/how-to-use-jenkins-plugins-in-jenkins-pipeline/">this post</a>.</p><p>Again, to make a practical example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ccd4242900f04137c33923e92745042e/href">https://medium.com/media/ccd4242900f04137c33923e92745042e/href</a></iframe><p>That’s it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=491d99990d63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Books, authors and stuff that inspired me in the last years]]></title>
            <link>https://pierodibello.medium.com/books-authors-and-stuff-that-inspired-me-in-the-last-years-17c78d5830ae?source=rss-fa11d2cf58d------2</link>
            <guid isPermaLink="false">https://medium.com/p/17c78d5830ae</guid>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Pietro Di Bello]]></dc:creator>
            <pubDate>Sat, 31 Aug 2019 22:23:32 GMT</pubDate>
            <atom:updated>2019-08-31T22:28:22.454Z</atom:updated>
            <content:encoded><![CDATA[<h3>“As part of learning, we read books, blogs, etc… What was the most influential book you read in your journey as scrum master, and what was the most significant lesson you took from that book?” — Vasco Duarte</h3><h4>“Lean Software Development: An Agile Toolkit” by Mary and Tom Poppendieck</h4><p>This book taught me how deeply are related and <strong>interconnected</strong> all the values, principles and practices of XP and Scrum with Lean.</p><p>I learned that what I did every day using agile principles is something that has a reason beyond the world of software, that has roots in principles that can be valid in many contexts like organizing the work in an hospital, preparing dishes in a restaurant…</p><p>I learned what is a <strong>pull system</strong>, what is a <strong>value stream map</strong> and how is applicable even to map the flow of production of a can of coca cola.</p><p>I learned that you cannot just <strong>copy</strong> some practices to have the same benefits of Lean if you don’t get the values behind them, and this is so true even for Scrum and XP.</p><p>I learned of how different contracts can help or gets in the way of an agile project.</p><p>Probably it’s time for me to read it again :)</p><h4><strong>“Turn the Ship Around”</strong> by David Marquet</h4><p>I learned that even the worst performing organization can become an outperforming team using a set of working practices, a shared vision and a set of core values.</p><p>And that <strong>leadership</strong> is not the one that you can imagine looking at movies, where you have the leader standing in front of all and leading all to the victory through heroic acts and commands. Leadership instead is communicating to people their potential so clearly that they are inspired to see it in themselves (quote by Stephen Covey).</p><p>And I also found many many correlations with the practices of XP and Scrum.</p><p>For example, he talks about “Clarity”…</p><p>Clarity means people at all levels of an organization clearly and completely understand what the organization is about.” “This is needed because people in the organization make decisions against a set of criteria that includes what the organization is trying to accomplish. If clarity of purpose is misunderstood, then the criteria by which a decision is made will be skewed, and suboptimal decisions will be made.”</p><p>Writing goals means committing to each other, and clarifying (to oneself and to their peers) what the real purpose is.</p><p>This is why different agile practices works so well:</p><ul><li><strong>Pair programming</strong> means continually clarifying one’s intents and actions to the others. Moreover, you have to do it verbally, so a more strong and unambiguous process of internal revision has to take place, before the actual words come out of your mouth.</li><li><strong>Daily Journal</strong> is a way to clarify, by telling the story of your day at job. What happened? What did you learn? What did you surprise? What worked well? What ideas came to your mind?</li><li><strong>TDD</strong> is a way of discovering and declaring a clear intent on the behavior you want the system (and their elements) to have. This brings clarity and triggers discussions.</li></ul><h4><strong>“Becoming a Technical Leader”</strong> by Gerald M. Weinberg</h4><p>Wonderful book, so inspiring… despite the title it’s a book about our profession and how are the real characteristics of great coach: the ability to observe, to communicate properly, clearly, to observe himself also. I took the idea of keeping a daily journal, which BTW is a practice the I use at work with my teams for years. And there I discovered <strong>Virgina Satir</strong> and her communication model.</p><h4>More authors and material I found inspiring in the last year</h4><p>I love all the stuff by <strong>Linda Rising</strong>, I listened to two wonderful podcast on <a href="https://www.se-radio.net/"><strong>SERadio</strong></a>, one is about the retrospective and the other is about fearless change… she’s wonderful, inspiring and so wise.</p><p>There are several videos of her talking about the Agile Mindset and the fixed mindset… My lesson here is that fixed mindset is always behind the corner, lurking, and you should always strive for improving your agility, improve and shorten the feedback loop, communicate better and so on.</p><p>And Vasco Duarte’s <a href="https://scrum-master-toolbox.org/"><strong>ScrumMaster Toolbox</strong></a> podcast it’s wonderful, so wonderful that it is in our learning path for agile coaches of our company, <a href="http://www.xpeppers.com/">XPeppers</a>!</p><p>I read many blog posts, every day, from technical stuff to coaching and agile stuff, and so on.</p><p>I found always inspiring the posts published by <a href="http://martinfowler.com/bliki/"><strong>Martin Fowler</strong></a> and <a href="https://www.ronjeffries.com/"><strong>Ron Jeffries</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17c78d5830ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>