These are the slides of the tutorial I gave at QA&Testing in Bilbao on 17 October 2018
Continuous integration and deployment (CI/CD) empowers organizations to bring their solution in production fast and frequent. This interactive session will share the benefits of this concept and introduce eight conditions that need to be met in order to make CI/CD a success. After this brief introduction, we will make small groups and explore these conditions, exchange experiences and you will get an understanding what needs to be improved in your organization. Talk to your peers and learn where they stand. Of course each of the groups will share their learnings, so we all go home with an understanding of how you can benefit from CI/CD and what needs to be done to make it work.
Finally we will see what test strategy we would advise if our company would decide to move towards CI/CD and this cover we consider much more than just automate our tests…
3. 3
Tester’s considerations when moving towards
successful CI/CD
Continuous integration and deployment (CI/CD)
empowers organizations to bring their solution in
production fast and frequent. This interactive session
will share the benefits of this concept and introduce
eight conditions that need to be met in order to make
CI/CD a success. After this brief introduction, we will
make small groups and explore these conditions,
exchange experiences and you will get an
understanding what needs to be improved in your
organization. Talk to your peers and learn where they
stand. Of course each of the groups will share their
learnings, so we all go home with an understanding of
how you can benefit from CI/CD and what needs to be
done to make it work.
20. Take a look around you !
20
Releasing the
bugfix on the
test
environment
takes ages
We have been
working hard,
but nothing is
ready for the
Demo
We have
delivered as IT
but the system
is not used yet
We have
figured out how
to configure the
system, but
operations
lacks this
knowledge
We have fixed
the critical but
testing takes
multiple days
Every time we
release we
reserve support
time to sort out
prod. errors
21. Antipattern: Deploying Manually
If your deployments are not fully automated you:
• Need to extensively document the deployment process
• Rely on a manual to confirm the application is running OK
• Get frequent calls to dev team about release problems
• Need to correct the process during deployment
• End up with different configurations on various environments
• Have unpredictable outcome and have to reserve fixing time
to make it work
• Rely on SPOC (the release expert)
21[Continuous Delivery – Jezz Humble & David Farley]
22. Antipattern: Deploy to PRD-like
once dev is complete
When you deploy late in the cycle to a production like
environment you
• Do most of your test on development machines
• Create an hand-over between dev and ops: config files,
database migrations, deployment scripts etc.
• Ask operations do the deployment for the first time on the
release date
• Do not stimulate dev and ops to collaborate
• Create a late-feedback cycle when dealing with production
errors
• Make a lot of assumptions about the PRD environment
22[Continuous Delivery – Jezz Humble & David Farley]
23. Antipattern: Manual Configuration
When you have a manual configuration management, you:
• Risk that deployment fail to configuration differences
• Need a lot of preparation time to release
• Cannot easily step back to an earlier configuration
• Risk that different machines have different versions of
OS, libraries, patch-level
• Probably adapt configuration items live on the
production environment
23[Continuous Delivery – Jezz Humble & David Farley]
27. Continuous Delivery Example
27
Local
• Code
• Unit Test
• Commit
Development
• Save Repo
• Get config
• Deploy
• Test
Test
• Save Repo
• Get config
• Deploy
• Test
Acceptance
• Save Repe
• Get config
• Deploy
• Test
1
Daily
• Nightly regression
test
• Monitoring
Daily
• Nightly
performance test
• Monitoring
Daily
• E2E test
• Monitoring
28. Definitions
Continuous integration (CI) is the practice of merging all
developer working copies to a shared mainline several
times a day.
With continuous delivery (CD) teams produce software in
short cycles, ensuring that the software can be reliably
released at any time. It aims at building, testing, and
releasing software faster and more frequently.
Continuous deployment (CD) is the next step of
continuous delivery: Every change that passes the
automated tests is deployed to production automatically.
[Sources: Wikipedia and puppet.com]
28
31. Some advantages
• Efficiency
• Reduces amount of rework
• Predictability
• Reduced time to market
• Fast feedback
• Reducing risk
• Better quality solutions
32
32. How often to production ?
33
[https://devops.com/often-release-continuous-delivery/]
How important are your updates?
Is there a marketing advantage in delaying the release?
Do other apps depend on your app?
Is your development pace consistent?
Do your updates create a learning curve?
Can multiple versions of your app coexist?
ChristopherTozzi
33. How often to production
How important are your updates? If changes to your app mostly involve mundane
things such as interface tweaks, continuous deployment probably will confuse users more
than please them. They will have to adapt constantly to new features. But if you can roll
out big, user-friendly changes on a continual basis, then deploying continuously can help
keep your users happy.
Is there a marketing advantage to be gained by waiting longer to
release? Sometimes, advertising new features but waiting a while to release them can
help build excitement. Case in point: Apple Inc.
Do other apps depend on your app? If you’re working within an ecosystem where your
app integrates with other apps or platforms, continuous deployment makes the lives of
partner developers more difficult because it requires them to adjust constantly to changes
in your app. To help them ensure their work will always be compatible with yours, provide
space between your releases.
Is your development pace consistent? If not, continuous deployment can be
problematic because users will see rapid updates at some times, but stagnation at other
times. Continuous deployment only works well for users if they can count on a relatively
steady stream of updates.
Do your updates create a learning curve? If users will have to learn new tricks to use
an updated app, continuous deployment may create more confusion than happiness.
Can multiple versions of your app coexist?
34
[https://devops.com/often-release-continuous-delivery/]
36. CI/CD requires that (in random order)
3
Teams collaborate
with each other
Integration is
continuous
Deployment is a
hands-off process
Feedback loop to
improve quality
Features are
launched frequently
Acceptance criteria
are clear
Teams have all
required skills and
knowledge
Tests are
automated
Valori-version1.2-2017
37. How can you
use it?
Sales
Maturity
scan
Triggering
discussions
Defining
roadmap
38. Integration is continuous
Should be in place
• Teams integrate as fast as
possible
• Teams work with the
same DOD
• Integration tests can be
run by everyone or
started upon check-in
• Team make agreements
on how to deal with
integration tests
Challenges
• Number of teams
• Integration at system level
• Hardware components
• Organizational boundaries
• Dependencies not known
• Infrastructure
• Different heartbeats
39.
40. CI/CD requires that (in random order)
4
Teams collaborate
with each other
Deployment is a
hands-off process
Feedback loop to
improve quality
Features are
launched frequently
Acceptance criteria
are clear
Teams have all
required skills and
knowledge
Tests are
automated
Valori-version1.2-2017
Architecture supports
partial development
and release
42. Assignment
1. Divide in groups
2. Define what the requisite means to you (5 min)
3. Rate individually how your team/ organization
scores (1 min)
4. List as a group some (20 min)
• things you have in place to fulfill this requisite
• challenges you recognize
• Time is limited
• Mission is information gathering
• Tip: Identify items, don’t get lost in the
discussion
44. How to pick your team
• You got this covered and are
willing to share some tips
• You are currently struggling with
this and want to discuss it with
your peers
• You find this important and
want to compare your status
• You want to learn about this
topic since its quite new for you
50. [SC]2 morning workshop, 4 Oct.
2017
[SC]2 afternoon workshop, 4 Oct.
2017
TestNet workshop, 11 Oct. 2017
Teams collaborate
with each other
Architecture supports
partial development
and release
Tests are
automated
Deployment is a
hands-off process
Acceptance criteria are
clear
Features are launched
frequently
Feedback loop to
improve quality
Teams have all
required skills and
knowledge
53. Green field
Do it right from day 1
Ensure that everybody
supports the approach
Write automated test
for each story
54
Testers are involved during
refinement to ensure that each
acceptance criterium can be
tested
54. Legacy Environment
1. Set up version control
2. Create an automatic build process
3. Sit with users to identify high value scenario’s
4. Create an Automated Functional Test as smoke test
5. Expand tests while developing
• E.g. Test hardening to add alternative and exception paths
• E.g. By defining tests for new stories
55
Challenge 1: Business does not
understand why you have to
spend time with defining tests
for a system that is already
accepted and in production
Challenge 2: System is not
suited for Automation e.g.
structure or object recognition
56. When to test?
When anything changes in:
57
Executable
Code
Configuration
Host
Environment
Data
57. What to test….
58
Process of creating executable code
- Syntax of source code is correct
User Acceptance Test
- System supports customer journey
Exploratory tests
- Validation check Integration test
- System works within system of other
systems
Functional and NF tests
- System delivers value as intended
- System complies to capacity,
security, availability, etc.
requirements
Smoke test and deployment test
- Systems is correctly and installed and
configured on target environment
Configuration test
- 1: ensure references to external
service in configuration setting are
OK
- 2: Run smoke test
Code Quality Criteria
- e.g. test coverage and code metrics
Unit testing
- Code behaves as expected
59. Assignment: CI/CD Test Strategy
Your organization is moving towards CI/CD. They ask you to
draw up a plan to (re)organize testing to ensure that
Quality is built-in
Time to market is reduced
We can do Validated learning
Explain
What tests (or quality measures) you think are necessary?
Which of them should you start with
How would you organize them
What benefits would this yield.
60
Organizational life span, goes through different phases….
When organizations fail to re-invent themselves they decline
In 2012 I wrote an article about the discontinuity of TPI. I did not yet use the word “disruptive”
I had the image of getting of the beaten track and walking through the growth towards a easy road.
Being caught up by new innovations
Not predictable…
3D printing – houses, furniture Goodbye IKEA
IA and robots
Selfdriving cars – Taxi service?
The impact of disruptive innovations is hard to predict!
Collaborate:
e.g. Developers, Testers, System & DB administrators, Managers [xxv]
Customers and Project managers [93]
Users
Validated learning:
Delivering fast allows you to verify whether your features and bugfixes are useful [12]
Note: it requires that you measure how you solution is perceived by the user/customer. E.g. production monitoring.
Fail foreward: internal learning by performing experiments. Has overlap with validated learning, but in this case I make the distinction between internal learning to improve the WOW and external learning via the product (wich I call validated learning)
[Continuous Delivery – Jezz Humble & David Farley]
[7]
The solution:
Ensure that you moderate your system fast
But most of all…
Ensure that you can deploy it fast and predictable
Get rid of the anti-paterns and known problems by
Doing it often
Doing it as early as possible
Doing it the same way each time
Thus…. The solution is CI/CD
The executable code should be the same for each environment, so no hardcoded config data…..
Anything that changes between environments should be captured as config data [13]
https://puppet.com/blog/continuous-delivery-vs-continuous-deployment-what-s-diff
CI: the practice of building and testing your application on every check-in [13]
Happiness factor….
https://devops.com/often-release-continuous-delivery/
By Christopher Tozzi has covered technology and business news for nearly a decade, specializing in open source, containers, big data, networking and security. He is currently Senior Editor and DevOps Analyst with Fixate.io and Sweetcode.io.
So, if you’re doing continuous delivery, you have the option of releasing as frequently as you like—every day, every month or even every hour. Determining how often you actually release requires weighing several important factors, including:
How important are your updates? If changes to your app mostly involve mundane things such as interface tweaks, continuous deployment probably will confuse users more than please them. They will have to adapt constantly to new features. But if you can roll out big, user-friendly changes on a continual basis, then deploying continuously can help keep your users happy.
Is there a marketing advantage to be gained by waiting longer to release? Sometimes, advertising new features but waiting a while to release them can help build excitement. Case in point: Apple Inc.
Do other apps depend on your app? If you’re working within an ecosystem where your app integrates with other apps or platforms, continuous deployment makes the lives of partner developers more difficult because it requires them to adjust constantly to changes in your app. To help them ensure their work will always be compatible with yours, provide space between your releases.
Is your development pace consistent? If not, continuous deployment can be problematic because users will see rapid updates at some times, but stagnation at other times. Continuous deployment only works well for users if they can count on a relatively steady stream of updates.
Do your updates create a learning curve? If users will have to learn new tricks to use an updated app, continuous deployment may create more confusion than happiness.
Can multiple versions of your app coexist? If all users need to be running the same version of your app in order to be current, continuous deployment can help assure that they are. But if you can support multiple versions of the same app at once, less frequent releases should work for you.
If you can’t decide how frequently to release, you might consider releasing on a fixed time schedule—once every two months, every six months, every year or whatever works for you. This is what Canonical has done with Ubuntu Linux for a long time: It releases a new version of the operating system on the second Thursday of October and the fourth Thursday of April each year (with a few exceptions). This system assures that developers and users always know the schedule for a new release.
Whatever approach you take, the most important thing is to realize that continuous delivery does not require you to release as often as you can. It gives you the flexibility to release as often as you want. Deciding how often that should be is up to you.
https://devops.com/often-release-continuous-delivery/
So, if you’re doing continuous delivery, you have the option of releasing as frequently as you like—every day, every month or even every hour. Determining how often you actually release requires weighing several important factors, including:
How important are your updates? If changes to your app mostly involve mundane things such as interface tweaks, continuous deployment probably will confuse users more than please them. They will have to adapt constantly to new features. But if you can roll out big, user-friendly changes on a continual basis, then deploying continuously can help keep your users happy.
Is there a marketing advantage to be gained by waiting longer to release? Sometimes, advertising new features but waiting a while to release them can help build excitement. Case in point: Apple Inc.
Do other apps depend on your app? If you’re working within an ecosystem where your app integrates with other apps or platforms, continuous deployment makes the lives of partner developers more difficult because it requires them to adjust constantly to changes in your app. To help them ensure their work will always be compatible with yours, provide space between your releases.
Is your development pace consistent? If not, continuous deployment can be problematic because users will see rapid updates at some times, but stagnation at other times. Continuous deployment only works well for users if they can count on a relatively steady stream of updates.
Do your updates create a learning curve? If users will have to learn new tricks to use an updated app, continuous deployment may create more confusion than happiness.
Can multiple versions of your app coexist? If all users need to be running the same version of your app in order to be current, continuous deployment can help assure that they are. But if you can support multiple versions of the same app at once, less frequent releases should work for you.
If you can’t decide how frequently to release, you might consider releasing on a fixed time schedule—once every two months, every six months, every year or whatever works for you. This is what Canonical has done with Ubuntu Linux for a long time: It releases a new version of the operating system on the second Thursday of October and the fourth Thursday of April each year (with a few exceptions). This system assures that developers and users always know the schedule for a new release.
Whatever approach you take, the most important thing is to realize that continuous delivery does not require you to release as often as you can. It gives you the flexibility to release as often as you want. Deciding how often that should be is up to you.
Teams collaborate to deliver each sprint a working product
Integration is continue
Tests are automated
Tests are run from the build server
Deployment is hands-off process
TDD ensures no backlog in TA
Acceptance criteria are clear
Feedback loop to create better tests in place
Product goes live regularly
Teams collaborate to deliver each sprint a working product
Integration is continue
Tests are automated
Tests are run from the build server
Deployment is hands-off process
TDD ensures no backlog in TA
Acceptance criteria are clear
Feedback loop to create better tests in place
Product goes live regularly
[Continuous Delivery – Jezz Humble & David Farley]
[p95[
When dealing with
[93]
[95] Note that business might not understand why you have to spend time with defining tests for a system that is already accepted and in production