I. K.
Gujral Punjab Technical University,
Kapurthala
Department of Computer Science and Engineering
Agile Software Development
Lab File
Submitted To: Submitted By:
Ms. Jappreet Kaur Shobit Sharma
2124399
[Link] (CSE)
7th SEM
1
Task-1
Aim: Understand the background and driving forces for taking an Agile Approach
to Software Development.
1. Changing Requirements in Software Projects
• Challenge: In traditional models like Waterfall, once the requirements were set, they
were rarely revisited, which led to issues when the client’s needs evolved during the
project. As a result, teams often delivered products that were outdated by the time they
launched.
• Agile Solution: Agile’s iterative approach allows requirements to be revisited in each
sprint. It uses adaptive planning, enabling teams to pivot based on customer feedback and
market trends.
• Example: A social media platform that incorporates frequent user feedback into
development can quickly roll out updates based on user behavior, such as adding a new
sharing feature or improving the UI based on recent trends.
2. Customer-Centric Development
• Challenge: Delivering a product after months or even years without feedback can lead to
a disconnect between what was built and what the customer needs.
• Agile Solution: Agile includes the customer at each step, with sprints ending in
demonstrations or reviews that involve the customer. This way, developers gather
immediate feedback and tailor the product to meet current customer expectations.
• Example: Spotify’s development approach is heavily influenced by Agile, which lets it
respond to user preferences and experiment with new features. By gathering feedback
from specific user groups and iterating, they’ve built features like personalized playlists,
podcasts, and user-curated collections.
3. Faster Time-to-Market
• Challenge: With traditional approaches, companies often spend a long time in
development, only to find competitors releasing similar products first.
• Agile Solution: Agile’s sprint cycles allow developers to deliver smaller, valuable
features faster. This process ensures that even partial functionality can reach users
quickly and evolve over time.
• Example: Amazon leverages Agile to release improvements constantly, whether through
small updates to the recommendation engine or the addition of features like one-click
purchasing. By getting features to market faster, they stay competitive and user-centered.
4. Improving Team Collaboration and Communication
• Challenge: In traditional development, teams often work in silos (e.g., developers,
testers, designers), leading to miscommunication and longer feedback loops.
2
• Agile Solution: Agile emphasizes cross-functional teams that communicate daily through
stand-ups and other ceremonies. This transparency fosters a collaborative culture where
everyone understands their role and contributions.
• Example: Companies like Google use Agile within small, cross-functional teams that
work collaboratively on projects. For instance, Google Maps development involves
frequent communication between engineers, designers, and data scientists to deliver
accurate and user-friendly map updates.
5. Risk Reduction
• Challenge: Traditional models can lead to late-stage discovery of critical issues, making
fixes costly and time-consuming.
• Agile Solution: Agile mitigates risks by identifying potential issues early through
incremental testing and development. Continuous integration ensures that code is tested
regularly, allowing teams to fix issues in real-time rather than waiting until the end.
• Example: Microsoft transitioned to an Agile approach with products like Office 365 to
continually release updates rather than waiting for annual releases. This reduces the risk
of bugs and enhances product stability by addressing issues as they arise.
6. Focus on Quality and Continuous Improvement
• Challenge: Quality assurance was often an afterthought in traditional models, which
could lead to last-minute quality issues.
• Agile Solution: Agile’s built-in testing and feedback cycles (such as retrospectives)
ensure that quality is continuously assessed and improved. Teams learn from each sprint
to refine both product and processes, leading to higher quality over time.
• Example: Companies like Netflix use Agile to ensure that new features and changes are
tested with smaller user groups first. This allows them to refine the user experience
before rolling out to their entire user base, resulting in a higher-quality product.
3
Task-2
Aim: Build out a backlog and user stories
User stories are a fundamental building block in Agile methodologies, providing a simple and
straightforward way to describe a software feature from an end user's perspective. They focus on
the value that the user will gain from the feature rather than getting bogged down in technical
details.
A user story is typically expressed in a simple sentence, following the format: "As a [type of
user], I want [an action] so that [a benefit/a value]." This helps to keep the focus on the user's
needs and encourages the team to consider the functionality from the user's perspective.
Examples of User Stories:
• As Max, I want to invite my friends, so we can enjoy this service together.
• As Sascha, I want to organize my work, so I can feel more in control.
• As a manager, I want to be able to understand my colleagues progress, so I can better
report our success and failures.
4
5
6
Task-3
Aim: To study and use automated build tool.
What is an Automated Build Tool?
An automated build tool automates tasks such as code compilation, testing, packaging, and
deployment. In Agile, they’re used to:
• Ensure frequent code integration (continuous integration)
• Reduce manual work in repetitive tasks
• Catch issues early through automated testing
• Support rapid deployment cycles
Examples of popular automated build tools include Jenkins, Maven, Gradle, GitHub Actions,
Travis CI, and CircleCI.
How Automated Build Tools Support Agile Development
1. Continuous Integration (CI) and Continuous Deployment (CD):
o CI/CD are core Agile practices enabled by build tools. CI involves merging
developer code to a shared repository frequently, while CD automates deployment
of new code versions.
o With CI/CD, teams can quickly verify code changes through automated builds,
tests, and deployments.
2. Early Issue Detection:
o Automated builds run tests immediately, catching bugs early before they
accumulate and complicate the release process.
3. Frequent and Reliable Releases:
o Build tools ensure code is always deployable, so releases are frequent and
reliable, aligning with Agile’s goal of delivering small, frequent updates.
Steps to Study and Use an Automated Build Tool (e.g., Jenkins or GitHub Actions)
Step 1: Setting Up the Tool
• For Jenkins:
o Install Jenkins on your system or use a cloud-hosted version.
o Create a new job (a task or pipeline), configure the source control (e.g., Git), and
set up build triggers (e.g., “build on commit”).
• For GitHub Actions:
o Navigate to the Actions tab in your GitHub repository.
o Set up a new workflow by either selecting a pre-made template or creating a
custom .yml configuration file.
7
Step 2: Create a Simple Build Pipeline
1. Define Build Tasks:
o Start by creating a simple build process:
▪ Code Compilation: For languages like Java, this might involve compiling
code using javac.
▪ Run Tests: Add tasks to run automated tests using frameworks like JUnit
or pytest.
2. Automate Steps with a Script:
o In Jenkins, add build steps to execute commands or scripts.
o In GitHub Actions, define the steps in your .yml file, like so:
yaml
Copy code
name: CI Pipeline
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
- name: Build with Maven
run: mvn -B package --file [Link]
- name: Run Tests
run: mvn test
Step 3: Triggering Builds Automatically
• Set up automatic triggers, such as:
o On Code Commit: Trigger builds whenever code is pushed to the repository.
o On Pull Requests: Automatically build and test code changes submitted for
review.
Step 4: Reviewing Build Status and Logs
• Monitor Builds: Both Jenkins and GitHub Actions provide interfaces to check build
status (pass/fail) and logs for each step. This makes it easy to troubleshoot issues if a
build fails.
8
• Notifications: Configure notifications to alert team members of build status via email or
Slack, helping them stay informed of any issues.
Example Tools to Explore
1. Jenkins: Highly customizable, often used for complex CI/CD workflows. Ideal for large
teams and projects.
2. GitHub Actions: Great for projects hosted on GitHub, as it integrates seamlessly and is
easy to configure.
3. Travis CI: A cloud-based CI service, simple to set up and ideal for smaller teams and
projects.
4. CircleCI: Known for fast performance and easy setup, it’s particularly useful for parallel
testing and builds.
Benefits of Using Automated Build Tools in Agile
• Faster feedback loops on code changes.
• Improved code quality through early and frequent testing.
• Higher deployment frequency, allowing for faster delivery of updates to users.
• Reduced manual effort in repetitive tasks, allowing developers to focus on higher-
priority work.
9
Task-4
Aim: To study-- version control tool.
What is a Version Control Tool?
A version control tool allows teams to track and manage changes to code over time. It records
every change made to files, allowing developers to revert to previous versions, merge changes,
and collaborate seamlessly.
Popular Version Control Tools:
• Git: The most widely used version control system. Git is a distributed version control
tool, allowing each developer to have a full copy of the repository.
• Subversion (SVN): A centralized version control system.
• Mercurial: Similar to Git, but less commonly used in recent years.
• GitHub, GitLab, and Bitbucket: Web-based platforms built on top of Git, providing
collaboration features like pull requests, issue tracking, and project management tools.
Getting Started with Git (Example Version Control Tool)
Here’s a basic guide to get started with Git, one of the most popular version control tools used in
Agile.
Step 1: Set Up Git
1. Install Git on your computer (available at [Link]).
2. Configure Git with your user information:
git config --global [Link] "Your Name"
git config --global [Link] [Link]@[Link]
Step 2: Initialize a Repository
1. Create a new project folder or navigate to an existing one.
2. Initialize a new Git repository with:
git init
This command creates a [Link] folder, which tracks changes to files in this folder.
10
Step 3: Make Changes and Track Them
1. Add files to your repository:
git add .
This command stages all changes in the current folder for committing.
2. Commit your changes with a message:
git commit -m "Initial commit"
Commits capture a snapshot of the current state of your files.
Step 4: Create and Work with Branches
In Agile, developers use branches to develop features independently before merging them into
the main branch.
1. Create a new branch:
git branch feature-branch
2. Switch to your new branch:
git checkout feature-branch
3. After making changes, commit them and switch back to the main branch when ready to
integrate:
git checkout main
Step 5: Merge Changes
1. Merge the feature branch back into the main branch:
git merge feature-branch
This combines changes from feature-branch into main.
Step 6: Push to a Remote Repository
To share your changes with other team members, push them to a shared repository like GitHub,
GitLab, or Bitbucket.
1. Link your repository to a remote one:
11
git remote add origin [Link]
2. Push changes to the remote repository:
git push -u origin main
12
Task-5
Aim: To study Continuous Integration tool.
What is Continuous Integration (CI)?
Continuous Integration (CI) is a software development practice where developers frequently
merge their code changes into a shared repository. Each merge is automatically tested, helping
teams detect issues early and integrate code continuously. CI enables Agile teams to deliver
high-quality software more quickly and frequently.
Benefits of CI in Agile:
1. Faster Feedback Loops: Automated tests run every time code is committed, giving
immediate feedback on whether new changes have broken existing code.
2. Increased Code Quality: Frequent integration and testing catch issues early, improving
overall code quality.
3. Efficient Collaboration: CI tools facilitate collaboration by ensuring code changes are
merged smoothly, reducing integration conflicts.
4. Supports Rapid Release Cycles: CI tools enable small, frequent releases, aligning with
Agile’s focus on iterative and incremental delivery.
Popular CI Tools
Some widely used CI tools include:
• Jenkins: Open-source, highly customizable, and popular for larger teams.
• GitHub Actions: Integrated with GitHub, easy to configure, and great for smaller
projects.
• Travis CI: Known for its simplicity and is widely used for open-source projects.
• CircleCI: Supports parallel testing and is known for fast performance.
• GitLab CI/CD: Part of GitLab, offering robust CI/CD capabilities for teams using
GitLab.
CI Pipeline Example Using Jenkins
Jenkins is another popular CI tool that you can install on your local server or use through a cloud
provider. Here’s a brief setup guide for Jenkins CI:
Step 1: Install Jenkins
1. Install Jenkins on your server or local machine (download from [Link]).
2. Once installed, access Jenkins through your web browser (e.g., [Link]
13
Step 2: Create a New Job
1. In Jenkins, create a new project by selecting New Item and choosing Freestyle project.
2. Name the job and link it to your Git repository.
Step 3: Configure Build Triggers
In the job configuration, set up triggers to initiate builds:
• For Git-based projects, use the Poll SCM option to run the job whenever there’s a code
change.
Step 4: Add Build Steps
1. Define build steps, such as installing dependencies and running tests.
2. For example, to run a simple build and test command in a [Link] project:
npm install
npm test
Step 5: Review Build Status and Logs
After setting up the pipeline, Jenkins will run tests and display build results, making it easy to
identify and fix issues.
14
Task-6
Aim: Apply Design principle and Refactoring to achieve agility.
Applying design principles and refactoring are critical for Agile software development to keep
the codebase adaptable, clean, and high-quality. Here’s a streamlined approach to using these
techniques effectively:
Key Design Principles for Agility
1. SOLID Principles:
o SRP: Each class has a single responsibility, making it easy to test and modify.
o OCP: Classes can be extended without modifying existing code.
o LSP: Derived classes can replace base classes without breaking functionality.
o ISP: Use specific, focused interfaces rather than a single broad one.
o DIP: High-level modules depend on abstractions, allowing easy swapping and
testing.
2. DRY (Don’t Repeat Yourself): Consolidate duplicate code to avoid maintenance issues.
3. KISS (Keep It Simple, Stupid): Avoid over-complicated designs for easier adaptation.
4. YAGNI (You Aren’t Gonna Need It): Only build what's necessary for the current
iteration.
5. Encapsulation: Encapsulate data and behaviors within classes to improve modularity and
collaboration.
Refactoring for Agility
Refactoring improves readability, reduces complexity, and prevents technical debt. Here’s how
to incorporate it into Agile:
1. Identify Code Smells (e.g., duplicate code, long methods) and improve structure
regularly.
2. Use Automated Refactoring Tools to safely rename, extract, or reorganize code.
3. Write Tests to ensure functionality remains consistent during refactoring.
4. Incremental Refactoring: Make small, continuous improvements within each sprint.
Common Refactoring Techniques
• Extract Method: Break complex functions into smaller ones for readability.
• Replace Magic Numbers: Use named constants instead of hardcoded values.
• Encapsulate Field: Make fields private and use getter/setter methods.
• Move Method: Relocate methods to more relevant classes for better cohesion.
15
Refactoring example:
# Before Refactoring
def process_order(order):
discount = calculate_discount(order)
process_payment(order, discount)
# After Refactoring
def calculate_discount(order):
pass
def process_payment(order, discount):
pass
def process_order(order):
discount = calculate_discount(order)
process_payment(order, discount)
Implementing Design and Refactoring in Agile
• Refactor in Each Sprint: Include refactoring as part of the sprint goals.
• Code Reviews: Use reviews to identify and implement design principles.
• Prioritize High-Impact Refactors: Focus on frequently changing, error-prone code.
• Manage Technical Debt: Schedule refactoring to reduce debt and improve agility.
By regularly applying these principles and refactoring, Agile teams maintain a flexible,
maintainable codebase, supporting continuous improvement and adaptability.
16
Task-7
Aim: Perform Testing activities within an agile project.
Testing in Agile projects is continuous, iterative, and collaborative. It involves integrating testing
activities throughout the development cycle to ensure rapid feedback and high-quality releases.
Here’s how testing typically unfolds in an Agile setting:
Key Testing Activities in Agile
1. Test Planning:
o In each sprint, teams collaboratively define test objectives and acceptance criteria
for user stories during sprint planning.
o Test cases are aligned with these criteria to verify that the developed features
meet requirements.
2. Test-Driven Development (TDD):
o Developers write automated tests before coding (often unit tests), which serve as a
guide for development and validation.
o TDD encourages small, incremental improvements and ensures each feature is
immediately tested.
3. Continuous Integration (CI) and Automated Testing:
o With every code change, CI tools (e.g., Jenkins, GitHub Actions) automatically
run a suite of tests, including unit, integration, and regression tests.
o CI helps catch bugs early, maintains code quality, and ensures that new changes
don’t break existing functionality.
4. Acceptance Testing and Behavior-Driven Development (BDD):
o Acceptance tests validate features that meet user requirements, often written in a
BDD style using tools like Cucumber.
o BDD involves writing test scenarios in simple language, making it easy for non-
technical stakeholders to review test cases.
5. Exploratory Testing:
o QA testers manually explore the application to uncover unexpected behavior,
usability issues, or edge cases not covered by automated tests.
o Exploratory testing complements automated tests, focusing on user experience
and “real-world” use.
6. Regression Testing:
o Regression tests check that new code doesn’t negatively affect existing
functionality.
o Automated regression tests are executed in each sprint to validate that all
integrated features work as expected with new changes.
7. Performance Testing:
o Performance tests evaluate how well the application performs under load,
identifying bottlenecks that could impact user experience.
o Agile teams may perform performance testing continuously or at the end of a
release cycle.
17
Agile Testing Best Practices
1. Automate Where Possible: Automate repetitive test cases to focus manual efforts on
exploratory testing.
2. Define “Done” Clearly: Set a clear Definition of Done that includes testing tasks such as
passing all automated tests, completing exploratory testing, and meeting acceptance
criteria.
3. Collaborate: Agile teams, including developers, testers, and product owners, work
together on test planning and reviewing results.
4. Review and Improve: At the end of each sprint, evaluate the effectiveness of testing
activities and make adjustments in sprint retrospectives.
Q1 - The Automated quadrant contains tests that are designed to improve the code quality of the
product and helps the team to create better outcomes.
Q2 - The Automated and Manual quadrant contains tests that help to improve the business
outcomes related to your product.
Q3 - The Manual quadrant contains tests with timely feedback for tests in quadrants 1 and 2. The
required business outcomes can be achieved using comprehensive testing of the product.
Q4 - The Tools quadrant contains tests to ensure that technology can help the code fulfill
required non-functional requirements such as security, scalability, etc.
18