Continuous Delivery of Embedded Software Mike Long, Partner, - - PowerPoint PPT Presentation

continuous delivery of embedded software
SMART_READER_LITE
LIVE PREVIEW

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? -


slide-1
SLIDE 1

@meekrosoft

Continuous Delivery of Embedded Software

Mike Long, Partner, Praqma Norway @meekrosoft

slide-2
SLIDE 2

@meekrosoft

slide-3
SLIDE 3

@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?
slide-4
SLIDE 4

@meekrosoft

https://www.flickr.com/photos/philia17/15601597778/

slide-5
SLIDE 5

@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!
slide-6
SLIDE 6

@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

slide-7
SLIDE 7

@meekrosoft

What is Continuous Delivery?

slide-8
SLIDE 8

@meekrosoft

Agile Manifesto

  • Four doctrines, twelve Principles

# 1 # 7

slide-9
SLIDE 9

@meekrosoft

Rejected Fail

Integration

Commit

“Build”

Fail Toll-gate pass

Continuous Integration

slide-10
SLIDE 10

@meekrosoft

Analysis & Metrics Deploy Functional test Document Validate

Done done Pipeline Fail Fail Fail Fail Fail Rejected

Continuous Delivery

slide-11
SLIDE 11

@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

slide-12
SLIDE 12

@meekrosoft

Release trains

slide-13
SLIDE 13

@meekrosoft

Release trains

slide-14
SLIDE 14

@meekrosoft

Challenges

slide-15
SLIDE 15

@meekrosoft

http://www.lego.com/en-us/minifigures/characters/computer-programmer-0c248844ec9d4245a5c17479a208e45b

Solo work

slide-16
SLIDE 16

@meekrosoft

Fire and forget codebases?

slide-17
SLIDE 17

@meekrosoft

slide-18
SLIDE 18

@meekrosoft

Production-like environment???

slide-19
SLIDE 19

@meekrosoft

slide-20
SLIDE 20

@meekrosoft

Versioning

slide-21
SLIDE 21

@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

slide-22
SLIDE 22

@meekrosoft http://semver.org

slide-23
SLIDE 23

@meekrosoft

Examples

myapplication-1.0.0-alpha+001.sha.5114f85

Artifact Name

slide-24
SLIDE 24

@meekrosoft

Examples

myapplication-1.0.0-alpha+001.sha.5114f85

Major.minor.patch

slide-25
SLIDE 25

@meekrosoft

Examples

myapplication-1.0.0-alpha+001.sha.5114f85

Prerelease version

slide-26
SLIDE 26

@meekrosoft

Examples

myapplication-1.0.0-alpha+001.sha.5114f85

Build number

slide-27
SLIDE 27

@meekrosoft

Examples

myapplication-1.0.0-alpha+001.sha.5114f85

git short SHA

slide-28
SLIDE 28

@meekrosoft

Examples

myapplication-1.0.0-SNAPSHOT+001.sha. 5114f85

SNAPSHOT

slide-29
SLIDE 29

@meekrosoft

slide-30
SLIDE 30

@meekrosoft

slide-31
SLIDE 31

@meekrosoft

Build

slide-32
SLIDE 32

@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.

slide-33
SLIDE 33

@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?

slide-34
SLIDE 34

@meekrosoft

slide-35
SLIDE 35

@meekrosoft

slide-36
SLIDE 36

@meekrosoft

slide-37
SLIDE 37

@meekrosoft

A Traceability ecosystem

slide-38
SLIDE 38

@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

slide-39
SLIDE 39

@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

slide-40
SLIDE 40

@meekrosoft

Testing

slide-41
SLIDE 41

@meekrosoft

slide-42
SLIDE 42

@meekrosoft

System Tests ✓

slide-43
SLIDE 43

@meekrosoft

System Tests

  • Control power
  • Program devices
  • Control Actuators
  • Sense results

slide-44
SLIDE 44

@meekrosoft

System Tests Component Tests

✓ ✓

slide-45
SLIDE 45

@meekrosoft

System Tests Component Tests

✓ ✓ ✓

slide-46
SLIDE 46

@meekrosoft

slide-47
SLIDE 47

@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!
slide-48
SLIDE 48

@meekrosoft

slide-49
SLIDE 49

@meekrosoft

Pro Tips

slide-50
SLIDE 50

@meekrosoft

// #ifdef MY_PROD_V1

Avoid using the preprocessor for variants

  • It makes builds slow
  • Lowers cohesion
  • Also hinders understandability
slide-51
SLIDE 51

@meekrosoft

Only build your binaries once

Efficiency - time to feedback Safety - ship what you test

slide-52
SLIDE 52

@meekrosoft

Amplify feedback loops

TDD Red Refactor Green

Learn Measure Build

Produ ct Data Ideas

Continuous Integration Continuous Delivery BDD Automated Deployment Customer Feedback

slide-53
SLIDE 53

@meekrosoft

Dev Env is competitive advantage

Attrition vs. Late follower vs. Unhappy customers vs. Recruitment First to market Raving fandom

slide-54
SLIDE 54

@meekrosoft

Summary

slide-55
SLIDE 55

@meekrosoft

https://www.flickr.com/photos/22423670@N08/14260168597

slide-56
SLIDE 56

@meekrosoft

slide-57
SLIDE 57

@meekrosoft

The researchers praised Tesla for the way the vehicle handled the bogus commands and how the car maker responded to their findings.

slide-58
SLIDE 58

@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.

slide-59
SLIDE 59

@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? ✓
slide-60
SLIDE 60

@meekrosoft

Questions?

mike@praqma.com @meekrosoft

slide-61
SLIDE 61

@meekrosoft

slide-62
SLIDE 62

@meekrosoft