<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Franco</title>
    <description>The latest articles on Forem by Franco (@frandev).</description>
    <link>https://forem.com/frandev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F557985%2F55144835-c7ee-4770-8e49-067f37188194.jpeg</url>
      <title>Forem: Franco</title>
      <link>https://forem.com/frandev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/frandev"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Franco</dc:creator>
      <pubDate>Fri, 13 Feb 2026 03:29:11 +0000</pubDate>
      <link>https://forem.com/frandev/-jhh</link>
      <guid>https://forem.com/frandev/-jhh</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/aezur" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3766287%2F1903fec3-42c8-4a5f-90ed-eb44e262a8ec.webp" alt="aezur"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/aezur/your-ide-is-an-attack-vector-2i0b" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Your IDE is an Attack Vector&lt;/h2&gt;
      &lt;h3&gt;Peter Mulligan ・ Feb 12&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#vscode&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#phishing&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tooling&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>vscode</category>
      <category>security</category>
      <category>phishing</category>
      <category>tooling</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Franco</dc:creator>
      <pubDate>Wed, 26 Nov 2025 13:07:38 +0000</pubDate>
      <link>https://forem.com/frandev/-4hb7</link>
      <guid>https://forem.com/frandev/-4hb7</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/adamthedeveloper/youre-not-building-netflix-stop-coding-like-you-are-1707" class="crayons-story__hidden-navigation-link"&gt;You're Not Building Netflix: Stop Coding Like You Are&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/adamthedeveloper" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1002243%2F84fa5f44-c4e1-4fec-934c-9fa687161e10.webp" alt="adamthedeveloper profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/adamthedeveloper" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Adam - The Developer
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Adam - The Developer
                
              
              &lt;div id="story-author-preview-content-3050662" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/adamthedeveloper" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1002243%2F84fa5f44-c4e1-4fec-934c-9fa687161e10.webp" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Adam - The Developer&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/adamthedeveloper/youre-not-building-netflix-stop-coding-like-you-are-1707" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Nov 23 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/adamthedeveloper/youre-not-building-netflix-stop-coding-like-you-are-1707" id="article-link-3050662"&gt;
          You're Not Building Netflix: Stop Coding Like You Are
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/programming"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;programming&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/architecture"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;architecture&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/typescript"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;typescript&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/adamthedeveloper/youre-not-building-netflix-stop-coding-like-you-are-1707" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;332&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/adamthedeveloper/youre-not-building-netflix-stop-coding-like-you-are-1707#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              94&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            10 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>webdev</category>
      <category>programming</category>
      <category>architecture</category>
      <category>typescript</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Franco</dc:creator>
      <pubDate>Wed, 12 Nov 2025 18:46:39 +0000</pubDate>
      <link>https://forem.com/frandev/-26mp</link>
      <guid>https://forem.com/frandev/-26mp</guid>
      <description>&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/tlorent/your-plans-arent-realistic-the-brutal-honesty-that-prevents-burnout-53lp" class="crayons-story__hidden-navigation-link"&gt;"Your Plans Aren't Realistic": The Brutal Honesty That Prevents Burnout&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/tlorent" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F580420%2F0ca2c360-53cc-4d88-b5c7-988f5bc6f3d9.jpg" alt="tlorent profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/tlorent" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Tim Lorent
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Tim Lorent
                
              
              &lt;div id="story-author-preview-content-3016537" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/tlorent" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F580420%2F0ca2c360-53cc-4d88-b5c7-988f5bc6f3d9.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Tim Lorent&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/tlorent/your-plans-arent-realistic-the-brutal-honesty-that-prevents-burnout-53lp" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Nov 12 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/tlorent/your-plans-arent-realistic-the-brutal-honesty-that-prevents-burnout-53lp" id="article-link-3016537"&gt;
          "Your Plans Aren't Realistic": The Brutal Honesty That Prevents Burnout
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/career"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;career&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/mentorship"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;mentorship&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/productivity"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;productivity&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/tlorent/your-plans-arent-realistic-the-brutal-honesty-that-prevents-burnout-53lp" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;10&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/tlorent/your-plans-arent-realistic-the-brutal-honesty-that-prevents-burnout-53lp#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              2&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            5 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;




</description>
      <category>webdev</category>
      <category>career</category>
      <category>mentorship</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Don't use AI for testing</title>
      <dc:creator>Franco</dc:creator>
      <pubDate>Sun, 22 Dec 2024 13:37:59 +0000</pubDate>
      <link>https://forem.com/frandev/dont-use-ai-for-testing-1c8</link>
      <guid>https://forem.com/frandev/dont-use-ai-for-testing-1c8</guid>
      <description>&lt;p&gt;Let me give you a piece of advice: don’t use AI (Copilot, GPT, etc.) for testing. Don’t get me wrong—what I mean by this is: use AI for testing in moderation, but please, don’t delegate all your testing responsibilities to these tools.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why?
&lt;/h3&gt;

&lt;p&gt;Okay, I admit it—I’m a big fan of testing. I believe that, at an enterprise level, testing = code = documentation in terms of importance. Without proper tests, it’s incredibly difficult to deploy correct features to production that meet the requirements. It’s also challenging to maintain these features in the long run.&lt;/p&gt;

&lt;p&gt;Whether you engage in defensive testing (writing tests after the code) or offensive testing (writing tests before the code, such as using TDD), the mere act of writing tests forces you to think critically about the code. It compels you to review the main cases and edge cases, giving you an extra opportunity to ensure the code is as robust as possible before it reaches staging or production.&lt;/p&gt;




&lt;h3&gt;
  
  
  Looking Beyond
&lt;/h3&gt;

&lt;p&gt;If we underestimate testing and treat it as a "necessary evil" while working on a ticket, we risk falling into the trap of a typical Copilot prompt: “Write a unit test for this class.” Worse yet, we might simply copy-paste the result without even reviewing it. This can lead to weak tests that pass only because of superficial assertions like “true to be true” or similar. &lt;/p&gt;

&lt;p&gt;While this might seem like a time-saver at first, avoiding the effort of writing tests from scratch, the reality is that in the short, medium, and long term, this approach will bring us significant headaches. The reason? &lt;strong&gt;The test won’t be solid enough to prove that the code meets its requirements and is free of critical bugs&lt;/strong&gt; (not all bugs—since it’s impossible to prove the absence of bugs, only their presence).&lt;/p&gt;

&lt;h4&gt;
  
  
  Beyond Code
&lt;/h4&gt;

&lt;p&gt;Beyond the code itself, this approach can harm us as developers. &lt;strong&gt;We risk losing reputation and credibility regarding the quality of our work.&lt;/strong&gt; At the same time, we lose the chance to learn valuable skills related to testing, which I find both beautiful (subjectively speaking) and crucial.&lt;/p&gt;




&lt;h3&gt;
  
  
  It’s Like Everything Else
&lt;/h3&gt;

&lt;p&gt;What I’m saying about testing applies to many other concepts in software development. It’s essential to understand that AI is just another tool in the developer’s arsenal. When used properly, it can make a significant difference—&lt;strong&gt;when used properly.&lt;/strong&gt; It cannot be used blindly for everything, just as we can’t dismiss it entirely and refuse to use it at all.&lt;/p&gt;

&lt;p&gt;As always, the challenge for software developers is to recognize this and &lt;strong&gt;balance the use of tools according to the context where they’re solving a problem.&lt;/strong&gt; After all, a software developer’s job is to solve problems strategically, using the right tools to achieve that goal.&lt;/p&gt;




&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;This perspective is based on my experience as a software developer. Of course, it’s far from being the ultimate truth and should be taken as one more point of view. I encourage you to share your thoughts in the comments so we can spark a discussion within the community and learn even more from each other.&lt;/p&gt;

&lt;p&gt;Happy coding! 🤓&lt;/p&gt;

</description>
      <category>testing</category>
      <category>ai</category>
      <category>development</category>
      <category>coding</category>
    </item>
    <item>
      <title>Don't use AI for testing</title>
      <dc:creator>Franco</dc:creator>
      <pubDate>Sun, 22 Dec 2024 13:37:58 +0000</pubDate>
      <link>https://forem.com/frandev/dont-use-ai-for-testing-4jm6</link>
      <guid>https://forem.com/frandev/dont-use-ai-for-testing-4jm6</guid>
      <description>&lt;p&gt;Let me give you a piece of advice: don’t use AI (Copilot, GPT, etc.) for testing. Don’t get me wrong—what I mean by this is: use AI for testing in moderation, but please, don’t delegate all your testing responsibilities to these tools.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why?
&lt;/h3&gt;

&lt;p&gt;Okay, I admit it—I’m a big fan of testing. I believe that, at an enterprise level, testing = code = documentation in terms of importance. Without proper tests, it’s incredibly difficult to deploy correct features to production that meet the requirements. It’s also challenging to maintain these features in the long run.&lt;/p&gt;

&lt;p&gt;Whether you engage in defensive testing (writing tests after the code) or offensive testing (writing tests before the code, such as using TDD), the mere act of writing tests forces you to think critically about the code. It compels you to review the main cases and edge cases, giving you an extra opportunity to ensure the code is as robust as possible before it reaches staging or production.&lt;/p&gt;




&lt;h3&gt;
  
  
  Looking Beyond
&lt;/h3&gt;

&lt;p&gt;If we underestimate testing and treat it as a "necessary evil" while working on a ticket, we risk falling into the trap of a typical Copilot prompt: “Write a unit test for this class.” Worse yet, we might simply copy-paste the result without even reviewing it. This can lead to weak tests that pass only because of superficial assertions like “true to be true” or similar. &lt;/p&gt;

&lt;p&gt;While this might seem like a time-saver at first, avoiding the effort of writing tests from scratch, the reality is that in the short, medium, and long term, this approach will bring us significant headaches. The reason? &lt;strong&gt;The test won’t be solid enough to prove that the code meets its requirements and is free of critical bugs&lt;/strong&gt; (not all bugs—since it’s impossible to prove the absence of bugs, only their presence).&lt;/p&gt;

&lt;h4&gt;
  
  
  Beyond Code
&lt;/h4&gt;

&lt;p&gt;Beyond the code itself, this approach can harm us as developers. &lt;strong&gt;We risk losing reputation and credibility regarding the quality of our work.&lt;/strong&gt; At the same time, we lose the chance to learn valuable skills related to testing, which I find both beautiful (subjectively speaking) and crucial.&lt;/p&gt;




&lt;h3&gt;
  
  
  It’s Like Everything Else
&lt;/h3&gt;

&lt;p&gt;What I’m saying about testing applies to many other concepts in software development. It’s essential to understand that AI is just another tool in the developer’s arsenal. When used properly, it can make a significant difference—&lt;strong&gt;when used properly.&lt;/strong&gt; It cannot be used blindly for everything, just as we can’t dismiss it entirely and refuse to use it at all.&lt;/p&gt;

&lt;p&gt;As always, the challenge for software developers is to recognize this and &lt;strong&gt;balance the use of tools according to the context where they’re solving a problem.&lt;/strong&gt; After all, a software developer’s job is to solve problems strategically, using the right tools to achieve that goal.&lt;/p&gt;




&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;This perspective is based on my experience as a software developer. Of course, it’s far from being the ultimate truth and should be taken as one more point of view. I encourage you to share your thoughts in the comments so we can spark a discussion within the community and learn even more from each other.&lt;/p&gt;

&lt;p&gt;Happy coding! 🤓&lt;/p&gt;

</description>
      <category>testing</category>
      <category>ai</category>
      <category>development</category>
      <category>coding</category>
    </item>
    <item>
      <title>Stop doing component unit testing</title>
      <dc:creator>Franco</dc:creator>
      <pubDate>Fri, 24 Mar 2023 20:25:13 +0000</pubDate>
      <link>https://forem.com/frandev/stop-doing-component-unit-testing-22l5</link>
      <guid>https://forem.com/frandev/stop-doing-component-unit-testing-22l5</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The first time I entered a company as a developer, I did it as a sort of full stack, more oriented to Front End than Back End. At that moment, I was assigned to those who later became my very good mentors. Their role were basically sit next to me, and teach me the company rules, the project code, and algorithmic concepts that, for my zero experience, and my until that moment, academic formation, I don't knew very well.   &lt;/p&gt;

&lt;p&gt;One of that concepts, were &lt;strong&gt;"testing"&lt;/strong&gt;. Although I had an idea of what it meant, and I had interacted with it in the past years, I had never done automated testing from scratch, much less involving the company's tools and languages at the time (JS, Jest, Vue).&lt;/p&gt;

&lt;p&gt;So, little by little, with the passing of the tasks, I was learning to do this, giving as results tests of the style:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;// ExampleComponent.vue&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqogf4s06y3rtlbnj7cg2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqogf4s06y3rtlbnj7cg2.png" alt="Vue component"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;// ExampleComponent.spec.js&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8bh5t09gp5l6vg00dsh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8bh5t09gp5l6vg00dsh.png" alt="Jest unit test"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note that this test is an approximate and might not work, the important thing here is that you get the point. Here I'm using Vue as a Front End library &lt;a href="https://vuejs.org/" rel="noopener noreferrer"&gt;https://vuejs.org/&lt;/a&gt; and jest as a tool for testing &lt;a href="https://jestjs.io/" rel="noopener noreferrer"&gt;https://jestjs.io/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Yes, &lt;strong&gt;this is a correct unit test&lt;/strong&gt;, which covers the &lt;code&gt;script&lt;/code&gt; tag of the example Vue component, and, in a way, gives us some security... it's better than nothing. But, with the passing of the developments and the use of the system by the users, it became more and more clear that this type of test did not cover all the possible errors.&lt;/p&gt;

&lt;p&gt;In fact, the test is covering the behavior of the &lt;code&gt;init&lt;/code&gt; method and &lt;code&gt;dataToShow&lt;/code&gt; computed, but, we can see that we aren't testing the connection between the Vue component and its store, and we aren't testing the reaction of the component's template when the state of the variables change. In conclusion, we aren't close to simulate the user's behavior in the view.&lt;/p&gt;

&lt;p&gt;Something I have learned as I have gained experience, is that while the more close is the test to the user, and the less mocks it has, the better. &lt;/p&gt;

&lt;p&gt;While a unit test, tells us if the code of some method runs in an expected way, an integration test tells us if a &lt;strong&gt;complete use case&lt;/strong&gt; behaves in an expected way, &lt;strong&gt;resulting in a stronger, safer, and more reliable test&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And believe me, in my case, this type of testing has caught bugs in situations that a unit test hasn't.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The solution
&lt;/h2&gt;

&lt;p&gt;So, at the end, how can we do a test like that?&lt;/p&gt;

&lt;p&gt;Well, the key here is to think on how we can convert the manual actions that the user does in the view, in automated actions in our test.&lt;/p&gt;

&lt;p&gt;For the example we saw before, we have the following manual actions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the view&lt;/li&gt;
&lt;li&gt;Press the init button&lt;/li&gt;
&lt;li&gt;View the information once it is loaded&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, how can we convert the previous test to simulate this manual actions?&lt;/p&gt;

&lt;p&gt;In this Vue concrete case, we can do it using the Vue Test Utils &lt;a href="https://v1.test-utils.vuejs.org/" rel="noopener noreferrer"&gt;https://v1.test-utils.vuejs.org/&lt;/a&gt; (every library/framework has its own tool for this):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ghjyf2015xwn8hgz652.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ghjyf2015xwn8hgz652.png" alt="Jest integration test"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that this approach force us to make identifiable the elements we are testing. Because of that, we refactor the example Vue component as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhwy89q8hvmd2kqotpduf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhwy89q8hvmd2kqotpduf.png" alt="Vue component with identifiable elements"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, through this test, &lt;strong&gt;we are ensuring the correct behavior of the complete use case that we saw before&lt;/strong&gt;, since we are simulating the actions the user would do in the view. And now, we have a more coverage (Vue script, store, Vue template) from a test that has fewer lines of code. This is great, isn't?&lt;/p&gt;

&lt;h2&gt;
  
  
  Some cons and their solutions
&lt;/h2&gt;

&lt;p&gt;Right, from my experience, this type of test come with a couple of cons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They are more difficult to build, because now, we have to think how can we test a complete use case, instead of think how can we test some lines of code from a method. This leads us to think in how can we do the manual actions of the user in an automated test, and, how can we test more lines of code together.&lt;/li&gt;
&lt;li&gt;Since we are using the template to perform actions and asserts, there are troubles with the time of the render. A correct test might fail randomly, because some part of the component is not render yet for the next action or the next assert.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the first cons, the solution is very simple, just get practice until this type of test become more natural.&lt;/p&gt;

&lt;p&gt;For the second cons, after a lot of research, I find a very solid solution, through this method:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

export const retry = (assertion, {
  interval = 20, timeout = 1000,
} = {}) =&amp;gt; {
  return new Promise((resolve, reject) =&amp;gt; {
    const startTime = Date.now();

    const tryAgain = () =&amp;gt; {
      setTimeout(() =&amp;gt; {
        try {
          resolve(assertion());
        } catch (err) {
          Date.now() - startTime &amp;gt; timeout ? reject(err) : tryAgain();
        }
      }, interval);
    };

    tryAgain();
  });
};


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This method repeat an action in a period of time that cannot be measure for us, the humans, and allows the component to finish its render. It's like perform an &lt;code&gt;await wrapper.vm.$nextTick()&lt;/code&gt; the necessary times until the component reach the render of the previous action, without increase the running time of the test. This way, we create a test that doesn't depend on the render time of the component. If the test is correct, then pass, if the test isn't, then doesn't pass. Simple.&lt;/p&gt;

&lt;p&gt;Now, we refactor our test to remove the second cons:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqh65pai60hlrxfw97ai.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdqh65pai60hlrxfw97ai.png" alt="Jest integration test with retry method"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I hope you enjoyed this article and, more importantly, that you learned something new. Remember, this (like everything in programming) is all about context, in some cases it's better to do unit tests, in others it's better to do integration tests, or do both, It depends on you.&lt;/p&gt;

&lt;p&gt;Any opinion/suggestion/improvement is welcome, please comment below!&lt;/p&gt;

&lt;p&gt;Thanks so much for reading, happy code! &lt;/p&gt;

</description>
      <category>programming</category>
      <category>testing</category>
      <category>javascript</category>
      <category>vue</category>
    </item>
  </channel>
</rss>
