Unit 4 - Notes

CSE121 7 min read

Unit 4: DevOps & Software Testing

1. Introduction to DevOps

DevOps is a set of practices, tools, and a cultural philosophy that automates and integrates the processes between software development (Dev) and IT teams (Ops). It emphasizes team empowerment, cross-team communication and collaboration, and technology automation.

The primary goal of DevOps is to shorten the systems development life cycle while delivering features, fixes, and updates frequently in close alignment with business objectives.

DevOps vs. Traditional Software Development Models (Waterfall/Agile)

Traditional models often created silos where developers wrote code and threw it "over the wall" to operations staff to deploy and support, leading to the "blame game" when things broke.

Feature Traditional Model (Waterfall) DevOps Model
Release Cycle Long, infrequent (Months/Years) Short, frequent (Weeks/Days/Hours)
Collaboration Siloed teams (Dev vs. Ops) Cross-functional, collaborative teams
Testing Post-development activity Continuous testing throughout the lifecycle
Automation Minimal; mostly manual High; infrastructure as code, CI/CD
Objective Stability and definition Speed, agility, and reliability
Feedback Delayed (End of cycle) Immediate (Continuous feedback loops)

A detailed concept diagram illustrating the DevOps Infinity Loop. The diagram should feature a conti...
AI-generated image — may contain inaccuracies


2. The DevOps Life Cycle & Automation

The DevOps life cycle is continuous, represented by an infinity loop. Automation is the core enabler of this cycle, removing manual errors and speeding up processes.

Phases of the DevOps Life Cycle:

  1. Plan: Defining business value and requirements.
  2. Code: Software design and code development using Git.
  3. Build: Managing software versions and compiling code (Maven/Gradle).
  4. Test: Automated testing to ensure quality (Selenium/JUnit).
  5. Release: managing, scheduling, and controlling the build updates.
  6. Deploy: Automatic deployment to production environments (Docker/Kubernetes).
  7. Operate: Configuration and management of the software.
  8. Monitor: Identifying performance issues and bugs in real-time (Nagios).

Role of Automation

  • Consistency: Eliminates "it works on my machine" issues.
  • Speed: Builds and deployments happen in minutes, not hours.
  • Reliability: Automated tests run the exact same way every time.

3. CI/CD: Continuous Integration and Continuous Deployment

CI/CD is the backbone of modern DevOps operations.

  1. Continuous Integration (CI): Developers frequently merge their code changes into a central repository (like GitHub). Automated builds and tests run immediately to validate the code.
  2. Continuous Delivery (CD): Code changes are automatically built, tested, and prepared for a release to production.
  3. Continuous Deployment: Every change that passes all stages of the production pipeline is released to customers automatically, with no human intervention.

A horizontal flow diagram depicting a CI/CD Pipeline. The flow starts on the left with a "Developer"...
AI-generated image — may contain inaccuracies


4. DevOps Tools

A "DevOps Toolchain" is a set of tools used to perform DevOps tasks.

  • Git: A distributed version control system for tracking changes in source code. It allows multiple developers to work together.
  • Maven: A build automation tool used primarily for Java projects. It manages dependencies (libraries) and the build process.
  • Selenium: An open-source tool for automating web browsers. It is primarily used for functional and regression testing of web applications.
  • Docker: A platform for "containerization." It packages an application and its dependencies into a "container" that can run on any Linux server, ensuring consistency across environments.
  • Kubernetes (K8s): An open-source system for automating deployment, scaling, and management of containerized applications (orchestration). It manages Docker containers.
  • Puppet: A configuration management tool. It treats "Infrastructure as Code," allowing admins to define the state of their IT infrastructure automatically.
  • Ansible: Similar to Puppet but agentless (easier to set up). It automates software provisioning, configuration management, and application deployment.
  • Nagios: A monitoring system that alerts DevOps teams to system outages, server crashes, or performance bottlenecks.

5. Fundamentals of Software Testing

Software Testing is the process of evaluating and verifying that a software product or application does what it is supposed to do. The benefits include preventing bugs, reducing development costs, and improving performance.

Objectives of Testing

  1. Verification: Are we building the product right? (Adhering to specs).
  2. Validation: Are we building the right product? (Meeting user needs).
  3. Defect Detection: Finding bugs before the customer does.
  4. Quality Assurance: Ensuring reliability, security, and performance.

Levels of Testing

Testing is performed at different granularities:

  1. Unit Testing: Testing individual components or modules of source code (usually done by developers).
  2. Integration Testing: Testing the interaction between integrated units/modules to detect interface defects.
  3. System Testing: Testing the complete, integrated software to verify it meets requirements.
  4. Acceptance Testing (UAT): Testing performed by the client/user to verify the system satisfies business requirements before delivery.

Types of Testing

  • Functional Testing: Checks what the system does (e.g., Unit, Integration, System, Sanity, Smoke).
  • Non-Functional Testing: Checks how the system performs (e.g., Performance, Load, Stress, Security, Usability).

6. Manual vs. Automation Testing & Test Design

Manual vs. Automation

Aspect Manual Testing Automation Testing
Definition Human tester executes test cases without tools. Tools execute pre-scripted tests.
Speed Slower, prone to human fatigue. Faster, can run 24/7.
Accuracy Prone to human error. High accuracy (does exactly what script says).
Cost Low initial cost, high long-term cost (labor). High initial cost (tools/scripting), low ROI long-term.
Suitability Best for Usability, Ad-hoc, and Exploratory testing. Best for Regression, Load, and repeated execution.

Introduction to Test Case Design

A test case is a set of conditions under which a tester will determine whether an application represents the requirements.

Example Test Case: Login Functionality

ID Test Step Test Data Expected Result Actual Result Status
TC01 Enter valid username and password User: admin
Pass: 12345
Login successful, redirect to dashboard Dashboard loaded Pass
TC02 Enter invalid password User: admin
Pass: wrong
Error message "Invalid Credentials" Error displayed Pass

Applications of Software Testing in IT Companies

  • BFSI (Banking): Critical for security and transaction accuracy.
  • E-Commerce: Essential for load testing (Handling high traffic like Black Friday) and payment gateway verification.
  • Healthcare: Compliance with regulations (HIPAA) and data integrity.

7. Defect Life Cycle (Bug Life Cycle)

The Defect Life Cycle is the journey of a defect from its identification to its closure.

A state transition diagram showing the Defect (Bug) Life Cycle. The flow should start with a circle ...
AI-generated image — may contain inaccuracies

Stages:

  1. New: Defect is logged/posted for the first time.
  2. Assigned: Lead assigns the defect to a developer.
  3. Open: Developer starts analyzing and working on the fix.
  4. Fixed: Developer makes necessary code changes and marks it fixed.
  5. Pending Retest: Code is deployed for testing.
  6. Retest: Tester verifies the fix.
  7. Verified/Closed: If the bug is gone, it is closed.
  8. Reopened: If the bug persists, it is sent back to the developer.

8. Career Opportunities in DevOps & Testing

The industry demand for "Shift Left" (testing early) and rapid deployment has created high demand for these roles.

Roles

  1. DevOps Engineer: Focuses on infrastructure, CI/CD pipelines, and cloud management.
  2. QA Automation Engineer: Writes scripts (Python/Java) to automate testing using tools like Selenium.
  3. Site Reliability Engineer (SRE): Ensures systems are reliable and scalable (Google's approach to DevOps).
  4. Release Manager: Coordinates the deployment of code to production.
  5. Manual Tester: Focuses on UX/UI and exploratory testing.

Required Skillset

  • Hard Skills: Linux/Unix command line, Scripting (Python, Bash, or Shell), Git, Jenkins/Maven, Docker/Kubernetes, Cloud platforms (AWS/Azure).
  • Soft Skills: Communication (bridging the gap between teams), problem-solving, and adaptability.