<?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: George Bakatsias</title>
    <description>The latest articles on Forem by George Bakatsias (@bakatsiasgeorge).</description>
    <link>https://forem.com/bakatsiasgeorge</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%2F887937%2F35341ae7-9d7d-4641-a46c-f52d456ce9eb.jpg</url>
      <title>Forem: George Bakatsias</title>
      <link>https://forem.com/bakatsiasgeorge</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bakatsiasgeorge"/>
    <language>en</language>
    <item>
      <title>5 QA automation interview-questions that senior engineers still get wrong</title>
      <dc:creator>George Bakatsias</dc:creator>
      <pubDate>Tue, 31 Mar 2026 12:12:04 +0000</pubDate>
      <link>https://forem.com/bakatsiasgeorge/-58hg</link>
      <guid>https://forem.com/bakatsiasgeorge/-58hg</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/bakatsiasgeorge/5-qa-automation-interview-questions-that-senior-engineers-still-get-wrong-1nii" class="crayons-story__hidden-navigation-link"&gt;5 QA Interview Questions That Senior Engineers Still Get Wrong&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="/bakatsiasgeorge" 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%2F887937%2F35341ae7-9d7d-4641-a46c-f52d456ce9eb.jpg" alt="bakatsiasgeorge profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/bakatsiasgeorge" class="crayons-story__secondary fw-medium m:hidden"&gt;
              George Bakatsias
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                George Bakatsias
                
              
              &lt;div id="story-author-preview-content-3411472" 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="/bakatsiasgeorge" 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%2F887937%2F35341ae7-9d7d-4641-a46c-f52d456ce9eb.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;George Bakatsias&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/bakatsiasgeorge/5-qa-automation-interview-questions-that-senior-engineers-still-get-wrong-1nii" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Mar 27&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/bakatsiasgeorge/5-qa-automation-interview-questions-that-senior-engineers-still-get-wrong-1nii" id="article-link-3411472"&gt;
          5 QA Interview Questions That Senior Engineers Still Get Wrong
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/bakatsiasgeorge/5-qa-automation-interview-questions-that-senior-engineers-still-get-wrong-1nii#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&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;
            3 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>
    </item>
    <item>
      <title>5 QA Interview Questions That Senior Engineers Still Get Wrong</title>
      <dc:creator>George Bakatsias</dc:creator>
      <pubDate>Fri, 27 Mar 2026 00:39:04 +0000</pubDate>
      <link>https://forem.com/bakatsiasgeorge/5-qa-automation-interview-questions-that-senior-engineers-still-get-wrong-1nii</link>
      <guid>https://forem.com/bakatsiasgeorge/5-qa-automation-interview-questions-that-senior-engineers-still-get-wrong-1nii</guid>
      <description>&lt;p&gt;Whether you're preparing for a QA Engineer or SDET interview, some questions trip up even experienced professionals. Here are 5 I've seen catch people off guard:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. "Design a test automation framework from scratch — what's your architecture?"
&lt;/h2&gt;

&lt;p&gt;Most candidates jump straight to tools (Selenium, Playwright).&lt;br&gt;
Interviewers want to hear about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Page Object Model vs Screenplay pattern&lt;/li&gt;
&lt;li&gt;Test data management strategy&lt;/li&gt;
&lt;li&gt;CI/CD integration approach&lt;/li&gt;
&lt;li&gt;Reporting &amp;amp; failure analysis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Start with the problem (&lt;em&gt;what are we testing?&lt;/em&gt;), not the tool.&lt;/p&gt;

&lt;p&gt;In real interviews, you might be handed a full Playwright project — complete with Page Object Model, Builder pattern, custom fixtures, and API + UI tests — and asked to explain the architectural decisions, not just run it.&lt;/p&gt;


&lt;h2&gt;
  
  
  2. "You have 2 hours to test this API — walk me through your approach"
&lt;/h2&gt;

&lt;p&gt;The trap: candidates start writing tests immediately.&lt;/p&gt;

&lt;p&gt;Better approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;5 min: Read the API docs/Swagger&lt;/li&gt;
&lt;li&gt;10 min: Identify critical paths &amp;amp; edge cases&lt;/li&gt;
&lt;li&gt;15 min: Set up collections (Postman/REST client)&lt;/li&gt;
&lt;li&gt;90 min: Execute tests (happy path → edge cases → security)&lt;/li&gt;
&lt;li&gt;Remaining: Document findings&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  3. "Look at this form and tell me what's wrong" (Attention to Detail)
&lt;/h2&gt;

&lt;p&gt;You're shown a screenshot of a registration form — something like a "New Registration" page with fields for user ID, password, name, email, address, and country.&lt;/p&gt;

&lt;p&gt;Everything &lt;em&gt;looks&lt;/em&gt; fine at first glance. But the interviewer expects you to catch things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Password confirmation is visible in plain text while the password field is masked&lt;/li&gt;
&lt;li&gt;The "First Name" field accepts numbers (&lt;code&gt;John Plainfield 777&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Validation messages are inconsistent — some fields show errors, others silently accept bad input&lt;/li&gt;
&lt;li&gt;The address field allows multiple selections when it shouldn't&lt;/li&gt;
&lt;li&gt;The copyright year at the bottom says 1811&lt;/li&gt;
&lt;li&gt;The "I am not a robot" is a simple checkbox instead of a proper CAPTCHA&lt;/li&gt;
&lt;li&gt;Missing asterisks on required fields like Email and Confirm Password&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most candidates spot 2–3 issues. Strong candidates find 10+. This tests whether you actually &lt;em&gt;look&lt;/em&gt; at what's in front of you or just tick boxes.&lt;/p&gt;


&lt;h2&gt;
  
  
  4. "Write a test for this code" (Code Reading Challenge)
&lt;/h2&gt;

&lt;p&gt;You get production source code and must decide which tests give full coverage. This isn't about writing code fast — it's about analytical thinking.&lt;/p&gt;

&lt;p&gt;For example, you might see pseudocode like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IF A &amp;gt; B THEN
    C = A - B
ELSE
    C = A + B
ENDIF
Read D
IF C = D Then
    Print "Error"
ENDIF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you're asked: &lt;em&gt;"What's the minimal test set to cover all branches?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most people say 5 tests, or 3. The answer is 2 — if you pick values that traverse complementary paths (one where both IFs are true, one where both are false), you get full statement and branch coverage.&lt;/p&gt;

&lt;p&gt;This question filters out people who test mechanically from those who reason about coverage.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. "Draft a bug report for this scenario"
&lt;/h2&gt;

&lt;p&gt;Sounds simple, but interviewers evaluate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clear title (not "bug in form")&lt;/li&gt;
&lt;li&gt;Steps to reproduce (exact, numbered)&lt;/li&gt;
&lt;li&gt;Expected vs Actual behavior&lt;/li&gt;
&lt;li&gt;Environment details&lt;/li&gt;
&lt;li&gt;Severity/Priority classification&lt;/li&gt;
&lt;li&gt;Urls/screenshots/logs as evidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A typical setup: you're given a requirement — say, a Payment module with a "Status" column that should show Red/Yellow/Green based on due dates. The developer implemented it, but in your testing you find the status turns Yellow when the due date is wrong instead of the one specified in the requirements.&lt;/p&gt;

&lt;p&gt;Now write the bug report. Most candidates write vague descriptions. What interviewers want to see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Title:&lt;/strong&gt; "Payment Status shows Yellow instead of a more precise condition"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Steps:&lt;/strong&gt; Access the URL, navigate to Payment, filter by specific rules&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expected&lt;/strong&gt; VS &lt;strong&gt;Actual&lt;/strong&gt; reasons should be clear&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reference:&lt;/strong&gt; Link to the requirement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The difference between a junior and senior bug report is precision. Developers should be able to reproduce the bug without asking you a single question.&lt;/p&gt;




&lt;h2&gt;
  
  
  Want to practice all of these?
&lt;/h2&gt;

&lt;p&gt;I put together a hands-on exercise pack with real scenarios, &lt;br&gt;
solution docs, and a Playwright automation project for almost nothing:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://www.diposhop.uk/products/qa-interview-pack/" rel="noopener noreferrer"&gt;QA Interview Content Pack&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Attention-to-detail exercise&lt;/li&gt;
&lt;li&gt;✅ Test case exercise&lt;/li&gt;
&lt;li&gt;✅ Code-reading challenge&lt;/li&gt;
&lt;li&gt;✅ Bug report writing exercise&lt;/li&gt;
&lt;li&gt;✅ A Playwright project (TypeScript, POM, fixtures, architectural decisions readMe)&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;What's the hardest QA interview question YOU've been asked? Drop it in the comments!&lt;/em&gt; 👇&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to Test-Driven Development (TDD) with C# Examples</title>
      <dc:creator>George Bakatsias</dc:creator>
      <pubDate>Wed, 29 Nov 2023 15:30:39 +0000</pubDate>
      <link>https://forem.com/bakatsiasgeorge/introduction-to-test-driven-development-tdd-with-c-examples-1gne</link>
      <guid>https://forem.com/bakatsiasgeorge/introduction-to-test-driven-development-tdd-with-c-examples-1gne</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the dynamic realm of software development, the pursuit of impeccable code, the avoidance of pesky bugs is the ultimate quest. &lt;br&gt;
Yet, this journey is full of challenges, particularly as projects grow in complexity, this is where Test-Driven Development (TDD) emerges as your trustworthy companion. In this article, we will dive into TDD, unravel its benefits, explore how to utilize it proficiently with C# code examples, and importantly navigate the complexities of requirements and what precisely should be tested. We will look at the aspects of software that need testing, with practical testing examples on: functionality, data types, boundaries, behavior driven tests, security, performance and integration.&lt;/p&gt;
&lt;h2&gt;
  
  
  The TDD Ballet
&lt;/h2&gt;

&lt;p&gt;What exactly does TDD entail? Envision TDD as a choreographed dance, with you as the choreographer:&lt;/p&gt;

&lt;p&gt;Step 1 Craft a Test: Picture building a calculator. Initially, you formulate a test case that articulates your code's intended behavior. It resembles composing the dance steps.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Test&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;TestAddition&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Calculator&lt;/span&gt; &lt;span class="n"&gt;calculator&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Calculator&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;calculator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AreEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&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;Step 2 Craft the Code: Subsequently, you script the code, ensuring it aligns with the aspirations of your test. This phase equates to instructing your dancers in the steps.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Calculator&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&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;Step 3 Execute the Test: It's time to evaluate whether your code performs the dance flawlessly. Execute the tests and verify that they passed as expected.&lt;br&gt;
&lt;/p&gt;

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

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

&lt;/div&gt;



&lt;p&gt;Step 4 Refine: If the dance seems somewhat lacking in elegance, you can fine-tune it. Polish your code to make it sleeker, swifter, or more efficient. However, remember the golden rule: don't disrupt what's already working.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Calculator&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ArgumentException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Input must be non-negative"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;nameof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&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;Step 5 Repeat: Continuously iterate through these steps for each new segment of the dance you intend to teach.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why TDD Triumphs
&lt;/h2&gt;

&lt;p&gt;TDD isn't just a dance; it's a dance-off where victory is guaranteed.&lt;/p&gt;

&lt;h4&gt;
  
  
  Offers
&lt;/h4&gt;

&lt;p&gt;Improved code quality: TDD can unveil any missing specifications of the feature you are developing and help find bugs early in the development cycle.&lt;/p&gt;

&lt;p&gt;Painless Maintenance: Your code becomes a breeze to maintain. Farewell to those late-night debugging expeditions.&lt;/p&gt;

&lt;p&gt;Swift Troubleshooting: If something falters, your tests pinpoint the trouble spot. No more sifting through code like a detective in a labyrinth.&lt;/p&gt;

&lt;p&gt;Regression Resilience: Armed with an array of tests, you can confidently introduce fresh moves without disarraying the old ones.&lt;/p&gt;

&lt;p&gt;Living Documentation: Your tests materialize as a cheat sheet for your code. Everyone comprehends what to expect in the dance.&lt;/p&gt;

&lt;p&gt;Team Harmony: TDD fosters cohesion among your team, developers and testers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Warrants Testing in TDD
&lt;/h2&gt;

&lt;p&gt;Now, let's now address the most basic question: What should be subjected to testing in TDD? Here is a thorough analysis of your software's components that demand close examination, along with real-world examples:&lt;/p&gt;

&lt;p&gt;Functionality Testing: This represents the very essence of TDD. You assess whether your code executes its designated functions. For instance, if you consider designing a calculator you should test against the addition function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Testing Calculator's Addition&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Test&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;TestAddition&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Calculator&lt;/span&gt; &lt;span class="n"&gt;calculator&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Calculator&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;calculator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AreEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&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;Data Type Testing: Validating data types for accuracy is essential. Ensure that the variables, inputs, and outputs you use correspond to the appropriate data type and size. This strategy works as a prevention towards data-related errors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Verification of Integer Data Type&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Test&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;TestIntegerDataType&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;42&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IsInstanceOfType&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&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;Edge Cases and Boundaries: Probe the extremities. Investigate the outcomes when you present the smallest or largest conceivable values. For instance, if your calculator can process integers, examine its behavior with the most minuscule and colossal integers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Edge Cases and Boundaries, adding one to int.MaxValue should throw an OverflowException&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Test&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;AddingOneToIntMaxValueThrowsOverflowException&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;maxValue&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MaxValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Throws&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;OverflowException&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;(()&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;checked&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;maxValue&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&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;UI Testing writing it the Gherkin way: UI testing assumes paramount importance for assuring the seamless functionality of your application's user interface. Tools such as Gherkin/SpecFlow provide a framework to draft human-readable scenarios that test the behavior of your application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gherkin"&gt;&lt;code&gt;&lt;span class="kn"&gt;Scenario&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; Successful User Login
    &lt;span class="nf"&gt;Given &lt;/span&gt;user navigates to the login page
    &lt;span class="nf"&gt;When &lt;/span&gt;inputs valid credentials
    &lt;span class="nf"&gt;And &lt;/span&gt;clicks the login button
    &lt;span class="nf"&gt;Then &lt;/span&gt;should be directed to the dashboard

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

&lt;/div&gt;



&lt;p&gt;Security Testing: Security should never be an afterthought. Investigate vulnerabilities such as SQL injection, cross-site scripting (XSS), and authentication flaws. Specialized security testing frameworks can unravel and mitigate these risks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Prevention of SQL Injection&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Test&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;TestSQLInjectionPrevention&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Simulate a SQL injection attempt&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;userInput&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"'; DROP TABLE Users; --"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;isSafe&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SecurityHelper&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IsInputSafe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;userInput&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IsTrue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isSafe&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;Performance and Benchmark Testing: Evaluation of your software's performance is crucial as it grows. How quickly is it able to work? Can it handle an abundance of users or data? Tools for performance testing shed light on these questions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Evaluate improvement on bottleneck operation&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;Params&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Count&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Benchmark&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;GeneratePrimesMethod1&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;GeneratePrimesMethod&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Count&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="n"&gt;Benchmark&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;GeneratePrimesMethod2&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;GeneratePrimesNewMethod&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Count&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Method 1: Simple prime number generation&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;GeneratePrimesMethod&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Implementation detail&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Method 2: New improved prime number generation method&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;GeneratePrimesNewMethod&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Implementation detail&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Integration Testing: Examine the interactions between the various parts of your software. This is especially important for complex systems with several interrelated components.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// API Integration Test&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;TestApiIntegration&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;ApiClient&lt;/span&gt; &lt;span class="n"&gt;apiClient&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ApiClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;ApiResponse&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;apiClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"https://someApi.aa/Getdata"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;Assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AreEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StatusCode&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;Regression Testing: As you introduce novel features or rectify defects, it's imperative to ascertain that the existing functionality remains unaffected. Execute regression tests to apprehend unintended side effects.&lt;/p&gt;

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

&lt;p&gt;In summary, Test-Driven Development (TDD) is your reliable ally in the realm of coding. It empowers you to create robust, bug-free software by putting tests at the forefront of your development process. With C# as your platform and a deep understanding of what aspects should undergo testing, you have the tools to engineer high-quality software. So, get ready to embark on your path to software excellence through TDD, where meticulous testing leads the way to success!&lt;/p&gt;

</description>
      <category>testing</category>
      <category>programming</category>
      <category>tdd</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Useful Keyboard Shortcuts</title>
      <dc:creator>George Bakatsias</dc:creator>
      <pubDate>Sun, 05 Mar 2023 23:00:04 +0000</pubDate>
      <link>https://forem.com/bakatsiasgeorge/useful-keyboard-shortcuts-3gml</link>
      <guid>https://forem.com/bakatsiasgeorge/useful-keyboard-shortcuts-3gml</guid>
      <description>&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;F2&lt;/strong&gt;: Rename identifier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ctrl + W&lt;/strong&gt;: Context sensitive selection (press multiple times to expand the selection).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ctrl + Shift + W&lt;/strong&gt;: Reversing context sensitive selection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ctrl + Shift + R&lt;/strong&gt;: Open refactoring quick menu.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ctrl + Alt + Enter&lt;/strong&gt;: Reformat code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Double Shift&lt;/strong&gt;: Search everywhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ctrl + Shift + A&lt;/strong&gt;: Quick menu to create a file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alt + Enter&lt;/strong&gt;: Show Intention Actions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ctrl + Space&lt;/strong&gt;: Basic auto completion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;F12&lt;/strong&gt;: Go to implementation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;u&gt;Get full list&lt;/u&gt;&lt;/em&gt; &lt;a href="https://www.jetbrains.com/help/rider/Reference_Keyboard_Shortcuts_Index.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Poor method signatures</title>
      <dc:creator>George Bakatsias</dc:creator>
      <pubDate>Sun, 05 Mar 2023 22:59:48 +0000</pubDate>
      <link>https://forem.com/bakatsiasgeorge/how-refactoring-tools-can-help-you-write-cleaner-code-c-rider-poor-method-signatures-nlc</link>
      <guid>https://forem.com/bakatsiasgeorge/how-refactoring-tools-can-help-you-write-cleaner-code-c-rider-poor-method-signatures-nlc</guid>
      <description>&lt;p&gt;Poorly designed method signatures are a prevalent code smell that can significantly impede code comprehension, maintenance, and testing. Method signatures serve as the public interface of your code, and it is crucial for them to clearly communicate the method's purpose, expected inputs, and returned outputs. Inadequate method signatures can lead to confusion and errors, particularly in team environments or when working with legacy code. Let's explore different categories of poor method signatures to be aware of:&lt;/p&gt;

&lt;p&gt;Overloaded Methods:&lt;br&gt;
Overloading methods with the same name but different parameter types or numbers can introduce confusion and errors. While overloading can be useful for offering multiple ways to perform an operation, excessive overloaded methods can make it challenging to remember the parameter order and types, leading to difficulties in distinguishing between them in code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Methods that lead to confusion&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;decimal&lt;/span&gt; &lt;span class="nf"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;decimal&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;decimal&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Methods With Too Many Parameters:&lt;br&gt;
Methods that require an excessive number of parameters can be challenging to understand and use. Having numerous parameters makes it difficult to remember their order and meaning, and it can also complicate testing the method with all possible parameter combinations. Moreover, methods with an abundance of parameters often indicate poor encapsulation, exposing too much internal state to callers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Poor method signature&lt;/span&gt;
&lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Calculate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;isFast&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;isExact&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;useCache&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Improved method signature&lt;/span&gt;
&lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Calculate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CalculationParameters&lt;/span&gt; &lt;span class="n"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Methods With Inconsistent Parameter Ordering:&lt;br&gt;
Inconsistent parameter ordering among methods in the same class or module can confuse developers, making it hard to remember the correct order for each method. Additionally, inconsistent parameter ordering can lead to mistakes when using code completion and copying and pasting code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Poor parameter ordering&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Subtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Improved parameter ordering&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;Subtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Methods with Vague Return Types:&lt;br&gt;
Methods with ambiguous return types can be challenging to understand and utilize. When a method returns a generic type like "object" or "dynamic," it becomes challenging to determine the actual return value and the available operations that can be performed on it. Such vague return types can hinder code completion and lead to errors when the returned value is used elsewhere in the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Vague return type&lt;/span&gt;
&lt;span class="kt"&gt;object&lt;/span&gt; &lt;span class="nf"&gt;ParseFileContents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Clear return type&lt;/span&gt;
&lt;span class="n"&gt;ParsedFileContents&lt;/span&gt; &lt;span class="nf"&gt;ParseFileContents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Methods with Too Many Side Effects:&lt;br&gt;
Methods with excessive side effects are difficult to reason about and test. Modifying internal state or the state of other objects within a method can make it unclear what the method does and how it affects the rest of the code. Additionally, methods with numerous side effects can be challenging to test due to unexpected interactions with other parts of the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Code with to many side effects&lt;/span&gt;
&lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Deposit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;amount&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 amount to balance&lt;/span&gt;
     &lt;span class="c1"&gt;// Code to update database and log transaction&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Omitted side effects&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Deposit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;amount&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 amount to balance&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Poor Naming Convention:&lt;br&gt;
Using inconsistent or unclear naming conventions for methods can hinder code readability and maintainability. Employing consistent naming conventions helps make code easier to understand and maintain, saving time and effort in the long run.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Poor naming convention&lt;/span&gt;
&lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;save_to_database&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;// Improved naming convention&lt;/span&gt;
&lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;SaveToDatabase&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By following good practices for method signatures, you can make your code more readable, maintainable, and testable. Remember to choose clear and descriptive names, limit the number of parameters and side effects, use consistent parameter ordering and return types, and use refactoring tools like Rider to help you improve your code.&lt;/p&gt;




&lt;p&gt;Here is a way of how Rider's refactoring tools can help to encapsulate a long parameter list of a method into a class:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select the method name.&lt;/li&gt;
&lt;li&gt;Right-click and select "Refactor" &amp;gt; "Convert" &amp;gt; "Transform Parameters" from the context menu.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keyboard Shortcuts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ctrl + Shift + R &amp;gt; Convert &amp;gt; Transform Parameters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rider will then prompt you to enter a new name for the class(CalculationParameters), select which parameters to transform and will automatically update all references to that method replacing it with your new class.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Poor Names</title>
      <dc:creator>George Bakatsias</dc:creator>
      <pubDate>Sun, 05 Mar 2023 22:59:38 +0000</pubDate>
      <link>https://forem.com/bakatsiasgeorge/how-refactoring-tools-can-help-you-write-cleaner-code-c-rider-poor-names-1fjn</link>
      <guid>https://forem.com/bakatsiasgeorge/how-refactoring-tools-can-help-you-write-cleaner-code-c-rider-poor-names-1fjn</guid>
      <description>&lt;p&gt;In software development, code smells such as poor names can greatly hinder code comprehension and maintainability. Inadequate naming of variables, methods, and classes can lead to confusion and errors. It's important to be aware of various categories of poor names:&lt;/p&gt;

&lt;p&gt;Mysterious Names: These names fail to convey their intention or purpose. Examples include using vague variable names like "dr1" instead of "dataReader" or employing ambiguous method names like "Button1_Click" instead of "CheckAvailability_Click".&lt;/p&gt;

&lt;p&gt;Meaningless Names: These names are overly generic and lack descriptive meaning. Instead of using convoluted method names like "BeginCheckFunctionality_StoreClientSideCheckboxIDsArray", it's better to opt for more descriptive names that clearly indicate the method's purpose.&lt;/p&gt;

&lt;p&gt;Names with Encodings: This refers to the use of prefixes, suffixes, or Hungarian notation to indicate data types or scope. With modern IDEs providing advanced features, encoding is no longer necessary. Let the IDE handle the determination of data types, avoiding encodings like Hungarian notation.&lt;/p&gt;

&lt;p&gt;Ambiguous Names: These names can be interpreted in multiple ways, leading to confusion. For instance, a method named "MultiSelect" could be unclear about whether it selects multiple items or handles multiple selections. Similarly, a variable named "incidentNameId" raises questions about its nullability or the presence of "Name" in the name itself.&lt;/p&gt;

&lt;p&gt;Noisy Names: These names are excessively verbose or redundant. Instead of using long variable names like "theCustomer" or "listOfApprovedCustomers", it is better to use concise names such as "customer" and "approvedCustomers".&lt;/p&gt;

&lt;p&gt;To avoid poor names, ensure that your chosen identifiers are meaningful, of appropriate length, convey intention, and are relevant to the problem domain you are working on. Additionally, you can employ refactoring tools like Rider to easily and efficiently rename identifiers without introducing any issues into your codebase. By adhering to these guidelines, your code will be more readable, understandable, and maintainable for both yourself and other developers.&lt;/p&gt;

&lt;p&gt;Let's consider a C# example to illustrate how naming conventions can significantly impact code clarity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Poorly named variables and methods&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// overdue days&lt;/span&gt;
&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// customer&lt;/span&gt;
&lt;span class="kt"&gt;double&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// prices&lt;/span&gt;
&lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;fc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// function to calculate discounts&lt;/span&gt;

&lt;span class="c1"&gt;// Well-named variables and methods&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;overdueDays&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;customerName&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;double&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;itemPrices&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;CalculateDiscounts&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, the poorly named variables and methods employ single-letter names or abbreviations that provide little insight into their purpose. Conversely, the well-named variables and methods use descriptive names that clearly indicate their intent.&lt;/p&gt;

&lt;p&gt;By following proper naming conventions, you can greatly enhance code readability and comprehension, saving time and effort for both you and fellow developers. Remember to choose meaningful and relevant names that align with the problem domain. And don't forget to utilize refactoring tools like Rider, which facilitate quick and hassle-free identifier renaming.&lt;/p&gt;




&lt;p&gt;Here is a way of how Rider's refactoring tools can help:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select with your mouse the variable or method&lt;/li&gt;
&lt;li&gt;Do a mouse right click and go to "Refactor &amp;gt; Rename" 
(or go from the "Refactor" menu in the ribbon).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keyboard Shortcuts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;F2&lt;/li&gt;
&lt;li&gt;Or Ctrl + Shift + R &amp;gt; Rename&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rider will then prompt you to enter a new name for the identifier, and will automatically update all references to that identifier throughout your codebase.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Cleaner Code &amp; Refactoring Tools (C# &amp; Rider)</title>
      <dc:creator>George Bakatsias</dc:creator>
      <pubDate>Sun, 05 Mar 2023 22:59:24 +0000</pubDate>
      <link>https://forem.com/bakatsiasgeorge/how-refactoring-tools-can-help-you-write-cleaner-code-c-rider-2okm</link>
      <guid>https://forem.com/bakatsiasgeorge/how-refactoring-tools-can-help-you-write-cleaner-code-c-rider-2okm</guid>
      <description>&lt;p&gt;series: How refactoring tools can help you write cleaner code&lt;/p&gt;

&lt;p&gt;Refactoring refers to the process of enhancing the internal structure of code while preserving its external behavior. It plays a crucial role in software development as it enables developers to modify code without introducing bugs or disrupting existing functionality.&lt;/p&gt;

&lt;p&gt;The practice of refactoring involves making small, incremental modifications to code, aiming to enhance its readability, maintainability, and scalability. Typically, refactoring occurs during the maintenance and update phases of code development.&lt;/p&gt;

&lt;p&gt;Refactoring tools are software applications that automate the process of refactoring. These tools assist developers in identifying areas of code that can be improved and offer suggestions for implementing those improvements.&lt;/p&gt;

&lt;p&gt;Integrating with Integrated Development Environments (IDEs) like Eclipse, Visual Studio, or IntelliJ IDEA, refactoring tools become a part of the development workflow. They can also function as standalone applications within a development setup.&lt;/p&gt;

&lt;p&gt;Refactoring tools contribute to cleaner code in multiple ways. Firstly, they detect areas of code that could benefit from improvements by identifying duplicated code, unused variables, and other code smells. This feedback assists developers in prioritizing the refactoring process and addressing areas that require the most attention.&lt;/p&gt;

&lt;p&gt;Secondly, refactoring tools provide recommendations for improving code quality. They propose ways to simplify code, extract methods, and enhance naming conventions, aiding developers in writing cleaner and more maintainable code.&lt;/p&gt;

&lt;p&gt;Thirdly, refactoring tools automate the refactoring process by executing tasks like variable renaming, method extraction, and code relocation across classes or files. This automation saves developers time and reduces the risk of introducing new bugs.&lt;/p&gt;

&lt;p&gt;Lastly, refactoring tools help enforce coding standards and best practices, ensuring code quality. They can verify code compliance with established guidelines and highlight areas that deviate from these standards. This promotes consistency and maintainability in the codebase.&lt;/p&gt;

&lt;p&gt;To sum up, refactoring tools are indispensable for developers seeking to produce clean, maintainable code. They identify areas for improvement, offer suggestions, automate refactoring tasks, and uphold code quality. Utilizing these tools enables developers to enhance their code's quality, while minimizing the risk of introducing bugs.&lt;/p&gt;

&lt;p&gt;In the upcoming series, we will explore practical examples of refactoring C# code using the Rider IDE (or Resharper). This exploration will emphasize the benefits and advantages of employing refactoring tools.&lt;/p&gt;

</description>
      <category>startup</category>
      <category>career</category>
      <category>productivity</category>
      <category>brainstorming</category>
    </item>
  </channel>
</rss>
