CI/CD Basics Flashcards

Help remember the basics

1
Q

What is continuous integration?

A

Continuous integration focuses on integrating work from individual developers into a main repository multiple times a day to catch integration bugs early and accelerate collaborative development

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Continuous delivery?

A

Continuous delivery is concerned with reducing friction in the deployment or release process, automating the steps required to deploy a build so that code can be released safely at any time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Continuous deployment?

A

Continuous deployment takes this one step further by automatically deploying each time a code change is made.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the benefits of Continuous integration?

A

The idea is to minimize the cost of integration by making it an early consideration. Developers can discover conflicts at the boundaries between new and existing code early, while conflicts are still relatively easy to reconcile. Once the conflict is resolved, work can continue with confidence that the new code honors the requirements of the existing codebase

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the key parts to Continuous integration?

A

continuous integration relies on robust test suites and an automated system to run those tests. When a developer merges code into the main repository, automated processes kick off a build of the new code. Afterwards, test suites are run against the new build to check whether any integration problems were introduced. If either the build or the test phase fails, the team is alerted so that they can work to fix the build.

The end goal of continuous integration is to make integration a simple, repeatable process that is part of the everyday development workflow in order to reduce integration costs and respond to defects early. Working to make sure the system is robust, automated, and fast while cultivating a team culture that encourages frequent iteration and responsiveness to build issues is fundamental to the success of the strategy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the key parts of Continuous delivery?

A

continuous delivery leans heavily on deployment pipelines to automate the testing and deployment processes. A deployment pipeline is an automated system that runs increasingly rigorous test suites against a build as a series of sequential stages. This picks up where continuous integration leaves off, so a reliable continuous integration setup is a prerequisite to implementing continuous delivery.

At each stage, the build either fails the tests, which alerts the team, or passes the tests, which results in automatic promotion to the next stage. As the build moves through the pipeline, later stages deploy the build to environments that mirror the production environment as closely as possible. This way the build, the deployment process, and the environment can be tested in tandem. The pipeline ends with a build that can be deployed to production at any time in a single step.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the benefits of Continuous delivery?

A

Continuous delivery is attractive because it automates the steps between checking code into the repository and deciding on whether to release well-tested, functional builds to your production infrastructure. The steps that help assert the quality and correctness of the code are automated, but the final decision about what to release is left in the hands of the organization for maximum flexibility.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the key parts of Continuous deployment?

A

Continuous deployment is an extension of continuous delivery that automatically deploys each build that passes the full test cycle. Instead of waiting for a human gatekeeper to decide what and when to deploy to production, a continuous deployment system deploys everything that has successfully traversed the deployment pipeline

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Key Concepts and Practices for Continuous Processes?

A

Small, Iterative Changes
Trunk based development
Keep the Building and Testing Phases Fast
Consistency Throughout the Deployment Pipeline
Decouple Deployment and Release

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the benefits of “Small, Iterative Changes” in CI/CD?

A

Small changes minimize the possibility and impact of integration problems. By committing to the shared branch at the earliest possible stage and then continually throughout development, the cost of integration is diminished and unrelated work is synchronized regularly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the benefits of “Trunk based development”?

A

The idea behind trunk-based development is to avoid large commits that violate of concept of small, iterative changes discussed above. Code is available to peers early so that conflicts can be resolved when their scope is small.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the things you need to remember for “Keep the Building and Testing Phases Fast”

A

Each of the processes relies on automated building and testing to validate correctness. Because the build and test steps must be performed frequently, it is essential that these processes be streamlined to minimize the time spent on these steps.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the main aspects of “Consistency Throughout the Deployment Pipeline”

A
  • Code should be built once at the beginning of the pipeline
  • Deployment environments should be consistent
  • Consistent processes should be used to deploy the build in each environment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why is “Decouple Deployment and Release” so important?

A

Separating the deployment of code from its release to users is an extremely powerful part of continuous delivery and deployment. Code can be deployed to production without initially activating it or making it accessible to users. Then, the organization decides when to release new functionality or features independent from deployment.

This gives organizations a great deal of flexibility by separating business decisions from technical processes. If the code is already on the servers, then deployment is no longer a delicate part of the release process, which minimizes the number of individuals and the amount of work involved at the time of release.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the different types of testing?

A
  • Smoke Testing
  • Unit Testing
  • Integration Testing
  • System Testing
  • Acceptance Testing
  • Soak Test
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is “Smoke testing”?

A

Smoke tests are a special kind of initial checks designed to ensure very basic functionality as well as some basic implementation and environmental assumptions. Smoke tests are generally run at the very start of each testing cycle as a sanity check before running a more complete test suite.

17
Q

What is “Unit testing”?

A

Unit tests are responsible for testing individual elements of code in an isolated and highly targeted way. The functionality of individual functions and classes are tested on their own. Any external dependencies are replaced with stub or mock implementations to focus the test completely on the code in question.

Unit tests are essential to test the correctness of individual code components for internal consistency and correctness before they are placed in more complex contexts. The limited extent of the tests and the removal of dependencies makes it easier to hunt down the cause of any defects. It also is the best time to test a variety of inputs and code branches that might be difficult to hit later on. Often, after any smoke tests, unit tests are the first tests that are run when any changes are made.

Unit tests are typically run by individual developers on their own work station prior to submitting changes. However, continuous integration servers almost always run these tests again as a safe guard before beginning integration tests.

18
Q

What is integration testing?

A

After unit tests, integration testing is performed by grouping together components and testing them as an assembly. While unit tests validate the functionality of code in isolation, integration tests ensure that components cooperate when interfacing with one another. This type of testing has the opportunity to catch an entirely different class of bugs that are exposed through interaction between components.

Typically, integration tests are performed automatically when code is checked into a shared repository. A continuous integration server checks out the code, performs any necessary build steps (usually performing a quick smoke test to make sure the build was successful) and then runs unit and integration tests. Modules are hooked together in different combinations and tested.

Integration tests are important for shared work because they protect the health of the project. Changes must prove that they do not break existing functionality and that they interact with other code as expected. A secondary aim of integration testing is to verify that the changes can be deployed into a clean environment. This is frequently the first testing cycle that is performed off of the developer’s own machines, so unknown software and environmental dependencies can also be discovered during this process. This is usually also the first time that new code is tested against real external libraries, services, and data.

19
Q

What is “System Testing”?

A

Once integration tests are performed, another level of testing called system testing can begin. In many ways, system testing acts as an extension to integration testing. The focus of system tests are to make sure that groups of components function correctly as a cohesive whole.

Instead of focusing on the interfaces between components, system tests typically evaluate the outward functionality of a full piece of software. This set of tests ignores the constituent parts in order to gauge the composed software as a unified entity. Because of this distinction, system tests usually focus on user- or externally-accessible interfaces.

20
Q

What is “Acceptance testing”?

A

Acceptance tests are one of the last tests types that are performed on software prior to delivery. Acceptance testing is used to determine whether a piece of software satisfies all of the requirements from the business or user’s perspective. These tests are sometimes built against the original specification and often test interfaces for the expected functionality and for usability.

Acceptance testing is often a more involved phase that might extend past the release of the software. Automated acceptance testing can be used to make sure the technological requirements of the design were met, but manual verification also usually plays a role.

Frequently, acceptance testing begins by deploying the build to a staging environment that mirrors the production system. From here, the automated test suites can be run and internal users can access the system to check whether it functions the way they need it to. After release or offering beta access to customers, further acceptance testing is performed by evaluating how the software functions with real use and by collecting feedback from users.

21
Q

What is “Soak testing”?

A

Soak testing involves testing software under significant production or production-like load for an extended period of time.

22
Q

What is blue/green deployment?

A

Blue-green deployments is a strategy for testing code in a production-like environment and for deploying code with minimal downtime. Two sets of production-capable environments are maintained, and code is deployed to the inactive set where testing can take place. When ready to release, production traffic is routed to the servers with the new code, instantly making the changes available.