@meekrosoft
Continuous Delivery of Embedded Software Mike Long, Partner, - - PowerPoint PPT Presentation
Continuous Delivery of Embedded Software Mike Long, Partner, - - PowerPoint PPT Presentation
Continuous Delivery of Embedded Software Mike Long, Partner, Praqma Norway @meekrosoft @meekrosoft @meekrosoft Agenda: - What is Continuous Delivery? - What are the challenges in Embedded? - What techniques can we take advantage of? -
@meekrosoft
@meekrosoft
Agenda:
- What is Continuous Delivery?
- What are the challenges in Embedded?
- What techniques can we take advantage
- f?
- How can we test embedded software?
- Who has done this already?
@meekrosoft
https://www.flickr.com/photos/philia17/15601597778/
@meekrosoft
Professional software development
- 1. Take a copy of the codebase for existing product
- 2. Carefully document its current algorithms
- 3. Add changes surrounded by ifdefs
- 4. Test for months
- 5. Commit the code as a new project that will “hopefully”
get merged to the in the future
- 6. Compile on my laptop
- 7. Ship!
@meekrosoft
Airbus engineers employed the latest and greatest formal methods, and provided model checking and formal proofs of all of their avionics code. Meanwhile, according to the story, Boeing performed extensive design review and testing, and made all their software engineers fly on the first test flights. The general upshot of the story was that most of us (it seemed) felt more comfortable flying on Boeing aircraft. (It would be interesting to see if that would still be the majority
- pinion in the software engineering community.)
https://www.cerias.purdue.edu/site/blog/post/short_random_thought_on_testing/#When:16:40:35Z
Eugene H. Spafford, Professor & Executive Director, Purdue University
@meekrosoft
What is Continuous Delivery?
@meekrosoft
Agile Manifesto
- Four doctrines, twelve Principles
# 1 # 7
@meekrosoft
Rejected Fail
Integration
Commit
“Build”
Fail Toll-gate pass
Continuous Integration
@meekrosoft
Analysis & Metrics Deploy Functional test Document Validate
Done done Pipeline Fail Fail Fail Fail Fail Rejected
Continuous Delivery
@meekrosoft
Analysis & Metrics Deploy Functional test Document Validate
Done done Pipeline Fail Fail Fail Fail Fail Rejected Rejected Fail
Integration
Commit
“Build”
Fail Toll-gate pass
@meekrosoft
Release trains
@meekrosoft
Release trains
@meekrosoft
Challenges
@meekrosoft
http://www.lego.com/en-us/minifigures/characters/computer-programmer-0c248844ec9d4245a5c17479a208e45b
Solo work
@meekrosoft
Fire and forget codebases?
@meekrosoft
@meekrosoft
Production-like environment???
@meekrosoft
@meekrosoft
Versioning
@meekrosoft
The red thread of traceability
We want to know: what it is compatible with, what it depends on, where it was built, what its test results were, its source version, and the task that spawned the change
@meekrosoft http://semver.org
@meekrosoft
Examples
myapplication-1.0.0-alpha+001.sha.5114f85
Artifact Name
@meekrosoft
Examples
myapplication-1.0.0-alpha+001.sha.5114f85
Major.minor.patch
@meekrosoft
Examples
myapplication-1.0.0-alpha+001.sha.5114f85
Prerelease version
@meekrosoft
Examples
myapplication-1.0.0-alpha+001.sha.5114f85
Build number
@meekrosoft
Examples
myapplication-1.0.0-alpha+001.sha.5114f85
git short SHA
@meekrosoft
Examples
myapplication-1.0.0-SNAPSHOT+001.sha. 5114f85
SNAPSHOT
@meekrosoft
@meekrosoft
@meekrosoft
Build
@meekrosoft http://blog.codinghorror.com/the-f5-key-is-not-a-build-process/
If your "build process" is the F5 key, you have a problem…..Get your build process out of the IDE and into a build script.
@meekrosoft
What’s missing?
Traceability: Can I find out exactly the environment for this build? Reproducibility: Can I build something from last year with the same results?
@meekrosoft
@meekrosoft
@meekrosoft
@meekrosoft
A Traceability ecosystem
@meekrosoft
Configuration as code
Linux slave Linux slave Linux slave Linux slaves Dockerfile Vagrant file Windows slaves Puppet file Windows slaves Windows slaves Jenkins Jobs JobDSL
@meekrosoft
Build in a box
Jenkins Master Artifactory Docker container Linux slave Linux slave Linux slave Linux slave Linux slave Linux slave Windows slave Vagrant VM Windows slave Windows slave Windows slave Windows slave Puppet Master
@meekrosoft
Testing
@meekrosoft
@meekrosoft
System Tests ✓
@meekrosoft
System Tests
- Control power
- Program devices
- Control Actuators
- Sense results
✓
@meekrosoft
System Tests Component Tests
✓ ✓
@meekrosoft
System Tests Component Tests
✓ ✓ ✓
@meekrosoft
@meekrosoft
Test everywhere
Test on your host for:
- Feedback speed, debugging
But also test on target because:
- Compilers/hardware are different
- Endiness/overflow/underflow behave
differently
- Ship them if you can!
@meekrosoft
@meekrosoft
Pro Tips
@meekrosoft
// #ifdef MY_PROD_V1
Avoid using the preprocessor for variants
- It makes builds slow
- Lowers cohesion
- Also hinders understandability
@meekrosoft
Only build your binaries once
Efficiency - time to feedback Safety - ship what you test
@meekrosoft
Amplify feedback loops
TDD Red Refactor Green
Learn Measure Build
Produ ct Data Ideas
Continuous Integration Continuous Delivery BDD Automated Deployment Customer Feedback
@meekrosoft
Dev Env is competitive advantage
Attrition vs. Late follower vs. Unhappy customers vs. Recruitment First to market Raving fandom
@meekrosoft
Summary
@meekrosoft
https://www.flickr.com/photos/22423670@N08/14260168597
@meekrosoft
@meekrosoft
The researchers praised Tesla for the way the vehicle handled the bogus commands and how the car maker responded to their findings.
@meekrosoft
In late July, Fiat Chrysler issued a recall for more than 1.4 million vehicles after hackers Charlie Miller and Chris Valasek showed how to use bugs in the onboard software of the Jeep Cherokee to shut it down remotely.
@meekrosoft
Agenda:
- What is Continuous Delivery? ✓
- What are the challenges in Embedded? ✓
- What techniques can we take advantage
- f? ✓
- How can we test embedded software? ✓
- Who has done this already? ✓
@meekrosoft
Questions?
mike@praqma.com @meekrosoft
@meekrosoft
@meekrosoft