In this lesson we will learn
about continuous integration, continuous deployment testing.
Continuous integration, continuous deployment,
or CI/CD testing systematically evaluates code changes
to identify and address security vulnerabilities,
and functional issues before the code is deployed
to production.
CI/CD testing concepts include canary testing,
regression testing, automated test and retest, unit testing,
and integration testing.
Let's learn more about canary testing, regression testing,
automated test and retest, unit testing,
and integration testing.
First, we have canary testing.
Canary testing is a phased approach
to deploying changes named after the practice
of using canaries in coal mines
to detect hazardous conditions.
Just as miners would bring canaries in cages into a mine
to warn them of dangerous gases before humans were affected,
canary testing involves rolling out a new feature
or code update to a small group of users
before releasing it to the entire user base.
The goal of canary testing is to monitor the performance,
and behavior of a system under real world conditions
with a limited audience.
In this way, canary testing allows organizations
to detect issues such as security vulnerabilities,
memory leaks, or crashes
within a controlled small scale deployment
before a full rollout.
If problems arise during canary testing,
developers can roll back those changes
without affecting the entire user base.
So canary testing offers an extra layer of quality control.
Second, we have regression testing.
Regression testing ensures that new code changes
do not negatively impact existing functionality.
Regression testing involves rerunning previously successful
test cases to verify that everything still works as intended
after a change has been integrated.
For instance, if new code is introduced
to enhance user authentication, regression testing,
will ensure that previous features
such as user profile management
or password recovery, remain unaffected.
In continuous integration continuous deployment pipelines,
regression tests are typically executed
after a new code is merged into the main branch of code
to maintain stability.
Due to its repetitive nature, automated regression testing
is often utilized, bringing developers to focus
on writing new tests, or resolving issues.
Third, we have automated testing and retesting.
Automated testing is where testing scripts
are run automatically every time new code is integrated.
This automation ensures that bugs are caught early
in the development process.
In the context of automated retesting,
if a bug has been detected and fixed,
tests are rerun to confirm the issue is resolved,
and that no new issues have been introduced.
Automated tests and retests can cover a wide range
of testing types, including unit testing,
integration testing, regression testing, and more.
In the end, automated testing helps ensure
that a system remains stable, as new features are developed,
and integrated into the CI/CD pipeline.
In all cases, this type of automation reduces human error,
and speeds up the testing process significantly,
especially in large code bases.
Fourth, we have unit testing.
Unit testing is the process of testing individual components
or functions in isolation.
Each unit of code, whether a function
or object oriented class is tested to ensure
that it behaves as expected.
This level of testing focuses
on small, specific parts of the code base,
allowing for precise identification of issues.
For example, if a function takes in an input
and provides an output, then unit testing can verify whether
the output is correct for the given inputs.
Unit tests are typically written alongside the main code,
and run frequently to catch errors early on
in the development process.
While unit tests ensure that each piece
of the system works on its own,
unit tests must be complemented by integration testing
to ensure the whole system functions properly once all
the components are assembled.
Fifth and finally, we have integration testing.
Integration testing focuses on the interaction
between different units or modules of a software system.
While unit tests check individual pieces of code,
integration tests check how units work together,
especially in environments where different services,
or microservices interact.
For instance, testing how an authentication service
communicates with a database,
or how the front end interacts with a backend server.
Integration tests like these help identify issues such
as data mismatches, broken APIs,
or misconfigured communication between services.
The integration testing phase is essential in environments
with complex multi-layered systems
where many different components
must function together seamlessly.
So remember, continuous integration, continuous deployment,
or CI/CD testing helps identify security vulnerabilities,
and functional issues before deploying code to production.
Key testing types include canary testing,
regression testing, automated testing and retesting,
unit testing, and integration testing.
Canary testing allows for phased deployment
to detect issues early on while regression testing
ensures new changes don't break existing features.
Meanwhile, automated testing speeds up bug detection.
Unit testing checks individual components,
and integration testing ensures
those components all work together properly.