Tutorial 03

Discuss the importance of maintaining the quality of the code, explaining the different aspects of the code quality



  • Clarity: Easy to read and oversee for anyone who isn’t the creator of the code. If it’s easy to understand, it’s much easier to maintain and extend the code. Not just computers, but also humans need to understand it.
  • Maintainable: A high-quality code isn’t overcomplicated. Anyone working with the code has to understand the whole context of the code if they want to make any changes.
  • Documented: The best thing is when the code is self-explaining, but it’s always recommended to add comments to the code to explain its role and functions. It makes it much easier for anyone who didn’t take part in writing the code to understand and maintain it.
  • Refactored: Code formatting needs to be consistent and follow the language’s coding conventions. 
  • Well-tested: The less bugs the code has the higher its quality. Thorough testing filters out critical bugs ensuring that the software works the way it’s intended.
  • Extendible: The code you receive has to be extendible. It’s not really great when you have to throw it away after a few weeks.
  • Efficiency: High-quality code doesn’t use unnecessary resources to perform a desired action.

Explain different approaches and measurements used to measure the quality of code




  • Count of open reported defects in a given product.
  • Defect density. Take the number of defects found per the number of source lines of code in the product. Lower is better. However, this metric does ignore defects that haven't been recorded.
  • Fan-in and Fan-out. Fan-in is the number of modules that a given module calls. Fan-out is the number of modules that call the module.
  • Coupling. Consider the number of inputs, outputs, global variables used, module, fan-in, and fan-out. 
  • Cyclomatic complexity. This measures the number of paths through a given block of code. The cyclomatic complexity for a block is the upper bound of tests to achieve complete branch coverage. If all paths through the code are actually possible, then this is also the upper bound on test cases needed for path coverage.
  •  program vocabulary, program length, calculated program length, volume, difficulty, and effort. The difficulty is especially useful as it is a representation of how complex the code is to understand. There is also a calculation for the estimated number of bugs in an implementation.
  • Count of open static or dynamic analysis findings. Various tools exist to examine the source code, binary files, and execution paths of software to find possible errors automatically. These findings can be reported as a measure of quality


Identify and compare some available tools to maintain the code quality



  • Collaborator
  • Review Assistant
  • Codebrag
  • Gerrit
  • Codestriker
  • Rhodecode
  • Phabricator
  • Crucible
  • Veracode
  • Review Board

Discuss the need for dependency/package management tools in software development


A package manager or package management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing software packages for a computer's operating system in a consistent manner. It typically maintains a database of software dependencies and version information to prevent software mismatches and missing prerequisites.


Explain the role of dependency/package management tools in software development

Package managers automate the process of installing, upgrading, configuring, and removing computer programs from an operating system in a consistent manner. A package manager deals with ‘packages’ – distributions of software and data in archive files. Packages contain metadata, such as the software’s name, its purpose, version number, checksum and a list of dependencies necessary for the software to run properly. Upon installation, metadata is stored in a local package database. Package managers typically maintain a database of software dependencies and version information to prevent software mismatches and missing prerequisites. They work closely with software repositories, binary repository managers 

Compare and contrast different dependency/package management tools used in industry


Chocolatey is a package manager for Windows. Designed as a decentralized framework for quickly installing applications and tools, it is built on the NuGet infrastructure and uses... 


Homebrew open-source software is a package management system that simplifies the installation of software on Apple's MacOS operating system.
Homebrew is called the missing package... 


Yellowdog Update, Modified (yum) manages installation, updates, and removal of Linux systems using Red Hat Package Manager (RPM). Yum allows a user to update groups of machines...


NuGet is the package manager for the Microsoft development platform including .NET. The open-source NuGet client tools provide users with the ability to produce and consume.



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

Build tools are programs that automate the creation of executable applications from source code. Building incorporates compiling, linking and packaging the code into a usable or executable form. In small projects, developers will often manually invoke the build process. 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.


Explain the role of build automation in build tools indicating the need for build automation

For instance, in some projects, a daily build is needed, the following are the task that may be automated with ant, so they can run without human intervention.
  • Connect to subversion server.
  • Download/update with the latest version
  • Compile the application
  • Run the test cases
  • Pack the application ( in jar, war, ear, or whatever )
  • Commit this build binaries to subversion.
  • Install the application in a remote server
  • Restart the server
  • Send an email with the summary of the job.

What is Maven?

Maven, a Yiddish word meaning accumulator of knowledge, was originally started as an attempt to simplify the build processes in the Jakarta Turbine project. There were several projects each with their own Ant build files that were all slightly different and JARs were checked into CVS. We wanted a standard way to build the projects, a clear definition of what the project consisted of, an easy way to publish project information and a way to share JARs across several projects.
The result is a tool that can now be used for building and managing any Java-based project. We hope that we have created something that will make the day-to-day work of Java developers easier and generally help with the comprehension of any Java-based project.

Discuss how Maven uses conventions over configurations, explaining Maven’s approach to manage the configurations

Convention over configuration is a software design paradigm used by software frameworks that attempts to decrease the number of decisions that a developer using the framework is required to make without necessarily losing flexibility. The concept was introduced by David Heinemeier Hansson to describe the philosophy of the Ruby on Railsweb framework, but is related to earlier ideas like the concept of “sensible defaults” and the principle of least astonishment in user interface design.

Discuss the terms build phases, build life cycle, build profile, and build goal in Maven
Maven is based around the central concept of a build lifecycle. What this means is that the process for building and distributing a particular artifact (project) is clearly defined.
For the person building a project, this means that it is only necessary to learn a small set of commands to build any Maven project, and the POM will ensure they get the results they desired.
There are three built-in build lifecycles: default, clean and site. The default lifecycle handles your project deployment, the clean lifecycle handles project cleaning, while the site lifecycle handles the creation of your project’s site documentation

Comments