<?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: Somesh Thakur</title>
    <description>The latest articles on Forem by Somesh Thakur (@someshthakur).</description>
    <link>https://forem.com/someshthakur</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%2F713409%2F6005d9d5-7a84-49cf-a202-b25cac6ff44e.jpeg</url>
      <title>Forem: Somesh Thakur</title>
      <link>https://forem.com/someshthakur</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/someshthakur"/>
    <language>en</language>
    <item>
      <title>How to ensure the highest quality of Software code</title>
      <dc:creator>Somesh Thakur</dc:creator>
      <pubDate>Sun, 26 Sep 2021 09:20:36 +0000</pubDate>
      <link>https://forem.com/someshthakur/how-to-ensures-highest-quality-of-software-4917</link>
      <guid>https://forem.com/someshthakur/how-to-ensures-highest-quality-of-software-4917</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; By following best industry practices like linting, unit testing, static code analysis and continuous monitoring of the software.&lt;/p&gt;

&lt;h2&gt;
  
  
  Modern Software Development
&lt;/h2&gt;

&lt;p&gt;The software development process has changed a lot in last few years. Many of the modern tools &amp;amp; frameworks has built-in support to ensure that the code is clean, maintainable and readable. But any developer can make mistakes while coding a feature on mind and that's totally fine. We all have gone through that stage &amp;amp; we learnt through making mistakes.&lt;/p&gt;

&lt;p&gt;In this article I am going to share some of the basic to advanced levels of checks which I learnt through working on Enterprise software applications. These are some of the best practices that you can follow or explore.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Code Linting
&lt;/h3&gt;

&lt;p&gt;One of the basic setup that gives many advantages in long run is code linting. It leaves very minimal space to a developer to write unconventional or unreadable code. You can also ensure the rules of your coding conventions that your team might have agreed upon.&lt;/p&gt;

&lt;p&gt;My team uses &lt;strong&gt;TSLint&lt;/strong&gt; on our Angular project (that comes by default with the framework) to have standard clean coding conventions. The typical TSLint config of our project might look something like below image.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  2. Unit Testing
&lt;/h3&gt;

&lt;p&gt;The biggest layer in the testing pyramid which tells us to test every unit of your code. If you spend enough time writing meaningful &amp;amp; good quality unit testing logic, it will give you sweet fruitful results that can lead to bug free development experience.&lt;/p&gt;

&lt;p&gt;We use &lt;a href="https://github.com/istanbuljs/nyc" rel="noopener noreferrer"&gt;Istanbul&lt;/a&gt; tool's code coverage thresholds with lines rule of &amp;gt; 85%. We also make sure that any new code addition through merge requests should also match up to the expectations. (How? Read the next parts.)&lt;/p&gt;

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

&lt;h3&gt;
  
  
  3. Husky hooks
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://typicode.github.io/husky/" rel="noopener noreferrer"&gt;Husky&lt;/a&gt; 🐶 is one of the best git hook tool that you can add to your project. It gives you ability to fail first i.e., fail in your development environment. You can add many kind of hooks some of them which we use are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checking commit messages to follow specific format set by team&lt;/li&gt;
&lt;li&gt;Checking lint/format issues&lt;/li&gt;
&lt;li&gt;Running unit test cases when pushing code to remote repository&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h3&gt;
  
  
  4. CI/CD Pipeline
&lt;/h3&gt;

&lt;p&gt;On every merge request, a CI/CD pipeline triggers to check code's overall linting, formatting &amp;amp; running unit test cases. This ensures the integrity is maintained while adding a new component/feature. There are other pipelines scheduled like deployment on merge, weekly sonarqube checks (read more below), monthly vulnerblity test through Veeracode etc.&lt;/p&gt;

&lt;p&gt;The Jenkins pipeline runs through groovy scripts and send out the result reports to team's mailing list. &lt;/p&gt;

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

&lt;h3&gt;
  
  
  5. Static Code analysis
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://www.sonarqube.org/" rel="noopener noreferrer"&gt;Sonarqube&lt;/a&gt; platform gives a continuous static code analysis quality assurance. Any technical or non technical person can go through various reports of Sonarqube like app security, code smells, tech debts, etc and get a overview of the current state of code.&lt;/p&gt;

&lt;p&gt;It also helps to detect the missed Test coverages, Duplications, Cyclomatic complexity on the go. The weekly Sonarqube pipeline  helps us to have quality gate which needs to be cleared before going to production live.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  6. [Optional] In depth Security Scan
&lt;/h3&gt;

&lt;p&gt;Well this might be optional for many but for the enterprise level scaled applications, it needs to be shielded with all levels of securities in place. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.veracode.com/" rel="noopener noreferrer"&gt;Veracode&lt;/a&gt; security inspections is a must to have for us. We have monthly pipeline which uploads zipped version of code and runs the scan in veracode platform. &lt;/p&gt;

&lt;p&gt;We also use BlackDuck, WhiteHat for more in-depth testing of our applications that determines every layer is covered with all the best protocols that are followed. &lt;/p&gt;

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

&lt;p&gt;That's all folks, thanks for reading. Do leave your comments below :) &lt;/p&gt;

</description>
      <category>software</category>
      <category>development</category>
      <category>security</category>
      <category>bestpractices</category>
    </item>
  </channel>
</rss>
