Industry Practices and Tools 2

Tutorial Number 03
Question 01 :
Discuss the importance of maintaining the quality of the code,
explaining the different aspects of the code quality?
In Industry Practices we must maintain the quality of Code in a standard way.
It is the readability of the code.
We must follow separate code formatting standards in order to achieve the Quality of Code,
  1. Clarity : It is easy to maintain the code and also add changes to the code if the code is understandable and easily readable.
  2. Maintainability : The code should not be over complicated because it is hard to maintain for a period of time in years if so.
  3. Documented : The code should be self explainable. The naming convention standards should be maintained properly. Adding read me files with the manuals will increase the standard.
  4. Well Tested : Ensuring that all the run-time bugs and errors are cleared and clarified it means that the project is well tested and the quality is assured.
Question 02 :
Explain different approaches and measurements used to measure the quality of code?
  • Documenting the Code : Adding coding standards wherever necessary and having a perfect order can lead to a standard quality of Code. Including read me files and also including manuals can be approached.
  • Regular Code Reviews : Peer to peer code reviewing methods can be carried out to full-fill this approach.
  • Functional Testing : Meeting the requirements means that the project is fully tested and is free from bugs. Therefore functional testing with the use of applications or methods can be done.
Question 03 :
Identify and compare some available tools to maintain the code quality?
  • SideKick - It is a tool used to maintain the code of quality in codes which are in the language of java-script or j query.
  • W3C Markup Validation Service - It is a service used to maintain code of quality in web-pages and other projects build up in the language of HTML.
  • SonarQube : It is an open source platform which is used to manage mainly on Java programs and also more than 20 languages to maintain the quality of code. It provides a static systematic inspection and provide reviews time to time to maintain the quality of code.
Question 04 :
Discuss the need for dependency/ package management tools in software development?
Package Management tools are used in software development to store the metadata in a local database and deal with the manual updates and installations regarded to prevent software mismatches and missing prerequisites to run a program.
Question 05 :
Explain the role of dependency/package management tools in software development?
Package Management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing certain programs and files needed for the system in a consistent manner. It deals with packages where all dependencies to run a software is stored.
Therefore using these tools will include :
  • Working with file archives to extract package archives and place them correctly.
  • Searching, Matching the versions, Installing and updating software from repositories.
Question 06 :
Compare and contrast different dependency/package management tools used in industry?
There are various dependency management tools used in the industry.
  • Composer : It is a tool used to manage the packages and dependencies in PHP language.
  • Maven : It is a collection of various tools used to manage the projects in Java language mainly. It describes how the project is build and how the dependencies are included.
  • Node Package Manager (NPM) : NPM is used as a package manager for the use in JavaScript platform. It is also the default package manager for the Node.js run-time environment.
Question 07 :
What is a build tool? Indicate the significance of using a build tool in large scale software development, distinguishing it from small scale software development?
A build tools is a program that is mainly used for large scale development processes in the industry to automatically create executable applications (.exe files) from the code, It incorporates in Compiling the code, linking the project and packaging the code within the system.
Using build tools in Large scale consistently working projects will remove additional unused files and keeps in track of all the project dependencies. It easily automates the build process. It is hard to develop and link them manually due to the size of the project therefore, it is automated.
Using build tools in Small Scale Software Development it is not worthy. Therefore it is done manually by the developers itself. The workload is divided and a less number of developers are involved in the development. So it makes the company cost to much if they use tools for the build process rather than doing it manually.
Question 08 :
Explain the role of build automation in build tools indicating the need for build automation?
Build tools are programs that automate the creation of executable applications from the source code. Building includes compiling, linking and packaging the code into a usable or executable form.
In small projects, developers will often manually invoke the build process.
A Build tool is needed to set up everything which is required to run your code independently. This can be applied to your entire project. It generates the source code, compiling code, packaging code to an executable file type.

Question 09 :
Compare and contrast different build tools used in industry?
ANT vs Maven vs Gradle
  • ANT is a build tool which is in the first set of modern tools used to control the build of the process. It has very low learning curve thus allowing anyone to start using it without any special preparation. It is based on procedural programming idea. Build scripts are written in XML format.
  • Maven is mainly a Apache server based platform where it is simply more than a build tool. Maven introduced the ability to download dependencies over the network. Main benefit from Maven is its life-cycle. As long as the project is based on certain standards, with Maven one can pass through the whole life cycle with relative ease. This comes at a cost of flexibility. Dependencies management does not handle conflicts well between different versions of the same library is a problem occured in Maven and also the XML files are high standardized and structured.
  • Gradle does not use XML therefore it has its own domain specific language based on Groovy which is one of JVM languages. As a result, Gradle build scripts tend to be much shorter and clearer than those written for Ant or Maven.
Question 10 :
Explain the build life cycle, using an example (java, .net, etc…) ?
A Build Life cycle is a well-defined sequence of phases, which define the order in which the goals are to be executed. There are pre and post phases to register goals, which must run prior to or after a particular phase.
The default life-cycle for MAVEN comprises of the following phases.
  1. Validate - validate the project is correct and all necessary information is available
  2. Compile - compile the source code of the project
  3. Test - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
  4. Package - Take the compiled code and package it in its distributive format, such as a JAR.
  5. Verify - Run any checks on results of integration tests to ensure quality criteria are met
  6. Install- install the package into the local repository, for use as a dependency in other projects locally
  7. Deploy - done in the build environment, copies the final package to the remote repository for sharing with other developers and projects.
Question 11 :
What is Maven, a dependency/package management tool or a build tool or something more?
Maven is more than a build tool. Maven also describes how the software is built and also helps in dependency management . Maven is used mainly for java based project development. It consist of a life cycle of the build process and also manages the project.

Question 12 :
Discuss how Maven uses conventions over configurations, explaining Maven’s approach to manage the configurations?
This is a main advantage in Maven where the developers do not have to create the build process or maintain any configuration detail. It identifies the pre condition for continuous integration and testing in the development and build. It minimizes bad builds caused by missing files and improper configurations. Everything done in the project is logged by MAVEN. History of builds are documented, So it is more convenient to use as there is less to configure.
Question 13 :
Discuss the terms build phases, build life cycle, build profile, and build goal in Maven?
  • Build Phases - The various build processes used in Maven to represent a certain build stage. However, even though a build phase is responsible for a specific step in the build life cycle, the way in which it carries out those responsibilities may be different. Therefore this is done by declaring the plugin goals bound to those build phases.
  • Build Life Cycle - There are always pre and post phases to register goals, which must run prior to, or after a particular phase. When Maven starts building a project, it steps through a defined sequence of phases and executes goals, which are registered with each phase. Maven consists of three standard build life-cycles which are :
  1. Clean - the main life cycle as it’s responsible for project deployment
  2. Default - to clean the project and remove all files generated by the previous build and
  3. Site - to create the project’s site documentation
  • Build Profile - It is a set of configuration values, which can be used to set or override default values of Maven build for further modifications. Using a build profile, you can customize the default build for different environments such as Production and Development environments.
  • Build Goal - Each phase is a sequence of goals, and each goal is responsible for a specific task. When we run a phase all goals are bound to this phase and are executed in an order. Here are some of the phases and default goals bound to them:
  1. compiler:compile – the compile goal from the compiler plugin is bound to the compile phase
  2. compiler:testCompile is bound to the test-compile phase
  3. surefire:test is bound to test phase
  4. install:install is bound to install phase
  5. jar:jar and war:war is bound to package phase
Question 14 :
Discuss with examples, how Maven manages dependency/packages and build life cycle?
Dependency management is a core feature of Maven. Managing dependencies for a single project is easy. Managing dependencies for multi-module projects and applications that consist of hundreds of modules is possible. Maven helps a great deal in defining, creating, and maintaining reproducible builds with well-defined class-paths and library versions.
Transitive Dependencies - This feature is facilitated by reading the project files of your dependencies from the remote repositories specified. In general, all dependencies of those projects are used in your project, as are any that the project inherits from its parents, or from its dependencies.
  • Dependency Mediation, Dependency Management, Dependency Scope, Excluded Dependencies and Optional Dependencies can be used to additionally.
Question 15 :
Identify and discuss some other contemporary tools and practices widely used in the software industry?
Continuous Integration - Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early and easily.
Configuration Management - Configuration management is a systems engineering process for establishing and maintaining consistency of a product's performance, functional, and physical attributes with its requirements, design, and operational information throughout its life.
Test Automation - Automation testing is an Automatic technique where the tester writes scripts by own and uses suitable software to test the software. It is basically an automation process of a manual process. Like regression testing, Automation testing also used to test the application from load, performance and stress point of view.
Agile Methodologies - Agile project management is an iterative approach to managing software development projects that focuses on continuous releases and incorporating customer feedback with every iteration. While scrum is focused on fixed-length project iterations, Kan-ban is focused on continuous releases.
Issue/ Bug Tracking Tools
Use of forums like StackOverflow.com

Comments