#ThirdBlogArticle
Explore tagged Tumblr posts
enigmaticlearner · 6 years ago
Text
I wish if there were less errors in this code...
Tumblr media
Hello again! In the third week,this blog article we will be discussing about code quality,dependency management and build tools.Maven will be the explicitly discussed topic.
So lets start with code quality! As the blog article title itself says we all wish to have less errors in our source codes.To have less errors here's some useful tips to start coding in a error free method as a start.
1)Code quality
Software developers start from a simple "Hello world" program and then go up to more complex codes when they become more experienced in the field.These kind of codes can contain thousand number of code lines sometimes.At such instances it's hard to focus on correcting the code if an error is identified.This is one of the very important places where "code quality" comes into use. Code quality implies mostly the maintaining quality of code.
To improve this, 1.We can add comments, by this it will help any other person to understand the code. 2.Follow coding conventions. 3.Have separate classes instead of coding a whole program in one single class. 4.Use meaningful terms when coding. Ex:use meaningful method names;for a calculation method we can code as follows Public void Calculate()
If quality of code can be maintained well the code will get less complex.Less complex the code is, more human readable it is. Also errors can be easily tracked out when comments are added at respective places. When the code is maintained well resources will not be wasted unnecessarily.These kinds of codes will have a long span and will not be thrown away once the use is over.Instead they will be used over and over again.
Tumblr media
Code quality cannot be measured that much easily.But tools have been implemented nowadays and some of them are, *weighted micro function points *halstead complexity measures *cyclomatic complexity *lines of code *lines of code per method
Languages like Java,C,C++ has tools developed for them itself. Apart from them there are free tools and multi language support tools as well. To detect code quality in HTML there are HTML validators like CSE HTML validators are present.
Tumblr media
As the second topic we will be moving on to dependency management and tools related to them.
2)Dependency/Package management
At olden days softwares used to work alone.But the current softwares require third party tools like libraries,third party libraries, frameworks and etc.When these external tools are cooperated with softwares problems arise later.Problems are introduced when integrating together due to different reasons. 1.Having different versions with regard to the main software. 2.Different artifacts may use different ways of integration.
As a remedy to this problem,dependency management tools were introduced.These sophisticated tools will pull things together and integrate things into a common file.
These files will be in the format of, Ex:XML,JSON,Gradle
These files will be used in finding *what dependencies to get *what version of dependency to deal with *which repository to get relevant files from
Tumblr media
A repository will have declared dependencies.Dependencies can be fetched using name and version of the relevant dependency. Most of the dependencies have dedicated repositories for themselves. Ex:For Maven, the repository is maven central.
Therefore when a dependency is declared in a configuration file (Ex:composer.JSON) the dependency manager will access the repository to install the dependency that match the exact criteria we have set in the configuration file and make it available in the execution environment for use.
Java has Maven as its specialized tool for dependency management. PHP has Composer and JavaScript has Bower. Other such dependency management tools are Gradle,Node Package Manager.
MAVEN
Talking about Maven, Maven is not only just a dependency management tool. It has other special qualities regarding project management which has made it more specific.It functions as a multi module project management tool and has backward compatibility. Maven has the ability to download its needed files automatically into necessary directories. Developers do not have to code each and every configuration detail in the code.Only a few changes in the pom.XML file is required. Maven is used in back end while JavaScript is used in back end coding.
Tumblr media
Maven 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. (according to Tutorials Point) Here a phase is a stage in life cycle.Process for building and distributing particular artifact is clearly defined.Therefore only a few set of commands is to be known by a person when using Maven.Lets look at Maven a little bit more.
Maven life cycle
According to Tutorials Point Maven life cycle is comprised of following phases.
Tumblr media
     2.Build profile
Build profile consists of set of configuration values, which can be used to set or override default values of Maven build.Using a build profile we can customize build for different environments such as Production vs development environment.
Tumblr media
    3.Build phase This comes inside the build life cycle. If phase is not explicitly defined the default phase is chosen.
Maven uses conventions over configurations;that is coders are not required to create build processes themselves.
Phases include the following, 1.Validate - checks whether configuration and code is proper. 2.test - executes test cases. 3.package - package the class files. 4.install - installs to a maven(local)repository and helps you publish jar files into a local repository. 5.deploy - publish the artifact to the remote repository.
     4.Build goals Each phase is a sequence of goals and each goal is responsible for a specific task.
Ant too is a software like Maven,but since Maven has a build life cycle it's dependency and project management it has proved to work much better.Maven requires only small changes to the configuration.
Maven is available in Eclipse IDE too.
3)Build tools Build tools automates the process of compiling computer source code into binary code.Basically build automation is the act of scripting or automating a wide variety of tasks that software developers do, 1.downloading dependencies 2.compiling source code into binary code 3.packaging that binary code 4.running tasks 5.deployment into production systems
*Use of build tools In small projects developers can manually invoke build processes.But when this comes to larger scale projects this is not practical.When the project becomes large its hard to keep track of what needs to be built,in what sequence and what dependencies are needed in building processes.Using an automation tool,it allows the build process to be more consistent.
Ex:Ant,Maven,Gradle,N Ant,Ms Build
-Build automation types
1.On-demand automation
2.Scheduled automation
3.Triggered automation
-Build automation softwares
Tumblr media
4)Other tools used in software coding
As the end of this week’s article four more topics related to coding community will be discussed briefly.
Dev Ops
Tumblr media
Dev ops combines software development with information technology operations. This has an agile relationship between development and information technology operations. The goal is to improve the relationship by advocating better communication and collaboration between these two business units.
Continuous integration
This is the development practice that requires coders to integrate code into a repository several times a day. Therefore problems can be detected soon and often.
Configuration management
This is a system engineering process for establishing and maintaining consistency of a product's performance along it's physical attributes throughout it's life cycle. This process is widely used in military field.
Bug tracking tools
These tools are equipped in detecting errors.
Ex:Plutora,software testing,Backlog,Bugzilla
Agile method
Tumblr media
This practice is used in most team projects in current days.This has increased team work in team projects.Agile method has proved to be very efficient in many ways.It interacts with the client quite a lot.
Marking the end of another week’s blog article by this.Lets meet again soon with more new and interesting topics.Till then goodbye!
0 notes