Friday, March 1, 2019

Tutorial 03 – Industry practices and tools 2

PROGRAMMING APPLICATIONS AND FRAMEWORKS                                              
Tutorial 03

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



Good quality code is an essential property of a software because it   could lead to financial losses or waste of time needed for further maintenance, modification or adjustments if code quality is not good enough.

Impacts of the quality code:-

Efficiency : Directly related to the performance  and speed of running the software.
                  No one likes to use a software that takes too long to perform an action.

Reliability : Ability to perform consistent and failure-free operations every time it runs.
The software would be very less useful if the code function differently every time it runs even with the same input in same environment and if it breaks down often without throwing any errors.



Robustness : Ability to cope with errors during program execution even under unusual condition.

Software is typically buggy and fragile but it should handle any errors encountered gracefully.

Portability : Ability of the code to be run on as many different machines and operating systems as possible.


It would be a waste of time and energy for programmers to re-write the same code again when it transferred from  one environment to another.

Maintainability :code that easy to add new features, modify existing features or fix bugs with a  minimum of effort without the risk of affecting other related modules.


software always needs new feature or bug fixes. so the written code must be easy to understand, easy to find what needs to be change,easy to make changes and easy to check that the changes have not introduced any bugs.

Readable :The ability of allowing the code to be easily, quickly, and clearly understandable by someone new or someone that hasn't seen it in a while.

Maintain the code quality:
  • Documenting the code.
  • Regular code reviews.
  • Functional testing.
  • Clear requirements.


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


There are many reasons to why we want to measure quality. Some developers like to use metrics to identify areas of the code that could be improved. Others use metric as a quality gate; if the code doesn't satisfy a certain "quality" criteria, the build fails.
Managers may have different reasons to why they want to measure quality. Although they may say otherwise, the most common reasons to why they want software quality to be measured are:
  • Lack of trust.
  • Fear of being responsible for things they don't understand.
  • Find other people to blame in case something goes wrong.
  • Try to find a justification for the general dissatisfaction among the people building or using the software.
  • Show they are in control.
  • Cover their backside, showing that they are doing something to control quality (ticking a box).
  • Annual targets and bonuses
03. Identify and compare some available tools to maintain the code quality 

Generally code review tools user by developers to find bugs errors early phases of the software development.
  • Collaborator : Analyse code changes, detects errors, and put comments on necessary lines & Build Custom review reports
  • Codebrag: Simple, light-weight, free and open source code review tool & Justify bugs like non-blocking code review, same line comments.
  • Codestriker : Open source and free online code reviewing web application  & One can record the issues, comments, and decisions.
  • Rhodecode :Open source, protected and incorporated enterprise source code management tool & Serves as an integrated tool for Git, Subversion, and Mercurial.
  • SonarQube
  • SonarLint
  • StyleCop
  • ReSharper
04. Discuss the need for dependency/package management tools in software development? 

  • Package managers allow you to avoid checking large (several megabyte or larger) binaries into source control.
  • They prevent mixing incompatible files/libraries
  • They establish a shared convention for managing libraries.
  • They give you a standard way of versioning and distributing your own dependencies and files that don't belong in your repository.
  • Some package managers provide additional features during installation.
  • Their package list files document the versions of your libraries in a single, centralized place.
  • They discourage machine wide installation of dependencies.
  • They tend to centralize hosting and distribution.


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

Tools:-
  • Composer (PHP)
    • An application level package manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries.
  • Maven (Java)
    • A build automation tool used primarily for java projects. Maven address two aspects of building software. First is describe how software build and second , it describe its dependencies.
  • Nuget (.net)
    • Free and open source manager designed as a visual studio extension. Standing with visual studio 2012. Nuget comes pre-installed by default. Nuget has evolved into a larger eco system.
  • NPM (Node Package Manager) (Js)
    • NPM is a package manager for install node.Js packages or modules if you like. The npm program is installed on computer when we install node.js. Npm already run on our computer and no other package manager come closer. It is also breeze to use. This also a free and open source program.
  • Bower (Js)
    • Npm and Bower are both dependency management tools. Bower is used for managing front end components like html, css, js etc.

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


  1. Debian Package Management System (dpkg)
    • This package manager is base package manager of the Debian Linux family and it is used to install, remove, store and provide information about .deb packages.
  1. RPM (Red Hat Package Manager)
    • This is also the Linux Base packing format and a base package management system implemented by RedHat.
  2. Pacman Package Manager – Arch Linux
  3. Zypper Package Manager – openSUSE
  4.  Portage Package Manager – Gentoo

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 
Build tool is a program that are automate the creation of executable application from source code.
Building inoperative compiling, linking and packaging the code into a usable or executable  form.
Automation tool allows the build process to be more consistent.
In Small scale 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 build, in what sequence and what dependencies there are in the building process. Using an automation tool allows the build process to be more consistent.


08. Explain the role of build automation in build tools indicating the need for build automation 
Build Automation:
  • On-demand automation such as a user running a script at the command line.
  • Scheduled automation such as a continuous integration server running a nightly build.
  • Triggered automation such as a continuous integration server running a build on every commit to a version-control system.

09. Compare and contrast different build tools used in industry 
we can discuss Ant/lvy, Maven & Gradle because these 3 has individually unique methodologies in their own ways. 





  • Ant/ Ivy
    • This is little bit of old type of build tool but still using that.
    • You have to type the configuration code which should run on the process.
  • Maven
    • Maven is very popular these days and it is considered the de-facto build tool for all Java projects.
    • It is a complete software ‘project management system’. It helps you to manage your dependencies/ packages by storing all artifacts on a repository (Maven Central Repository). You specify your ‘build’ file (it is called `pom.xml`).
    • Allow customizes the build lifecycle process.
    • It follows a convention and Maven is so-called “Convention over Configuration”.
    • It is opposite of Ant method.
  • Gradle
    • Gradle became popular on last 3-4 years.
    • It follows Maven's conventional model
    • Gradle is both Convention & Configuration.
    • Gradle is easy to use.
10. Explain the build life cycle, using an example (java, .net, etc…) 


This phase represents a stage in life cycle (Maven).
  1. Prepare-resource | Resource Copying | Resource copying can be customized in these phase.
  2. Validate | Validating the information | Validates if the project is correct and if all necessary information is available.
  3. Compile | Compilation | Source code compilation is done in this phase.
  4. Test | Testing
  5. Package | Packaging
  6. Install
  7. Deploy



11. What is Maven, a dependency/package management tool or a build tool or something more? 

Maven is not only an package Management tool or build tool, it includes many things,Maven is software management and comprehension tool primarily used with java-based project but that can be used to manage project in other programming languages like c# and Ruby. it is base on the concept called project object model (POM). It can also handle the report documentation related things. There are major objectives that maven handles,
  • Making the build process easy
  • Providing a uniform build system
  • Providing quality project information
  • Providing guidelines for best practices development
  • Allowing transparent migration to new features


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

Software design paradigm used by software framework that attempts to decrease the number of decisions that a developer using the framework is required to make without necessarily losing flexibility.
Most of the project management and build related tasks are done by Maven plugins. Developers don't need to know how those plugins works and plugins do the work for them.
Generic code style and convention:
  • License header
  • Trailing white space
  • Indentation
  • Line Wrapping  

13. Discuss the terms build phases, build life cycle, build profile, and build goal in Maven 
Build Phase:- Where in a build phase represents a stage in the life cycle.
  • Validate >>>  validate the project correct and all necessary information is available.
  • Compile >>> Compile the source code of the project.
  • Test >>> Test the compiled source code using a suitable unit testing framework.
  • Package >>> This phase creates the JAR/WAR package as mentioned in the packaging in POM.xml.
  • Verify >>> ...
  • Install >>> This phase installs the package in local/remote maven repository.
  • Deploy >>> Copies the final package to the remote repository.Copies the final package to the remote repository.
Maven has three life cycles,
  • Clean
  • Default
  • Site
Build goal in Maven:-
    • A goal represents a some task which contributes to the building and managing of a project. It may be bound to zero or more build phases. A goal not bound to any build phase could be executed outside of the build lifecycle by direct invocation.

14. Discuss with examples, how Maven manages dependency/packages and build life cycle 
We have set of project under a common project in such case, we can create a common POM having all the common dependency and then make this POM, the parent of sub projects's POMs.

15. Identify and discuss some other contemporary tools and practices widely used in the software industry

  • There are a broad range of software development tools and methods currently available or which could be built using current research and technology.
  • These tools and methods can be organized into four software development environments, ranging in complexity from a simple environment containing few automated tools or expensive methods to a complete one including many automated tools and built around a software engineering database.
  • These tools make all easy which is related to software development.
    • Continuous integration
    • Configuration Management
    • Test automation
    • Issue/ Bug tracking tools
    • Agile methodologies, Devops.





No comments:

Post a Comment

Tutorial 10 – Client-side development 2 - RiWAs

PROGRAMMING APPLICATIONS AND FRAMEWORKS                                                  Tutorial 10 Distinguish the term “Rich Internet...