CONTINUOUS INTEGRATION AND TESTING STRATEGIES IN DEVOPS

CONTINUOUS INTEGRATION AND TESTING STRATEGIES IN DEVOPS

Outline of the Article:

  1. Introduction to Jenkins
  2. Continuous integration
  3. Continuous Deployment
  4. Continuous Integration with Jenkins
  5. Continuous Deployment with Jenkins
  6. Maven
  7. Jenkinsfile
  8. Azure Pipeline
  9. Testing Strategies
  10. Test-Driven Development
  11. JUnit
  12. Behavior-Driven Development
  13. Overview of Cucumber
  14. Conclusion

I. Introduction to Jenkins:

Jenkins is an open-source automation tool written in Java with plugins built for Continuous Integration purposes. Jenkins is used?to build and test your software projects continuously making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build.

Popular Features of Jenkins:

?Platform independent

?Rich plugin ecosystem

?Support from large communities

?Scaling of large error-ridden integrations

?Automation integration enabling immediate detection and resolution of issues

?Open source and user-friendly

Easy to configure, modify, and extend.

Installing Jenkins:?

?Jenkins provides us with multiple ways to install it for all types of users. We can install it on at least the following operating systems:

?Ubuntu/Debian

?Windows

?Mac OS X

?OpenBSD

?FreeBSD

?openSUSE

?Gentoo

?CentOS/Fedora/Red Hat.

II. Continuous Integration (CI):

Continuous integration is a development practice of code integration into a shared repository. Each integration is verified by an automated build and automated tests. In simple words, CI is a software engineering practice where each check-in made by a developer is verified by either of the following:

Pull mechanism: Executing an automated build at a scheduled time.

Push mechanism: Executing an automated build when changes are saved in the repository.

III. Continuous Deployment (CD):

Continuous Deployment is an extension of continuous integration. It targets to reduce the time between development team writing one new line of code and using it in production.

Benefits of Continuous Deployment:

?Faster return on investment for each feature as it gets developed

?Faster feedback from end users on each new feature as it is released to production

IV. Continuous Integration with Jenkins:

Jenkins is a Java-based, open source automation tool. It functions as a server and is a software development and cross-platform tool used for continuous integration and continuous deployment.

No alt text provided for this image

V. Continuous Deployment with Jenkins:

Jenkins provides good support for providing continuous deployment and delivery. If you look at the flow of any software development through deployment, it will be as shown below.

No alt text provided for this image

The main part of Continuous deployment is to ensure that the entire process which is shown above is automated. Jenkins achieves all of this via various plugins, one of them being the “Deploy to container Plugin” which was seen in the earlier lessons.

VI. Maven:

Apache Maven is a software project management and comprehension tool. Based on Project Object Model (POM), Maven can manage a project’s build reporting and documentation from a central piece of information .

Project Object Model(POM) is an XML representation of a Maven project, which provides general configurations such as project’s name, its owner, and its dependencies on other projects.

Guidelines to Configure Jenkins and Maven:

?Login to Jenkins and create the first Jenkins job.

?Install and configure Maven.

?Configure Jenkins with Java, Git, and Maven.

?Create a Jenkins job for your maven build project and run the project.

?Poll Git for commits and automatically trigger the build.

?Build the trigger using Push mechanism instead of Pull.

?Repeat steps above two steps multiple times to observe the results at console output section.?

VII. Jenkinsfile:?

?The Pipeline definition in the Jenkinsfile can be committed to the repository along with the source code.

?This method is more consistent as the Pipeline structure becomes strongly tailored to the project.

?For example: if you don't need the code compilation because your programming language is interpreted, then you won't have the Compile stage.?

VIII. Azure Pipeline:

?Azure Pipeline is a cloud service that we can use to build and test our code project automatically. The Azure pipeline has a lot of capabilities such as continuous integration and continuous delivery to regularly and consistently test and builds our code and ship to any target.

Advantages of using Azure DevOps pipelines:

Version control system: Azure Pipelines integrates with GitHub, GitHub Enterprise, Azure Repos Git & TFVC, Bitbucket Cloud, and Subversion.

Language and application types: We can use Azure Pipeline with most application types and languages, such as Java, JavaScript, Node.js, Python, .Net, C++, Go, PHP, and Xcode.

Deployment target: We can use Azure Pipelines to deploy our code to multiple targets. Targets include - container registries, virtual machines, Azure services, or any on-premises or cloud target.

No alt text provided for this image

IX. Testing Strategies:

No alt text provided for this image

Advantages of Using Agile with DevOps Testing:

?Cohesion of teams

?Continuous integration and testing

?Improved quality of products

?Easy scalability

?Process automation

Automation Testing Framework:

Test driven development teams rely on automated testing A testing framework is used to write test cases and a continuous integration software will run these test cases automatically A well developed testing framework or an integrated development environment (can be used to run the test scripts).

No alt text provided for this image


X. Test-Driven Development:

Test driven development is a software development process that depends on the repetition of short development cycle Requirements are converted into test cases, then the software is improved to pass new tests Developers apply the concept to improve and debug legacy code developed in older techniques.

XI. JUnit:

Junit is a unit testing framework for the Java programming language It is found that 10,000 Java projects used JUnit as an external library Each library of the JUnit was used by 30.7% of the projects It is the first option for developers while testing the Java applications.

XII. Behavior-Driven Development:

?Behavior driven development is an extension of test driven development.

?BDD focuses on

  1. Where to start in the process

2. What to test and what not to test

3. How much to test in one go

4. What to name the tests

5. How to understand test fails

XIII. Overview of Cucumber:

Cucumber is a software tool for testing other software by running automated acceptance tests written in a behavior driven development approach It allows the execution of feature documentation written in business facing text Gherkin language is used to define test cases It is designed for non technical, human readable, and collectively describes use cases related to software system.

No alt text provided for this image

XIV. Conclusion:

Hence, CI/CD continuously merges codes and continuously deploys them to production after thorough testing, keeping the code in a release-ready state. Also JUnit enables writing test cases while developing the software that helps test early and detect issues. Cucumber?enables you to write test cases that anyone can easily understand regardless?of their technical knowledge.

Note: All the content present in this article is the original work.

Reuse of the same content is strictly prohibited except for purposes such as criticism, comment, news reporting, teaching, scholarship and research.

Author's written permission to be taken in prior to reuse the content.

Thank You.

要查看或添加评论,请登录

Kanakavalli Mannava的更多文章

  • Deploy AWS Lambda Using Serverless Framework

    Deploy AWS Lambda Using Serverless Framework

    Outline of the Article: Aim Introduction Architecture Flow About the Services Procedure and Execution Termination…

    3 条评论
  • SKILL DEVELOPMENT PROJECT-3

    SKILL DEVELOPMENT PROJECT-3

    INDIAN CUSTOMS AND TRAITIONS SDP-5148 Hey there! Feeling proud to share my article about the most crucial topic which…

  • DOCKER, KUBERNETES AND CHEF IN CDD

    DOCKER, KUBERNETES AND CHEF IN CDD

    Outline of the Article: Introduction to Docker Docker Features Docker Workflow Virtualization Docker Architecture…

  • CONTINUOUS DELIVERY AND DEVOPS

    CONTINUOUS DELIVERY AND DEVOPS

    Outline of the Article: Introduction to DevOps History of DevOps DevOps Lifecycle DevSecOps Version Control Systems…

    1 条评论
  • SKILL DEVELOPMENT PROJECT-2 (USER RESEARCH)

    SKILL DEVELOPMENT PROJECT-2 (USER RESEARCH)

    SKILL DEVELOPMENT PROJECT 2 STOCK EXCHANGE MANAGEMENT SYSTEM BATCH – 211 SDP is an important and crucial project which…

社区洞察

其他会员也浏览了