SlideShare a Scribd company logo
1 of 36
Improving the
Embedded
Development
Process
Matt Fletcher, Developer
William Bereza, Co-founder
Atomic Object, LLC
{fletcher, bereza}@atomicobject.com
OSCON 2007 Room D137-138
About this presentation
   - Test-driven development of embedded systems

   - Target audience is developers

   - Audience is familiar with test-driven
        development (TDD)

Matt Fletcher and William Bereza   OSCON 2007   2
Atomic and Savant Automation
   -    Atomic Object develops custom software




   -    Savant Automation produces automated-guided vehicles
Matt Fletcher and William Bereza   OSCON 2007            3
Battery monitor board
   -    Monitors the onboard battery’s overall state of
        charge




   -    Vehicle’s main computer decides when to charge or
        get back to work
Matt Fletcher and William Bereza   OSCON 2007             4
Feature development


                    Choose a new feature



Matt Fletcher and William Bereza   OSCON 2007   5
Feature development


           Develop a system test for it



Matt Fletcher and William Bereza   OSCON 2007   6
Feature development


                   See the system test fail



Matt Fletcher and William Bereza   OSCON 2007   7
Feature development


      Create unit tests for a module



Matt Fletcher and William Bereza   OSCON 2007   8
Feature development


                       See the unit tests fail



Matt Fletcher and William Bereza   OSCON 2007    9
Feature development


                       Make the tests pass



Matt Fletcher and William Bereza   OSCON 2007   10
Feature development


           Develop modules as needed



Matt Fletcher and William Bereza   OSCON 2007   11
Feature development


                       See system test pass



Matt Fletcher and William Bereza   OSCON 2007   12
Feature development


              Choose the next feature...



Matt Fletcher and William Bereza   OSCON 2007   13
Example system tests
   - Battery level output based on input voltages

   - Battery level mode vs. diagnostic data mode

   - Calibration commands adjust battery level values


Matt Fletcher and William Bereza   OSCON 2007      14
Matt Fletcher and William Bereza   OSCON 2007   15
Battery voltage test
  proves quot;the battery voltage reported via
          CAN is correct.quot;

  set_battery_voltage 51.0
  verify_can_reports_battery_voltage 51.0

  set_battery_voltage 2.0
  verify_can_reports_battery_voltage 2.0



Matt Fletcher and William Bereza   OSCON 2007   16
Under the covers
 set_battery_voltage 51.0
 verify_can_reports_battery_voltage 51.0




def set_battery_voltage(voltage)
  @minilab.write_analog(VOLTAGE_OUTPUT_PIN,
                        voltage / BATTERY_VOLTAGE_DIVIDER)
  sleep 0.1
end

 Matt Fletcher and William Bereza   OSCON 2007   17
Under the covers
set_battery_voltage 51.0
verify_can_reports_battery_voltage 51.0




def verify_can_reports_battery_voltage(voltage)
  last_message = @pcan.receive_message
  assert_in_delta(voltage / CAN_VOLTAGE_BIT_WEIGHT,
                   last_message.BatteryVoltage,
                   CAN_VOLTAGE_DELTA)
end

Matt Fletcher and William Bereza   OSCON 2007   18
Keys to system testing
   - Test automation

   - Choosing support hardware with command line
        and programmatic interfaces


   - Diligence. System test-first!
Matt Fletcher and William Bereza   OSCON 2007   19
Develop code unit test-first
   - Interaction-based testing
   - Modules are composed with delegates
   - Tests compose the target module with mocks
   - Composition is done at link time



Matt Fletcher and William Bereza   OSCON 2007   20
Rake
   - Ruby make
   - Automates building units and executables
   - Easy injection of Ruby scripts into the build
        system




Matt Fletcher and William Bereza   OSCON 2007        21
Argent
   - Ruby inline code generation
   - Finds and sets up tests
   - Invoked against files by the build system




Matt Fletcher and William Bereza   OSCON 2007   22
Generated mocks
   - Mocks created automatically
    - Ruby script scans header file
    - Creates mock header and source




Matt Fletcher and William Bereza   OSCON 2007   23
Generated mocks
   - Regular expression used to parse functions
  FUNC_MAGIC =/(w*s+)*(w+)s+(w+)s*(([^)]*))/


   - Naming conventions dictate how to declare
        functions and how to call mock functions




Matt Fletcher and William Bereza   OSCON 2007      24
Code to be mocked
MessageCreator.h
CANMessage MessageCreator_GetNextMessage(void)



MessageSender.h
void MessageSender_SendMessage(CANMessage message)



StatusOutputter.c
Needs to send the latest messages!

Matt Fletcher and William Bereza   OSCON 2007   25
Mock with return
MessageCreator.h
CANMessage MessageCreator_GetNextMessage(void)




MockMessageCreator.h
CANMessage MessageCreator_GetNextMessage(void)
void MessageCreator_GetNextMessage_Return(CANMessage toReturn)



Matt Fletcher and William Bereza   OSCON 2007      26
Mock expecting a value
MessageSender.h
void MessageSender_SendMessage(CANMessage message)




MockMessageSender.h
void MessageSender_SendMessage(CANMessage message)
void MessageSender_SendMessage_Expect(CANMessage message)



Matt Fletcher and William Bereza   OSCON 2007    27
The test!
 static void testShouldSendTheNewestMessage(void)
 {
   CANMessage someMessage = {0x0b, 0x0e, 0x0e, 0x0f};
   MessageCreator_GetNextMessage_Return(someMessage);
   MessageSender_SendMessage_Expect(someMessage);

     StatusOutputter_SendNewestMessage();
 }

   Mocks are automatically verified during tearDown


Matt Fletcher and William Bereza   OSCON 2007        28
The code!
void StatusOutputter_SendNewestMessage(void)
{
  CANMessage newestMessage;
  newestMessage = MessageCreator_GetNextMessage();
  MessageSender_SendMessage(newestMessage);
}




Matt Fletcher and William Bereza   OSCON 2007   29
Continuous integration
   - Automatically builds the system and runs tests on
        check-in




   - Build status is published to monitors throughout
        the office

Matt Fletcher and William Bereza   OSCON 2007   30
Summary
   - Automated system testing
   - Automated unit testing
   - Automated build system
   - Continuous integration
   - Ruby scripts and extensions played a key role!

Matt Fletcher and William Bereza   OSCON 2007   31
Embedded development - fun


    Imagine frustated engineer vs. a productive pair




Matt Fletcher and William Bereza   OSCON 2007   32
Build your own tools
   - Solve specific problems with custom tools

   - Automate tedious processes

   - Generate repetitive code

Matt Fletcher and William Bereza   OSCON 2007   33
Resources
   -   Rake
       - rake.rubyforge.org

   -   Argent
       - rubyforge.org/project/argent

   -   Minilab Ruby gem
       - minilab.rubyforge.org
Matt Fletcher and William Bereza   OSCON 2007   34
Resources
   -   Atomic Object embedded
       - www.atomicobject.com/pages/Embedded+Software
       - papers
       - Embedded System Conference 2007 demo project

   -   Agile Embedded Yahoo! group:
       - tech.groups.yahoo.com/group/AgileEmbedded

Matt Fletcher and William Bereza   OSCON 2007    35
Questions?



Matt Fletcher and William Bereza     OSCON 2007   36

More Related Content

Similar to Os Fletcher Bereza

Simple tools to fight bigger quality battle
Simple tools to fight bigger quality battleSimple tools to fight bigger quality battle
Simple tools to fight bigger quality battleAnand Ramdeo
 
Clean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software CraftsmanshipClean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software CraftsmanshipIvan Paulovich
 
PostMan and Jenkins RestApi Automation.pptx
PostMan and Jenkins RestApi Automation.pptxPostMan and Jenkins RestApi Automation.pptx
PostMan and Jenkins RestApi Automation.pptxEveryThing68
 
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...Vincenzo Ferme
 
Background And An Architecture Example
Background And An Architecture ExampleBackground And An Architecture Example
Background And An Architecture ExampleGlen Wilson
 
Mining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are NecessaryMining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are NecessaryShane McIntosh
 
Introduction to Apache Cassandra™ + What’s New in 4.0
Introduction to Apache Cassandra™ + What’s New in 4.0Introduction to Apache Cassandra™ + What’s New in 4.0
Introduction to Apache Cassandra™ + What’s New in 4.0DataStax
 
Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)
Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)
Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)Is Antipov
 
Advanced WebLogic Monitoring: JMX and WLSDM Automation
Advanced WebLogic Monitoring: JMX and WLSDM AutomationAdvanced WebLogic Monitoring: JMX and WLSDM Automation
Advanced WebLogic Monitoring: JMX and WLSDM AutomationM. Fevzi Korkutata
 
Chef arista devops days a'dam 2015
Chef arista devops days a'dam 2015Chef arista devops days a'dam 2015
Chef arista devops days a'dam 2015Edwin Beekman
 
Basic Cmake for Qt Users
Basic Cmake for Qt UsersBasic Cmake for Qt Users
Basic Cmake for Qt UsersICS
 
Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3David Pasek
 
Database automated build and test - SQL In The City Cambridge
Database automated build and test - SQL In The City CambridgeDatabase automated build and test - SQL In The City Cambridge
Database automated build and test - SQL In The City CambridgeRed Gate Software
 
Python SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite DatabasePython SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite DatabaseElangovanTechNotesET
 
The Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET EcosystemThe Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET EcosystemJames Avery
 
Arquillian Constellation
Arquillian ConstellationArquillian Constellation
Arquillian ConstellationAlex Soto
 
Testing the frontend
Testing the frontendTesting the frontend
Testing the frontendHeiko Hardt
 
Extending LabVIEW to the Web Using the LabSocket System
Extending LabVIEW to the Web Using the LabSocket SystemExtending LabVIEW to the Web Using the LabSocket System
Extending LabVIEW to the Web Using the LabSocket SystemBergmans Mechatronics LLC
 
Traceability for Verification and Validation in Autonomous Driving
Traceability for Verification and Validation in Autonomous DrivingTraceability for Verification and Validation in Autonomous Driving
Traceability for Verification and Validation in Autonomous DrivingSteven Vettermann
 
Kubernetes and the 12 factor cloud apps
Kubernetes and the 12 factor cloud appsKubernetes and the 12 factor cloud apps
Kubernetes and the 12 factor cloud appsAna-Maria Mihalceanu
 

Similar to Os Fletcher Bereza (20)

Simple tools to fight bigger quality battle
Simple tools to fight bigger quality battleSimple tools to fight bigger quality battle
Simple tools to fight bigger quality battle
 
Clean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software CraftsmanshipClean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software Craftsmanship
 
PostMan and Jenkins RestApi Automation.pptx
PostMan and Jenkins RestApi Automation.pptxPostMan and Jenkins RestApi Automation.pptx
PostMan and Jenkins RestApi Automation.pptx
 
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
BenchFlow: A Platform for End-to-end Automation of Performance Testing and An...
 
Background And An Architecture Example
Background And An Architecture ExampleBackground And An Architecture Example
Background And An Architecture Example
 
Mining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are NecessaryMining Co-Change Information to Understand when Build Changes are Necessary
Mining Co-Change Information to Understand when Build Changes are Necessary
 
Introduction to Apache Cassandra™ + What’s New in 4.0
Introduction to Apache Cassandra™ + What’s New in 4.0Introduction to Apache Cassandra™ + What’s New in 4.0
Introduction to Apache Cassandra™ + What’s New in 4.0
 
Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)
Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)
Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)
 
Advanced WebLogic Monitoring: JMX and WLSDM Automation
Advanced WebLogic Monitoring: JMX and WLSDM AutomationAdvanced WebLogic Monitoring: JMX and WLSDM Automation
Advanced WebLogic Monitoring: JMX and WLSDM Automation
 
Chef arista devops days a'dam 2015
Chef arista devops days a'dam 2015Chef arista devops days a'dam 2015
Chef arista devops days a'dam 2015
 
Basic Cmake for Qt Users
Basic Cmake for Qt UsersBasic Cmake for Qt Users
Basic Cmake for Qt Users
 
Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3Spectre meltdown performance_tests - v0.3
Spectre meltdown performance_tests - v0.3
 
Database automated build and test - SQL In The City Cambridge
Database automated build and test - SQL In The City CambridgeDatabase automated build and test - SQL In The City Cambridge
Database automated build and test - SQL In The City Cambridge
 
Python SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite DatabasePython SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite Database
 
The Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET EcosystemThe Emergence of Choice in the .NET Ecosystem
The Emergence of Choice in the .NET Ecosystem
 
Arquillian Constellation
Arquillian ConstellationArquillian Constellation
Arquillian Constellation
 
Testing the frontend
Testing the frontendTesting the frontend
Testing the frontend
 
Extending LabVIEW to the Web Using the LabSocket System
Extending LabVIEW to the Web Using the LabSocket SystemExtending LabVIEW to the Web Using the LabSocket System
Extending LabVIEW to the Web Using the LabSocket System
 
Traceability for Verification and Validation in Autonomous Driving
Traceability for Verification and Validation in Autonomous DrivingTraceability for Verification and Validation in Autonomous Driving
Traceability for Verification and Validation in Autonomous Driving
 
Kubernetes and the 12 factor cloud apps
Kubernetes and the 12 factor cloud appsKubernetes and the 12 factor cloud apps
Kubernetes and the 12 factor cloud apps
 

More from oscon2007

J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Touroscon2007
 
Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5oscon2007
 
Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifmoscon2007
 
Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Moleoscon2007
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashearsoscon2007
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swposcon2007
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Mythsoscon2007
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholisticoscon2007
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillipsoscon2007
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdatedoscon2007
 

More from oscon2007 (20)

J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 
Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5
 
Os Borger
Os BorgerOs Borger
Os Borger
 
Os Harkins
Os HarkinsOs Harkins
Os Harkins
 
Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifm
 
Os Bunce
Os BunceOs Bunce
Os Bunce
 
Yuicss R7
Yuicss R7Yuicss R7
Yuicss R7
 
Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Mole
 
Os Fogel
Os FogelOs Fogel
Os Fogel
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashears
 
Os Tucker
Os TuckerOs Tucker
Os Tucker
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swp
 
Os Furlong
Os FurlongOs Furlong
Os Furlong
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Myths
 
Os Kimsal
Os KimsalOs Kimsal
Os Kimsal
 
Os Pruett
Os PruettOs Pruett
Os Pruett
 
Os Alrubaie
Os AlrubaieOs Alrubaie
Os Alrubaie
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholistic
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillips
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdated
 

Recently uploaded

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Os Fletcher Bereza

  • 1. Improving the Embedded Development Process Matt Fletcher, Developer William Bereza, Co-founder Atomic Object, LLC {fletcher, bereza}@atomicobject.com OSCON 2007 Room D137-138
  • 2. About this presentation - Test-driven development of embedded systems - Target audience is developers - Audience is familiar with test-driven development (TDD) Matt Fletcher and William Bereza OSCON 2007 2
  • 3. Atomic and Savant Automation - Atomic Object develops custom software - Savant Automation produces automated-guided vehicles Matt Fletcher and William Bereza OSCON 2007 3
  • 4. Battery monitor board - Monitors the onboard battery’s overall state of charge - Vehicle’s main computer decides when to charge or get back to work Matt Fletcher and William Bereza OSCON 2007 4
  • 5. Feature development Choose a new feature Matt Fletcher and William Bereza OSCON 2007 5
  • 6. Feature development Develop a system test for it Matt Fletcher and William Bereza OSCON 2007 6
  • 7. Feature development See the system test fail Matt Fletcher and William Bereza OSCON 2007 7
  • 8. Feature development Create unit tests for a module Matt Fletcher and William Bereza OSCON 2007 8
  • 9. Feature development See the unit tests fail Matt Fletcher and William Bereza OSCON 2007 9
  • 10. Feature development Make the tests pass Matt Fletcher and William Bereza OSCON 2007 10
  • 11. Feature development Develop modules as needed Matt Fletcher and William Bereza OSCON 2007 11
  • 12. Feature development See system test pass Matt Fletcher and William Bereza OSCON 2007 12
  • 13. Feature development Choose the next feature... Matt Fletcher and William Bereza OSCON 2007 13
  • 14. Example system tests - Battery level output based on input voltages - Battery level mode vs. diagnostic data mode - Calibration commands adjust battery level values Matt Fletcher and William Bereza OSCON 2007 14
  • 15. Matt Fletcher and William Bereza OSCON 2007 15
  • 16. Battery voltage test proves quot;the battery voltage reported via CAN is correct.quot; set_battery_voltage 51.0 verify_can_reports_battery_voltage 51.0 set_battery_voltage 2.0 verify_can_reports_battery_voltage 2.0 Matt Fletcher and William Bereza OSCON 2007 16
  • 17. Under the covers set_battery_voltage 51.0 verify_can_reports_battery_voltage 51.0 def set_battery_voltage(voltage) @minilab.write_analog(VOLTAGE_OUTPUT_PIN, voltage / BATTERY_VOLTAGE_DIVIDER) sleep 0.1 end Matt Fletcher and William Bereza OSCON 2007 17
  • 18. Under the covers set_battery_voltage 51.0 verify_can_reports_battery_voltage 51.0 def verify_can_reports_battery_voltage(voltage) last_message = @pcan.receive_message assert_in_delta(voltage / CAN_VOLTAGE_BIT_WEIGHT, last_message.BatteryVoltage, CAN_VOLTAGE_DELTA) end Matt Fletcher and William Bereza OSCON 2007 18
  • 19. Keys to system testing - Test automation - Choosing support hardware with command line and programmatic interfaces - Diligence. System test-first! Matt Fletcher and William Bereza OSCON 2007 19
  • 20. Develop code unit test-first - Interaction-based testing - Modules are composed with delegates - Tests compose the target module with mocks - Composition is done at link time Matt Fletcher and William Bereza OSCON 2007 20
  • 21. Rake - Ruby make - Automates building units and executables - Easy injection of Ruby scripts into the build system Matt Fletcher and William Bereza OSCON 2007 21
  • 22. Argent - Ruby inline code generation - Finds and sets up tests - Invoked against files by the build system Matt Fletcher and William Bereza OSCON 2007 22
  • 23. Generated mocks - Mocks created automatically - Ruby script scans header file - Creates mock header and source Matt Fletcher and William Bereza OSCON 2007 23
  • 24. Generated mocks - Regular expression used to parse functions FUNC_MAGIC =/(w*s+)*(w+)s+(w+)s*(([^)]*))/ - Naming conventions dictate how to declare functions and how to call mock functions Matt Fletcher and William Bereza OSCON 2007 24
  • 25. Code to be mocked MessageCreator.h CANMessage MessageCreator_GetNextMessage(void) MessageSender.h void MessageSender_SendMessage(CANMessage message) StatusOutputter.c Needs to send the latest messages! Matt Fletcher and William Bereza OSCON 2007 25
  • 26. Mock with return MessageCreator.h CANMessage MessageCreator_GetNextMessage(void) MockMessageCreator.h CANMessage MessageCreator_GetNextMessage(void) void MessageCreator_GetNextMessage_Return(CANMessage toReturn) Matt Fletcher and William Bereza OSCON 2007 26
  • 27. Mock expecting a value MessageSender.h void MessageSender_SendMessage(CANMessage message) MockMessageSender.h void MessageSender_SendMessage(CANMessage message) void MessageSender_SendMessage_Expect(CANMessage message) Matt Fletcher and William Bereza OSCON 2007 27
  • 28. The test! static void testShouldSendTheNewestMessage(void) { CANMessage someMessage = {0x0b, 0x0e, 0x0e, 0x0f}; MessageCreator_GetNextMessage_Return(someMessage); MessageSender_SendMessage_Expect(someMessage); StatusOutputter_SendNewestMessage(); } Mocks are automatically verified during tearDown Matt Fletcher and William Bereza OSCON 2007 28
  • 29. The code! void StatusOutputter_SendNewestMessage(void) { CANMessage newestMessage; newestMessage = MessageCreator_GetNextMessage(); MessageSender_SendMessage(newestMessage); } Matt Fletcher and William Bereza OSCON 2007 29
  • 30. Continuous integration - Automatically builds the system and runs tests on check-in - Build status is published to monitors throughout the office Matt Fletcher and William Bereza OSCON 2007 30
  • 31. Summary - Automated system testing - Automated unit testing - Automated build system - Continuous integration - Ruby scripts and extensions played a key role! Matt Fletcher and William Bereza OSCON 2007 31
  • 32. Embedded development - fun Imagine frustated engineer vs. a productive pair Matt Fletcher and William Bereza OSCON 2007 32
  • 33. Build your own tools - Solve specific problems with custom tools - Automate tedious processes - Generate repetitive code Matt Fletcher and William Bereza OSCON 2007 33
  • 34. Resources - Rake - rake.rubyforge.org - Argent - rubyforge.org/project/argent - Minilab Ruby gem - minilab.rubyforge.org Matt Fletcher and William Bereza OSCON 2007 34
  • 35. Resources - Atomic Object embedded - www.atomicobject.com/pages/Embedded+Software - papers - Embedded System Conference 2007 demo project - Agile Embedded Yahoo! group: - tech.groups.yahoo.com/group/AgileEmbedded Matt Fletcher and William Bereza OSCON 2007 35
  • 36. Questions? Matt Fletcher and William Bereza OSCON 2007 36