Continuous Integration/Continuous Deployment
Traditional “Waterfall” Testing Practices
In the Waterfall model, software development follows a sequential process. Testing typically occurs toward the end of the project.
Characteristics:
- Late-stage testing: After development and design are completed
- Long planning phase: Requires lead time for test case design and environment setup
- Stable requirements: Test cases rarely change once tied to fixed requirements
- Low flexibility: Few updates after system specifications are locked
- Periodic testing: Initial test to confirm requirements, followed by regression testing after changes
Downsides:
- Late bug discovery
- Expensive fixes
- Long feedback loop
Agile Testing & Continuous Integration
Unlike Waterfall, Agile encourages early and continuous testing throughout development.
Continuous Integration (CI)
“CI is a software development practice where team members integrate work frequently, ideally multiple times per day. Each integration is verified by an automated build (including tests) to detect errors quickly.” — Martin Fowler
CI Process in Agile
- A developer completes a feature
- Code is tested and packaged locally
- Code is pushed to the shared repository
- Automated build & test runs to verify integration
- If errors arise, conflicts are fixed and the process repeats
- Application is always in a deployable state
Why Use CI?
- Faster feature delivery
- Automated build and test
- Real-time feedback on build/test status
- Immediate bug detection
- Ensures a working version of software at any point
- Maintains full project version history
Key Steps in CI
Each time code is committed:
- Integrate: Merge all changes to main branch
- Build: Compile into executables or packages
- Test: Run unit, integration, and regression tests
- Archive: Store versioned build artifacts
- Deploy: Automatically push to a testing/staging environment
Fowler’s 10 Best Practices for CI
- Maintain a Single Source Repository
- Automate the Build
- Make Your Build Self-Testing
- Everyone Commits to the Mainline Every Day
- Every Commit Should Build on the Integration Machine
- Keep the Build Fast
- Test in a Clone of the Production Environment
- Make It Easy to Get the Latest Executable
- Everyone Can See What’s Happening
- Automate Deployment
Fowler’s Full Text on Best Practices
CI Tools
Many modern tools help implement CI pipelines effectively. Popular CI tools include:
- Jenkins
- Travis CI
- GitHub Actions
- CircleCI
- GitLab CI/CD
- Bamboo
🔗 Atlassian CI Tool Comparison
Continuous Delivery vs Continuous Deployment
Term | Description |
---|---|
Continuous Delivery | Every change that passes tests is ready for release, but manual approval may be required |
Continuous Deployment | Every passing change is automatically deployed to production without manual intervention |
🔗 CI vs Delivery vs Deployment
Development Lifecycle With CI
Feature Dev -> Local Build/Test -> Push to Repo -> CI System Triggers ->
Build & Automated Tests -> Deploy to Staging -> Review & Merge -> Delivery/Deployment
This process repeats for each feature, keeping the application stable and deployable at all times.
Summary
- CI/CD helps maintain a high-quality, deployable product throughout development
- Agile methodology aligns with CI principles by encouraging frequent integration
- Automated builds and tests help catch bugs early
- Fowler’s best practices guide an efficient CI pipeline
- CI tools streamline this process across teams and platforms
Disclaimer: Generative AI was used in part to generate these lecture notes.