<?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>DEV Community: David Rueda</title>
    <description>The latest articles on DEV Community by David Rueda (@drueda00).</description>
    <link>https://dev.to/drueda00</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%2F1159494%2F92a20d87-8b60-429e-ac8c-65b864fab661.png</url>
      <title>DEV Community: David Rueda</title>
      <link>https://dev.to/drueda00</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/drueda00"/>
    <language>en</language>
    <item>
      <title>I Hated Writing Tickets (Until I Used AI)</title>
      <dc:creator>David Rueda</dc:creator>
      <pubDate>Fri, 20 Feb 2026 09:07:42 +0000</pubDate>
      <link>https://dev.to/drueda00/i-hated-writing-tickets-until-i-used-ai-3a8o</link>
      <guid>https://dev.to/drueda00/i-hated-writing-tickets-until-i-used-ai-3a8o</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;🗣️ I hate creating tickets. I don’t know what value it provides to write an extensive explanation. I know what needs to be done, so I feel I’m losing valuable development time by spending so much time noting down all the little details.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Does this sound familiar? At some point, if you have worked as a software developer, ticket creation has been one of the main discussion topics in refinement sessions and retros. Many of us tend to think descriptive tickets are a waste of time. With simpler versions we could do what tickets are supposed to be for. Organizing work.&lt;/p&gt;

&lt;p&gt;But… What are the downsides of simpler tickets? Let’s list some: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Harder collaboration&lt;/strong&gt;: what happens if your colleague opens a ticket, but you are in charge of implementing it? What happens if you don’t have the context in which that ticket was created?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Traceability&lt;/strong&gt;: What decisions have been made?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diffuse Definition of Done (DoD)&lt;/strong&gt;: Are you sure the acceptance criteria for that ticket is actually met? Are you missing something?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provided value&lt;/strong&gt;: Is the ticket actually valuable to the user? Will it improve its experience?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’m sure all of you would be able to list some more disadvantages with ease. However, we need to find a balance between the ticket description and the time spent to create it. Nowadays, AI is an almost indispensable tool that is integrated in all of our workflows. And ticket creation should not be the exception.&lt;/p&gt;

&lt;p&gt;The good news? You can write better tickets with AI without sacrificing speed or context. Modern dictation tools bridge the gap between quick note-taking and comprehensive documentation.&lt;/p&gt;




&lt;h2&gt;
  
  
  📝 Creating tickets with Superwhisper
&lt;/h2&gt;

&lt;p&gt;AI-powered dictation helps development teams write better tickets with AI by capturing spoken context, structuring it automatically, and standardizing formats across the backlog.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://superwhisper.com/" rel="noopener noreferrer"&gt;Superwhisper&lt;/a&gt; is a “&lt;em&gt;ultra-fast AI powered dictation that understands what you want to say and how you want to say it.&lt;/em&gt;”. It is able to translate your ideas in pre-built formats (such as formal emails or messages) or &lt;strong&gt;custom formats&lt;/strong&gt; (we’ll address those in this article) that can be defined by a series of rules and applied in whatever applications you may need. &lt;/p&gt;

&lt;p&gt;And how does this apply to ticket creation? With some creativity, you’ll be easily able to transform functionality ideas or business requirements in detailed tickets in seconds!&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up Superwhisper
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Download Superwhisper from its homepage. It supports Windows, MacOS and iOS. &lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;Modes.&lt;/strong&gt; In this tab, you’ll be able to define custom or pre-built modes, and what applications and even pages these modes will be applied to. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fhshbxe1jjjzfw3qqfbds.webp" class="article-body-image-wrapper"&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%2Farticles%2Fhshbxe1jjjzfw3qqfbds.webp" alt="Superwhisper Modes screen listing existing modes and options to create or manage custom and pre-built modes." width="800" height="434"&gt;&lt;/a&gt;    &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new mode &lt;strong&gt;by&lt;/strong&gt; clicking on the ‘&lt;strong&gt;Create mode’&lt;/strong&gt; button and selecting ‘&lt;strong&gt;Custom’&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2F4ype71p343zvjv92kxmn.webp" class="article-body-image-wrapper"&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%2Farticles%2F4ype71p343zvjv92kxmn.webp" alt="Superwhisper dialog after clicking Create mode, showing the Custom option to create a new custom mode" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Define your rules.&lt;/strong&gt; This is the prompt I’ve been using so far, which has worked great. Feel free to modify it to meet your team or personal needs!
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a Senior Product Owner.

I will describe a software requirement in Spanish. // Add here your mother tongue! 
Your task is to:
1. Understand the requirement.
2. Translate it into clear English.
3. Rewrite it as a backlog ticket using the exact template below.

Rules:
- Use a clear USER TYPE.
- Acceptance criteria must be written as simple bullet points, not Gherkin.
- Each criterion must be testable and explicit.
- Do not invent requirements.

Template:

&amp;gt; [!IMPORTANT]
&amp;gt; _AS A_ `&amp;lt;USER TYPE&amp;gt;`
&amp;gt; _I WANT TO_ &amp;lt;user goal&amp;gt;
&amp;gt; _SO THAT_ &amp;lt;business value&amp;gt;

### Acceptance Criteria

- ...
- ...
- ...

### Technical Approach (optional)

- ...

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Define when you want to apply these rules&lt;/strong&gt;. E.g. If you use Brave browser and your ticket platform is Github, you can easily define that in the advanced settings:
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fqiwtc23vqsis36gdjcbi.webp" class="article-body-image-wrapper"&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%2Farticles%2Fqiwtc23vqsis36gdjcbi.webp" alt="Superwhisper Modes screen showing how to access the Advanced Settings by clicking the gear icon button on the bottom right when expanding the Custom Mode details" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fwyb05qwpm6tom5ttf6jj.webp" class="article-body-image-wrapper"&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%2Farticles%2Fwyb05qwpm6tom5ttf6jj.webp" alt="Superwhisper Modes screen showing the Advanced Settings section and the " width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🧪 Demo time!
&lt;/h3&gt;

&lt;p&gt;Imagine you are working on a SaaS application that displays information about the documents you uploaded, in a table format. Right now, the &lt;code&gt;Due Date&lt;/code&gt; field is&lt;br&gt;
displayed, and it's taking a lot of the table space when it's not needed immediately. You want to create a ticket to remove it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You use your shortcut to open Superwhisper.&lt;/li&gt;
&lt;li&gt;You say: **"I don't want the users to see the due date in the documents table"&lt;/li&gt;
&lt;li&gt;Superwhisper returns the following:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; [!IMPORTANT]
&amp;gt; _AS A_ `End user`
&amp;gt; _I WANT TO_ not see the expiration date column in the documents table
&amp;gt; _SO THAT_ the documents listing does not display expiry dates to users

### Acceptance Criteria

- The documents table in the UI no longer displays a column labeled "Expiration Date", "Expiry Date", "Due date" or similar.
- No expiration date value is visible in any row of the documents table for any document.
- Removing the column does not remove or alter other columns or data in the documents table.
- The table header layout adjusts correctly (no empty column gap) and aligns with remaining columns on desktop and mobile
  breakpoints supported by the product.
- Sorting, filtering and pagination on the documents table continue to function as before for the remaining columns.
- If there is a details/preview panel accessible from the table, it still shows the expiration date if that is a separate
  requirement; otherwise state if expiration date should also be hidden there (no change required per this ticket).
- Changes are covered by a UI visual check and an automated end-to-end test that asserts the expiration date column is not present.

### Technical Approach (optional)

- Remove or hide the expiration date column from the table component and any table column configuration.
- Update table CSS/layout to remove gap and ensure responsive behavior across supported viewports.
- Update frontend tests and add an end-to-end assertion to confirm column absence.
- Ensure backend APIs still return expiration date (if needed elsewhere); do not modify API unless required by product decisions.

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Voilà ✨! You’ve created your refined ticket!
&lt;/h3&gt;

&lt;p&gt;If you've struggled with ticket quality or time spent on documentation, learning to write better tickets with AI offers a practical solution. Tools like Superwhisper transform the process from a productivity tax into a lightweight investment in team clarity.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ticket writing doesn’t have to be a productivity tax. With the right tooling and a bit of automation, it becomes a lightweight investment in clarity, collaboration, and long-term velocity. If AI can help us spend less time documenting and more time building, that’s not overhead—that’s leverage.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>management</category>
      <category>webdev</category>
      <category>agile</category>
    </item>
    <item>
      <title>The 5 principles of Unit Testing</title>
      <dc:creator>David Rueda</dc:creator>
      <pubDate>Thu, 14 Sep 2023 14:14:43 +0000</pubDate>
      <link>https://dev.to/one-beyond/the-5-principles-of-unit-testing-1p5f</link>
      <guid>https://dev.to/one-beyond/the-5-principles-of-unit-testing-1p5f</guid>
      <description>&lt;p&gt;Get your software development to the next level with these 5 powerful principles of unit testing! Testing your code is one of the most important aspects of software development, as it ensures quality, scalability, and reliability of your product.  &lt;/p&gt;

&lt;p&gt;But, without any guidelines, it can be difficult to write effective tests. In fact, testing code can become more complex and harder to maintain than the actual production code! &lt;/p&gt;

&lt;p&gt;Don't let this happen to you. Follow these best practices for unit testing, which can be applied to any framework or library, both in the backend or frontend of your application, and you'll be able to write lean, accurate, and easy-to-read testing code. With these, you'll save valuable dev time, avoid technical debt, and enjoy testing your code: &lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Lean and accurate testing
&lt;/h2&gt;

&lt;p&gt;Testing code must be &lt;strong&gt;simple and easy to work with&lt;/strong&gt;. Anyone looking at the test should know instantly what the test is about and what its purpose is. Developing tests should bring great value with very little effort and time investment.  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Do you need more than 30 seconds to read and understand your test? Rewrite it!&lt;/em&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Testing just for ‘coverage percentage’? Don’t!!! This just makes the majority of the test suite to be unnecessary and undesirable for the developers. Test &lt;strong&gt;only what’s needed&lt;/strong&gt;. It’s better to drop some tests for agility and simplicity, &lt;strong&gt;testing only the main business logic and principal edge cases&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
&lt;br&gt; &lt;/p&gt;
&lt;h2&gt;
  
  
  2. Test the behaviour, not the implementation
&lt;/h2&gt;

&lt;p&gt;Don’t check every single line and internal variable changed in the code. When testing, you should &lt;strong&gt;focus on the result&lt;/strong&gt;. The result should always remain the same even if the code inside the method is refactored! &lt;/p&gt;

&lt;p&gt;This way, you &lt;strong&gt;won’t need to rewrite your tests if the code base is changed&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Wrong ❌ - Test behaviour&lt;/span&gt;
&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Evaluation Service&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Register Students&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Should add new students to the evaluation service&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;studentJosh&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Josh McLovin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;average&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;6.98&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;evaluationService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addStudent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;studentJosh&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

      &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;evaluationService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_students&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Josh&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;evaluationService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_students&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;average&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;6.98&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Right ✅ - Test behaviour&lt;/span&gt;
&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Evaluation Service&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Register Students&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Should add new students to the evaluation service&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;studentJosh&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Josh McLovin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;average&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;6.98&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

      &lt;span class="nx"&gt;evaluationService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addStudent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;studentJosh&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;evaluationService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getStudentAverage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Josh&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;6.98&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  3. Test naming and structuring. AAA pattern.
&lt;/h2&gt;

&lt;p&gt;Have you ever had a failing test named ‘&lt;em&gt;it should [...] correctly&lt;/em&gt;’ and lost a couple of minutes finding where the problem was? &lt;/p&gt;

&lt;p&gt;Naming and structuring your test suite can enhance your ability to address any failing tests swiftly and accurately, ultimately saving you valuable time. So, let's dive into two key principles to keep in mind for your next testing endeavours:  &lt;/p&gt;

&lt;h3&gt;
  
  
  3.1 Thoughtful test naming:
&lt;/h3&gt;

&lt;p&gt; When naming your tests, attempt to incorporate the following information: &lt;/p&gt;

&lt;p&gt;  - &lt;strong&gt;What&lt;/strong&gt; is being tested? &lt;br&gt;
    - Under &lt;strong&gt;what circumstances&lt;/strong&gt;? &lt;br&gt;
    - What is the &lt;strong&gt;expected outcome&lt;/strong&gt;?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Right ✅ - Test naming&lt;/span&gt;

&lt;span class="c1"&gt;// 1. What is being tested:&lt;/span&gt;
&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Evaluation Service&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Evaluate Students&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// 2 &amp;amp; 3. Context and expected result&lt;/span&gt;
    &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;If the student grade is below the minimum grade, student should be suspended&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;students&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Mark&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;4.25&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Colin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;6.7&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Ben&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;5.3&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;

      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;evaluationService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;evaluateStudents&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;students&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;minGrade&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;

      &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Mark&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;suspended&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  3.2 The AAA pattern for testing code structure:
&lt;/h3&gt;

&lt;p&gt; If you want to maintain a readable and easily comprehensible test suite, structure  the test as it follows:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Arrange&lt;/strong&gt;: set up all the code needed to simulate the required situation. This can include initialising variables, mocking responses, instantiating the unit under test, etc. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Act&lt;/strong&gt;: execute what is being tested, usually in a single line of code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assert&lt;/strong&gt;: check the obtained result is the expected one. Like the one above, this should take only one line.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Right - AAA Testing Pattern&lt;/span&gt;
&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Evaluation Service&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Average Calculation&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Should calculate the average grade of all the students&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Arrange: create an object with the student names and their grades&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;students&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Mark&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Colin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Ben&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Tim&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;grade&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;]&lt;/span&gt;

      &lt;span class="c1"&gt;// Act: execute the getAverage method&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;avg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;evaluationService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAverage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;students&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

      &lt;span class="c1"&gt;// Assert: check if the result is the expected one -&amp;gt; (4+10+7+3)/4 = 6&lt;/span&gt;
      &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  4. Deterministic and isolated tests
&lt;/h2&gt;

&lt;p&gt;If a single failing test turns your entire suite red, then you may not be approaching it in the right way! &lt;/p&gt;

&lt;p&gt;Tests should be &lt;strong&gt;independent and isolated&lt;/strong&gt;, targeting and dealing with one specific logic at a time, accomplishing a faster and more stable test suite. &lt;/p&gt;

&lt;p&gt;What happens &lt;strong&gt;if you don’t&lt;/strong&gt; write your tests independently?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You won’t be able to pinpoint the &lt;strong&gt;exact cause and location&lt;/strong&gt; of the bugs and issues.
&lt;/li&gt;
&lt;li&gt;When refactoring the tests, you will have to &lt;strong&gt;update and synchronise multiple ones&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;You won’t be able to run your tests in any order, which may cause &lt;strong&gt;breaking or skipping some of the assertions or expectations&lt;/strong&gt;.
&lt;p&gt; &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Property-based testing and realistic data
&lt;/h2&gt;

&lt;p&gt;Tired of writing a large amount of possible inputs in your tests? Property-based testing does it for you! But… What 's that? &lt;/p&gt;

&lt;p&gt;Property-based testing creates hundreds of possible combinations, stressing the test and &lt;strong&gt;increasing the opportunity of uncovering previously unnoticed bugs&lt;/strong&gt;. This approach can even return the inputs which may have caused an unexpected outcome. &lt;/p&gt;

&lt;p&gt;Libraries like &lt;a href="https://github.com/jsverify/jsverify" rel="noopener noreferrer"&gt;JSVerify&lt;/a&gt; or &lt;a href="https://github.com/dubzzz/fast-check" rel="noopener noreferrer"&gt;Fast-Check&lt;/a&gt; offer essential tools to facilitate property-based testing.&lt;/p&gt;

&lt;p&gt;However, if you prefer not to dig into such extensive testing, it is crucial to utilize &lt;strong&gt;realistic data&lt;/strong&gt; whenever possible. Inputs like 'abc' or '1234' might erroneously pass the test when it should actually fail.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Wrong ❌ - False Positive - Test that passes even though it shouldn't &lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EvaluationService&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;_students&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="p"&gt;[];&lt;/span&gt;

  &lt;span class="nf"&gt;addStudent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;student&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Add the student if the name has no numbers&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;student&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/^&lt;/span&gt;&lt;span class="se"&gt;([^&lt;/span&gt;&lt;span class="sr"&gt;0-9&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;*&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="sr"&gt;$/&lt;/span&gt;&lt;span class="p"&gt;)){&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_students&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;student&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Evaluation Service&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Register Students&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Should add students to the Evaluation service&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mockStudent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;username&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;average&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="c1"&gt;// Won't fail because the name is a string without number -&amp;gt; We are not checking what happens if the user&lt;/span&gt;
      &lt;span class="c1"&gt;// inputs a name with a number.&lt;/span&gt;
      &lt;span class="nx"&gt;evaluationService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addStudent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mockStudent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
      &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;evaluationService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getStudentAverage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;username&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="c1"&gt;// In the example above, we are making a test so the test passes, instead of looking for edge cases with realistic data&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus Tip!
&lt;/h2&gt;

&lt;p&gt;If you are getting a hard time testing any logic in your component, this could reflect that, maybe, you should break your component logic into smaller, easier and testable pieces of code!&lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, following this best practices may lead to a new, readable and maintainable way of testing your beloved production code. Thanks for reading! &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A tested app is a reliable app! &lt;/p&gt;
&lt;/blockquote&gt;

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