Code Quality is a measure of how maintainable your code is.
Code is reviewed all the time and is to have static analysis of the code are the ways to measure the code quality. Static analysis of code can be done by using tools like sonarQube, CSS LINT.10 Aspects that supports the quality of the code
- Code should implement what is only required. Implementation should be to cover the requirements, and tasks like creating reusable components. And also make sure that only the required libraries, frameworks and resources are included in the project. Through it could be reduced the overall size and avoid confusion.
- Code should be implement the required task in the simplest way that can be possible. Always, a simple code takes less time to finish the work and it reduces the cost.
- Code should meet the basic performance requirements to time and memory efficiency of the applied algorithm. So that, the user experience is not compromised. Algorithms must be analysed to determine their resource usage. For maximum efficiency should minimize resource usage.
- Code should have proper error handling. It should be able to recover from the error without blocking users and producing error messages. Error handling refers to the expectation, detection and resolution of the errors. Syntax errors are easy to find and can fix when code is compiling.Logic errors, also called bugs, occur when executed code does not produce the expected result.
- Code should avoid repetition all possible. There include declaring variables, writing comments, writing functions, declaring classes to implement high level modules.
- Code should have comments which are accurate, clear, short and only at the required places. Always remember that code tells "how", comment tells "why". Adding comments in the code where want to give an explanation will help to other developers to understand the code.
- Code should adhere to coding standards. They specify a common format for the source code and comments. This allows developers to share code, and the ideas expressed within the code and comments, between each other.
- Code should have symbolic constants for hard-coded values. Its not always possible to completely eliminate hard-coded values from the code, but you can always replace them with more meaningful symbolic constants it will make the code more readable.
- Code should use data structures and algorithms available in the language or its libraries. Lesser code have to test and maintain, language and its libraries are tested and stable, results in avoiding third party libraries thus reducing the overall resources are the advantages of using structures and algorithms.
- Code should be thoroughly tested.
Documenting the code, Regular Code Reviews, Functional Testing and Requirements Analysis are the different approaches and measurements used to measure the quality code.
One of the best way to measure the code quality is by using a tool called sonarQube. sonarQube looks at your code in a wide variety of perspectives.They are "What are the bugs that are present in the code", "What are the security vulnerabilities which are present in the code", "What are the code smells which are nothing but practices in code which might typically pointing towards bad pieces of code", "What is the amount of code coverage that have", "How good are unit test and how much coverage do they have" and also "What is the duplication which measure how many times same pieces of code repeating".All these are the good measures of code quality.
In most cases, a software project depend on reusable functionality in the form of libraries or is broken up into individual components to compose a system. Dependency management is a technique for declaring, resolving and using dependencies required by the project in an automated system.
There are tools to manage these external artifacts towards minimizing the issues.
They are,
Maven is the most popular dependency management tool for java and it held in a file named pom.xml.
Build Life cycle
A Build Life cycle is a well-defined sequence of phases, which define the order in which the goals are to be executed.
Ex:
ASP.NET life cycle
Gradle life cycle
Each build life cycle is divided into a sequence of build phases, and the build phases are again subdivided into build goals. So, the total build process is a sequence of build life cycle, build phases and goals.
Maven build profiles enable to build the project using different configurations. Instead of creating two separate POM files, can just specify a profile with the different build configuration, and build the project with this build profile when needed.
Maven uses Convention over Configuration, which means developers are not required to create build process themselves. It is a project management and comprehension tool that provides developers a complete build life cycle framework.

There are tools to manage these external artifacts towards minimizing the issues.
They are,- Maven - Java
- Composer - PHP
- NuGet - .net
- NPM (Node Package Manager) - JS
- Bower - JS
Maven is the most popular dependency management tool for java and it held in a file named pom.xml.
Composer is dependency management tool for PHP and it held in a file named composer.json.
What is a build tool?
Build tool is a program that automate the creation of executable applications from source code. In small projects, developers build the process manually. This is not practical for larger projects, where it is very hard to keep track of what needs to be built, in what sequence and what dependencies there are in the building process. Using an automation tool allows the build process to be more consistent.
Build Automation defines the scenario where dependent projects build process gets started once the project build is successfully completed, in order to ensure that dependent projects are stable. There are 3 types of automation. They are,
What is a build tool?
Build tool is a program that automate the creation of executable applications from source code. In small projects, developers build the process manually. This is not practical for larger projects, where it is very hard to keep track of what needs to be built, in what sequence and what dependencies there are in the building process. Using an automation tool allows the build process to be more consistent.
Build Automation defines the scenario where dependent projects build process gets started once the project build is successfully completed, in order to ensure that dependent projects are stable. There are 3 types of automation. They are,
- On-demand Automation
- Scheduled Automation
- Triggered Automation
Build Tools
- Ant/Ivy
- Maven
- Gradle
- Sbt
- MSBuild
Compare and contrast different build tools
A Build Life cycle is a well-defined sequence of phases, which define the order in which the goals are to be executed.
Ex:
ASP.NET life cycle
Gradle life cycle
Java Life cycle
Maven Life cycle
Each build life cycle is divided into a sequence of build phases, and the build phases are again subdivided into build goals. So, the total build process is a sequence of build life cycle, build phases and goals.
Maven build profiles enable to build the project using different configurations. Instead of creating two separate POM files, can just specify a profile with the different build configuration, and build the project with this build profile when needed.
Maven uses Convention over Configuration, which means developers are not required to create build process themselves. It is a project management and comprehension tool that provides developers a complete build life cycle framework.

Other contemporary tools and practices
- Continuous integration tools - Bamboo, GitLab, TeamCity
- Configuration Management tools - Ansible, SaltStack, Puppet
- Test Automation tools - Selenium, Katalon Studio, Ranorex
- Issue/Bug tracking tools - MantisBT, Redmine, Pivotal Tracker
- DevOps - Docker, Git, Gradle
- Agile Methodologies - Trello, Blossom, Hansoft








No comments:
Post a Comment