<<

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? - How can we test embedded software? - Who has done this already?

@meekrosoft https://www.flickr.com/photos/philia17/15601597778/ @meekrosoft Professional

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 opinion in the community.) Eugene H. Spafford, Professor & Executive Director, Purdue University

https://www.cerias.purdue.edu/site/blog/post/short_random_thought_on_testing/#When:16:40:35Z @meekrosoft What is Continuous Delivery?

@meekrosoft Agile Manifesto

● Four doctrines, twelve Principles

# 1

# 7

@meekrosoft

Commit Rejected

Fail Fail Integration “Build”

Toll-gate pass

@meekrosoft Rejected Continuous Delivery

Pipeline

Analysis & Fail Metrics Fail Deploy

Functional Fail test Fail Document Fail Validate

Done done @meekrosoft Commit Rejected

Fail Fail Integration “Build”

Toll-gate pass Pipeline

Analysis & Fail Metrics Fail Deploy

Functional Fail test Fail Document Fail Validate

Done done @meekrosoft Release trains

@meekrosoft Release trains

@meekrosoft Challenges

@meekrosoft Solo work

http://www.lego.com/en-us/minifigures/characters/computer-programmer-0c248844ec9d4245a5c17479a208e45b @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 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.

http://blog.codinghorror.com/the-f5-key-is-not-a-build-process/ @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

Windows slavesWindows Jobs slavesWindows slaves

Vagrant file JobDSL

Linux slaveLinux slaveLinux slaveLinux slaves Dockerfile Puppet file

@meekrosoft Build in a box

Linux slaveLinux slaveLinux Linux slave Puppet Jenkins Master slaveLinux slaveLinux Master slave

Windows Windowsslave Windowsslave Windowsslave Docker container Windowsslave Artifactory slave Vagrant VM @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, 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

Build Red Produ Ideas ct TDD Green Refactor

Learn Measure

Continuous Integration Continuous Delivery Data BDD Automated Deployment Customer Feedback @meekrosoft Dev Env is competitive advantage

Attrition vs. Recruitment Late follower vs. First to market Unhappy customers vs. 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 of? ✓ - How can we test embedded software? ✓ - Who has done this already? ✓

@meekrosoft Questions? [email protected] @meekrosoft

@meekrosoft @meekrosoft @meekrosoft