Category Archives: Software Quality

Code Quality Interview Questions for Software Developers

software code quality interview questions

Code quality concepts must be understood well by software developers to write a good quality code. Also, technical lead and technical architects must understand the code quality (or coding) concepts very well in order to review the code (termed as code review) and ensure that good quality software is delivered to the customer. Pictorially, the following represents some of the experiences that software developers, tech leads or technical architects go through while developing software or reviewing software code quality. Enjoy the pictures :). Often code quality review of poorly written code results in lot of frustrations among project stakeholders. Thus, it is of utmost important to understand different nuances of writing code …

Continue reading

Posted in Interview questions, Software Engg, Software Quality. Tagged with , .

Single Responsibility Principle with Java Code Example

single responsibility principle with Java example

Single Responsibility Principle (SRP) is one of the most important object-oriented coding principle which, if followed religiously, can help you write a very good quality code. Here is what SRP states: A block code representing class or method should have just one reason to change In other words, Single Responsibility Principle can be stated as the following: A block of code representing class or a method should do just one thing and do it very well In yet another words, SRP can also be stated as the following: A block of code representing class or method should have just one responsibility or serve just one functionality Pictorially, decide for yourself …

Continue reading

Posted in Maintainability, Reusability, Software Engg, Software Quality. Tagged with , .

Unit Testing Interview Questions – Set 1

interview questions, practice tests on unit testing

This page lists down the practice tests / interview questions and answers for unit testing (general concepts) which applies for all programming languages. Those wanting to test their unit testing knowledge would find this test useful enough. The goal for this practice test is to help you do quick check of your knowledge in unit testing and prepare appropriately. More importantly, when you are preparing for interviews, these practice tests are intended to be handy enough. Those going for freshers / intern interviews in the area of programming language or for developer positions would also find these practice tests / interview questions to be very helpful. Following topics have been covered as part of …

Continue reading

Posted in Interview questions, Unit Testing. Tagged with , .

Software Build & Release Versioning Strategy

The blog represents the software build and release versioning strategy which can be used to tag web or mobile releases with different version numbering schemes as illustrated later. The strategy can as well be used for software versioning. Build/Release Version Numbering Scheme – <major>.<minor>.<patch>.<buildnumber> A release version can be of type <major>.<minor>.<patch>.<buildnumber>. Following is what each of these keywords such as major, minor, patch and buildnumber represents: major: Indicates a significant change in the application which may essentially mean one of the following: The app is re-written The app has changed significantly so much so that backward compatibility with older versions gets broken. Large set of new features At times, …

Continue reading

Posted in DevOps, Operability, Software Engg. Tagged with .

Solution to Permission Denied (Public Key) for Git Clone

Following error occurs while you are trying to clone a git project. I tried cloning a Github demo project in relation with ReactJS and NodeJS using command such as git clone In this blog, we will look into the solution of this github permission denied (public key) issue related with cloning a project using git clone command. Solution to Permission Denied (Public Key) Error Generated a new SSH Key The details can be found on this page, Generating a new SSH key and additing it to the ssh-agent Add the public key to your Github account As shown in the screenshot below, you would be required to add the …

Continue reading

Posted in Operability, Software Engg.

Mocha Unit Tests with Hello World

This blog helps you get started with Mocha and also present steps and sample tests which can be used to get started. Setup Mocha using NPM For installing Mocha globally such that it can be from anywhere, execute following command: For installing with npm, you may be required to install Nodejs. npm is distributed with NodeJS which implies that downloading and installing NodeJS automatically installs npm on your computer. One can get appropriate version of NodeJS from following page, Download NodeJS. Details on npm can be found on this page, NPM. Execute mocha command to make sure it is installed appropriately. Following is the screenshot of output as a result …

Continue reading

Posted in Javascript, Maintainability, Software Quality, Unit Testing. Tagged with .

Why consider using Guava-like Libraries for API Contract Conditions Checks

This article represents a perspective on why one should consider using Pre/Post condition checks libraries rather than writing it down time and again in their code. While doing code reviews, many a times, I have found people using preconditions checks such as “Not Null” in a casual manner rather than based on API contracts requiring pre and post conditions checks. Such checks, at times,  do make code difficult to read, learn or understand. One may want to rather use home-grown or external (proven ones) libraries for doing such checks. Not only does it enhance code readability and learn-ability but also, it does make you aware of contracts you put in the code thereby including only necessary checks and, …

Continue reading

Posted in Code Review, Software Quality, Tools. Tagged with , .

Liskov Substitution Principle with Java Code Examples

This article describes what is Liskov Substitution Principle along with code examples in Java. Please feel free to comment/suggest if I missed mentioning one or more important points. Also, sorry for the typos. In this post, you will learn some of the following: What is Liskov Substitution Principle (LSP)? Code Samples to Illustrate LSP What is code quality characteristic that represents by LSP? You may also want to check another code quality principle such as Single Responsibility Principle explained with Java Examples. What is Liskov Substitution Principle (LSP)? Take a look at this paper on Liskov Substitution Principle which provides great details on Liskov Substitution Principle. As per LSP, functions …

Continue reading

Posted in Java, Programming, Software Quality. Tagged with , .

SonarLint for Eclipse – Do Proactive Code Quality Check

This blog talks about SonarLint tool for Eclipse IDE which could be used by developers to get on-the-fly feedback for code quality issues when they are writing the code. This feature was always one of the most awaited feature of Sonar and thankfully, it’s out there for Java, Javascript, PHP developers to try it out for themselves. Following is how one could get started: One needs to download and install SonarLint for eclipse within Eclipse IDE. All one needs to do is go to this page ( ), click on “Marketplace” button which takes you to install page. Drag and drop “install” button in your eclipse workspace and it would …

Continue reading

Posted in Software Quality. Tagged with .

Docker – How to Install Mean Environment

This blog represents tips and code samples in relation with how to install MEAN Docker Container for working with MEAN web app.

Posted in Software Quality.

Javascript – Jasmine Unit Tests for Promise Object

This article represents tips and code samples in relation with how to write unit tests for Promise object when using Jasmine framework. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Sample Promise Object Unit Tests related with Promise Object Sample Promise Object Pay attention to some of the following in the code below: Auth module returns a Promise object that returns a User object when resolved or returns an error object in case of error. A JSON object is passed to resolve or reject method. Save the file …

Continue reading

Posted in Javascript, UI, Unit Testing. Tagged with , , .

5 Reasons Why Every Developer Must Adopt Dockers

This blog represents some of the key reasons why every developer must consider adopting for development. 1. Setup clean Dev environment within no time. Many a time, while developing, we end up changing configuration. Installing new libraries etc. With this act, the Dev environment deviates to a new state which may be different from expected QA and Production environment. With Dockers, one could rather update the image and create new containers in case new libraries need to be installed. 2. Setup Dev environment within minutes. As a matter of fact, developers could actually recreate the Dev environment every morning before starting his work. This ensures that he maintains the state …

Continue reading

Posted in Software Engg, Software Quality. Tagged with , , .

API – How to Get Started with Facebook API Integration

This article represents steps to get started with Facebook Graph API. In later articles, I shall explain how to integrate using Java and maybe other programming languages. The primary reason I am hooked to Facebook integration these days is my need for getting exploratory data from facebook for data analysis for my Big Data projects. Before getting onto use framework such as RestFB, it is recommended to play with these APIs in the Facebook-provided playground.  I shall be talking in detail about how to get started with RestFB in later articles. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the …

Continue reading

Posted in Software Quality. Tagged with , , .

How to use Sonar Dashboard to Report on Software Code Quality

This article represents methods one could adopt to read the sonar dashboard and gather data appropriately to monitor and control the software code quality. The primary reason why I am writing this blog is the fact that I have come across several team leads who asked me the questions related with data on sonar dashboard and what all they could do with it. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are three different aspects of software quality which could be tracked using Sonar Dashboard: Maintainability (testability, reusability & modularity) Usability (readability and understand-ability) Security Following are …

Continue reading

Posted in Software Quality. Tagged with .

Code Quality – Why Avoid Higher Cyclomatic Complexity?

This article represents my thoughts on why one should avoid a higher cyclomatic complexity (value more than 15 or so). Recently, I have been doing code reviews for multiple projects using Sonar. This is where I came across the rule called as “Cyclomatic Complexity”. The rule raises an alert for all the methods whose cyclomatic complexity is found to be more than 10. Thus, I thought of listing down reasons why one should pay attention to the cyclomatic complexity of method when he/she is writing fresh method or making changes to existing method. Personally, I do agree and strongly believe that one should avoid writing methods/function of code complexity higher than 15 or …

Continue reading

Posted in Software Quality. Tagged with .

JArchitect Version 4.0 on Mac OSX is GA for Download

Version 4.0 of JArchitect on Mac OSX is now available for anyone wishing to download and try it. JArchitect manage complex code base and achieve high Code Quality. With JArchitect, software quality can be measured using Code Metrics, visualized using Graphs and Treemaps, and enforced using standard and custom Rules via CQLinq queries. Features in JArchitect v4.0 include: A dashboard panel that shows the state of the current code base at a glance as well as a comparison to a baseline. Monitoring trends on 50 default “Trend Metrics” as well as custom trend metrics. These can be displayed through Trend Charts. Focus on recent rules violations (by using filters) that occur …

Continue reading

Posted in News, Software Quality.