SlideShare a Scribd company logo
1 of 52
Testing EmbeddedSoftware John Regehr University of Utah
“Over 15 billion ARM based chips shipped to date” [ARM web site, 2011] “The microcontroller market is forecast to reach over $16 billion worldwide in 2011” [Microcontroller Market Tracker, 2011] 2
3
Diverse! 4
Diverse! I have 6 pins and 32 bytes of RAM 5
Diverse! 6
Diverse! 7
Diverse! I am quad core @ 1.5 GHz and have a GPU  8
Usually there are multiple processors On-chip networks In-device networks Distributed systems Resource constraints are… Severe – to minimize unit cost Hard – failure if system runs out of… Time RAM – stack or heap Energy 9
Continuously interact with the world through I/O devices May be little abstraction of HW Probably using both interrupt handlers and threads Often there are fault tolerance and security requirements 10
Sensor network  -> 103–105 LOC Modern airplane -> 106–107 LOC  Hybrid vehicle -> 107–108 LOC How do we get these right? Mostly testing 11
Software on many individual processors is small Permits aggressive analysis and testing Constrained domain simplifies testing Embedded systems are (by definition) special-purpose devices 12
The “Real System Problem” Many interesting embedded codes are proprietary Necessary tools may be expensive or nonexistent Compilers, debuggers, simulators May not be able to run it in the lab Often lacks specifications and oracles 13
Consequently, academic embedded work may be… Forced to use small, contrived examples Out of tune with industry 14
Consequently, academic embedded work may be… Forced to use small, contrived examples Out of tune with industry 15 Solution:  Ubiquitous open embedded platforms
Arduino Arduino Uno: 8-bit AVR processor @ 16 MHz 2 KB RAM ~$30 Emphasis is on interfacing 16
Arduino Nice IDE + libraries + C/C++ Minimal abstraction of the embedded processor 18 new books in 2011 17
[object Object]
 Very few Arduino tool papers exist
 This is a big opportunityArduino Nice IDE + libraries + C/C++ Minimal abstraction of the embedded processor 18 new books in 2011 18
TinyOS OS and middleware support for sensor networks Sensing Collection and dissemination Localization Applications are in nesC, a C dialect 19
TinyOS “Motes” based on a variety of MCUs Cost $50 – $200 Good simulators exist There are a few books 20
TinyOS ,[object Object]
 Many open problems“Motes” based on a variety of MCUs Cost $50 – $200 Good simulators exist There are a few books 21
Android OS + middleware for smart phones / tablets ARM based hardware running Linux Much less constrained than motes and Arduino 22
Android Application code in Java Great tools Tons of books 23
Android ,[object Object]
 Most are very recent
 This is not a scary platformApplication code in Java Great tools Tons of books 24
ROS – Robot Operating System Linux-based infrastructure for programming robots Primary abstraction is graph of communicating processes Local and distributed 25
ROS – Robot Operating System ,[object Object],Linux-based infrastructure for programming robots Primary abstraction is graph of communicating processes Local and distributed 26
Plenty of other open embedded platforms exist FreeRTOS Contiki Pacemaker Challenge Etc. Embarrassment of riches Still, huge room for improvement Where’s the open automobile? 27
So, let’s test some embedded software But what are we testing for? 28
Properties / Oracles Temporal safety Deadlines Or just responsiveness Memory safety Contracts / assertions Reference implementation 29
Worst-Case Execution Time What is the upper bound on execution time for a piece of code? We care because the world has deadlines Static analysis of WCET is extremely difficult if there is… A cache Preemption An aggressive processor 30
True WCET Number of executions Execution time Conservative WCET Longest observed ET #2 Longest observed ET #1 31
32 + = printf() pthread_attr_setstacksize (&attr, &mystacksize); HANDLE WINAPI CreateThread(    LPSECURITY_ATTRIBUTES lpThreadAttributes,    SIZE_T dwStackSize,    LPTHREAD_START_ROUTINE lpStartAddress,    LPVOID lpParameter,    DWORD dwCreationFlags,    LPDWORD lpThreadId );
Stack Overflow in TinyOS 33 4 KB
Stack Overflow in TinyOS 34 main() 4 KB
Stack Overflow in TinyOS 35 main() irq 0 4 KB
Stack Overflow in TinyOS 36 main() irq 0 4 KB irq 1
Stack Overflow in TinyOS 37 main() irq 0 4 KB irq 1
Stack Overflow in TinyOS 38 Not the same thing as buffer overflow! Type safe language doesn’t solve this problem main() irq 0 4 KB irq 1
Eliminating Stack Overflow Testing is hard Need to drive code to its WC stack depth Interrupt coincidences are rare Approach: Static analysis of compiled code Can’t estimate stack depth of source 39
Estimate WC stack depth of each sequential flow, handling Indirect branches Recursion Loads into the stack pointer Compute “interrupt preemption graph” Find longest cycle in this graph 40
41 in      r24, 0x3f    ; r24 <- CPU status                         register cli                  ; disable interrupts adc     r24, r24     ; carry bit <- prev                        interrupt status eor     r24, r24     ; r24 <- 0 adc     r24, r24     ; r24 <- carry bit mov     r18, r24     ; r18 <- r24 ... critical section ... and     r18, r18     ; test r18 for zero breq    .+2          ; if zero, skip next                         instruction sei                  ; enable interrupts ret                  ; return from function
Stack analysis tool deployed in the TinyOS distribution Results are typically much larger than worst observed stack depths But, we validated its results by randomly firing interrupts 42
Need… more… oracles… 43
TinyOS applications are built using components Interface requirements documented but not checked Interface misuse often silent 44
We augmented nesC with contracts Dynamic checking reasonable efficient Found some long-standing bugs 45
nesC is not type safe Memory safety bugs in TinyOS are difficult We ported an existing safe C dialect Found some otherwise-impossible bugs Main problem was getting overhead under control Whole-program optimization 46
47 Code size 35% 13% -11%

More Related Content

What's hot

Hackito Ergo Sum 2011: Capture me if you can!
Hackito Ergo Sum 2011: Capture me if you can!Hackito Ergo Sum 2011: Capture me if you can!
Hackito Ergo Sum 2011: Capture me if you can!stricaud
 
Predicting and Abusing WPA2/802.11 Group Keys
Predicting and Abusing WPA2/802.11 Group KeysPredicting and Abusing WPA2/802.11 Group Keys
Predicting and Abusing WPA2/802.11 Group Keysvanhoefm
 
Why is it so hard to make secure chips?
Why is it so hard to make secure chips?Why is it so hard to make secure chips?
Why is it so hard to make secure chips?Riscure
 
Securing a Raspberry Pi and other DIY IoT devices
Securing a Raspberry Pi and other DIY IoT devicesSecuring a Raspberry Pi and other DIY IoT devices
Securing a Raspberry Pi and other DIY IoT devicesIan Kluft
 
Virtual Machine Introspection with Xen on ARM
Virtual Machine Introspection with Xen on ARMVirtual Machine Introspection with Xen on ARM
Virtual Machine Introspection with Xen on ARMTamas K Lengyel
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangLyon Yang
 
Secure Coding in Perl
Secure Coding in PerlSecure Coding in Perl
Secure Coding in PerlIan Kluft
 
Cloud Security with LibVMI
Cloud Security with LibVMICloud Security with LibVMI
Cloud Security with LibVMITamas K Lengyel
 
How to drive a malware analyst crazy
How to drive a malware analyst crazyHow to drive a malware analyst crazy
How to drive a malware analyst crazyMichael Boman
 

What's hot (11)

Hackito Ergo Sum 2011: Capture me if you can!
Hackito Ergo Sum 2011: Capture me if you can!Hackito Ergo Sum 2011: Capture me if you can!
Hackito Ergo Sum 2011: Capture me if you can!
 
Predicting and Abusing WPA2/802.11 Group Keys
Predicting and Abusing WPA2/802.11 Group KeysPredicting and Abusing WPA2/802.11 Group Keys
Predicting and Abusing WPA2/802.11 Group Keys
 
SnakeGX (full version)
SnakeGX (full version) SnakeGX (full version)
SnakeGX (full version)
 
SnakeGX (short version)
SnakeGX (short version)SnakeGX (short version)
SnakeGX (short version)
 
Why is it so hard to make secure chips?
Why is it so hard to make secure chips?Why is it so hard to make secure chips?
Why is it so hard to make secure chips?
 
Securing a Raspberry Pi and other DIY IoT devices
Securing a Raspberry Pi and other DIY IoT devicesSecuring a Raspberry Pi and other DIY IoT devices
Securing a Raspberry Pi and other DIY IoT devices
 
Virtual Machine Introspection with Xen on ARM
Virtual Machine Introspection with Xen on ARMVirtual Machine Introspection with Xen on ARM
Virtual Machine Introspection with Xen on ARM
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
 
Secure Coding in Perl
Secure Coding in PerlSecure Coding in Perl
Secure Coding in Perl
 
Cloud Security with LibVMI
Cloud Security with LibVMICloud Security with LibVMI
Cloud Security with LibVMI
 
How to drive a malware analyst crazy
How to drive a malware analyst crazyHow to drive a malware analyst crazy
How to drive a malware analyst crazy
 

Viewers also liked

2.01 weathering
2.01 weathering2.01 weathering
2.01 weatheringnaholmes
 
Guide to multiplying trinomials
Guide to multiplying trinomialsGuide to multiplying trinomials
Guide to multiplying trinomials40505903
 
Multi step powerpoint
Multi step powerpointMulti step powerpoint
Multi step powerpoint40505903
 
Bytecode'13 presentation
Bytecode'13 presentationBytecode'13 presentation
Bytecode'13 presentationEnrico Scapin
 
Pythagorean theorem and distance formula powerpoint1
Pythagorean theorem and distance formula powerpoint1Pythagorean theorem and distance formula powerpoint1
Pythagorean theorem and distance formula powerpoint140505903
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

Viewers also liked (9)

2.01 weathering
2.01 weathering2.01 weathering
2.01 weathering
 
Guide to multiplying trinomials
Guide to multiplying trinomialsGuide to multiplying trinomials
Guide to multiplying trinomials
 
Multi step powerpoint
Multi step powerpointMulti step powerpoint
Multi step powerpoint
 
Thesis presentation
Thesis presentationThesis presentation
Thesis presentation
 
Bytecode'13 presentation
Bytecode'13 presentationBytecode'13 presentation
Bytecode'13 presentation
 
Satyam final
Satyam finalSatyam final
Satyam final
 
Pythagorean theorem and distance formula powerpoint1
Pythagorean theorem and distance formula powerpoint1Pythagorean theorem and distance formula powerpoint1
Pythagorean theorem and distance formula powerpoint1
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Similar to Issta11

The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022lior mazor
 
The trials and tribulations of providing engineering infrastructure
 The trials and tribulations of providing engineering infrastructure  The trials and tribulations of providing engineering infrastructure
The trials and tribulations of providing engineering infrastructure TechExeter
 
OSCON: System software goes weird
OSCON: System software goes weirdOSCON: System software goes weird
OSCON: System software goes weirdDocker, Inc.
 
Affordable trustworthy-systems
Affordable trustworthy-systemsAffordable trustworthy-systems
Affordable trustworthy-systemsmicrokerneldude
 
Reverse engineering &amp; immunity debugger
Reverse engineering &amp; immunity debuggerReverse engineering &amp; immunity debugger
Reverse engineering &amp; immunity debuggermahakant sharma
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitDimitry Snezhkov
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONLyon Yang
 
Understanding and Improving Device Access Complexity
Understanding and Improving Device Access ComplexityUnderstanding and Improving Device Access Complexity
Understanding and Improving Device Access Complexityasimkadav
 
Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...Black Duck by Synopsys
 
Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...Tim Mackey
 
Embedded Os [Linux & Co.]
Embedded Os [Linux & Co.]Embedded Os [Linux & Co.]
Embedded Os [Linux & Co.]Ionela
 
MiniOS: an instructional platform for teaching operating systems labs
MiniOS: an instructional platform for teaching operating systems labsMiniOS: an instructional platform for teaching operating systems labs
MiniOS: an instructional platform for teaching operating systems labsRafael Roman Otero
 
Chapter_01_See_Program_Running.pptx
Chapter_01_See_Program_Running.pptxChapter_01_See_Program_Running.pptx
Chapter_01_See_Program_Running.pptxWaleedAbdullah2k19EE
 
Breaking paravirtualized devices
Breaking paravirtualized devicesBreaking paravirtualized devices
Breaking paravirtualized devicesPriyanka Aash
 
Monitoring ICS Communications
Monitoring ICS CommunicationsMonitoring ICS Communications
Monitoring ICS CommunicationsDigital Bond
 
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoTInria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoTStéphanie Roger
 
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar Santhosh Kumar
 
[iOS] Multiple Background Threads
[iOS] Multiple Background Threads[iOS] Multiple Background Threads
[iOS] Multiple Background ThreadsNikmesoft Ltd
 

Similar to Issta11 (20)

The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
 
The trials and tribulations of providing engineering infrastructure
 The trials and tribulations of providing engineering infrastructure  The trials and tribulations of providing engineering infrastructure
The trials and tribulations of providing engineering infrastructure
 
OSCON: System software goes weird
OSCON: System software goes weirdOSCON: System software goes weird
OSCON: System software goes weird
 
Affordable trustworthy-systems
Affordable trustworthy-systemsAffordable trustworthy-systems
Affordable trustworthy-systems
 
IOT Exploitation
IOT Exploitation	IOT Exploitation
IOT Exploitation
 
Reverse engineering &amp; immunity debugger
Reverse engineering &amp; immunity debuggerReverse engineering &amp; immunity debugger
Reverse engineering &amp; immunity debugger
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution Toolkit
 
Advanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCONAdvanced SOHO Router Exploitation XCON
Advanced SOHO Router Exploitation XCON
 
Understanding and Improving Device Access Complexity
Understanding and Improving Device Access ComplexityUnderstanding and Improving Device Access Complexity
Understanding and Improving Device Access Complexity
 
Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...
 
Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...Using hypervisor and container technology to increase datacenter security pos...
Using hypervisor and container technology to increase datacenter security pos...
 
Embedded Os [Linux & Co.]
Embedded Os [Linux & Co.]Embedded Os [Linux & Co.]
Embedded Os [Linux & Co.]
 
ES-CH1.ppt
ES-CH1.pptES-CH1.ppt
ES-CH1.ppt
 
MiniOS: an instructional platform for teaching operating systems labs
MiniOS: an instructional platform for teaching operating systems labsMiniOS: an instructional platform for teaching operating systems labs
MiniOS: an instructional platform for teaching operating systems labs
 
Chapter_01_See_Program_Running.pptx
Chapter_01_See_Program_Running.pptxChapter_01_See_Program_Running.pptx
Chapter_01_See_Program_Running.pptx
 
Breaking paravirtualized devices
Breaking paravirtualized devicesBreaking paravirtualized devices
Breaking paravirtualized devices
 
Monitoring ICS Communications
Monitoring ICS CommunicationsMonitoring ICS Communications
Monitoring ICS Communications
 
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoTInria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
Inria Tech Talk : RIOT, l'OS libre pour vos objets connectés #IoT
 
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
 
[iOS] Multiple Background Threads
[iOS] Multiple Background Threads[iOS] Multiple Background Threads
[iOS] Multiple Background Threads
 

Recently uploaded

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 

Issta11

  • 1. Testing EmbeddedSoftware John Regehr University of Utah
  • 2. “Over 15 billion ARM based chips shipped to date” [ARM web site, 2011] “The microcontroller market is forecast to reach over $16 billion worldwide in 2011” [Microcontroller Market Tracker, 2011] 2
  • 3. 3
  • 5. Diverse! I have 6 pins and 32 bytes of RAM 5
  • 8. Diverse! I am quad core @ 1.5 GHz and have a GPU 8
  • 9. Usually there are multiple processors On-chip networks In-device networks Distributed systems Resource constraints are… Severe – to minimize unit cost Hard – failure if system runs out of… Time RAM – stack or heap Energy 9
  • 10. Continuously interact with the world through I/O devices May be little abstraction of HW Probably using both interrupt handlers and threads Often there are fault tolerance and security requirements 10
  • 11. Sensor network -> 103–105 LOC Modern airplane -> 106–107 LOC Hybrid vehicle -> 107–108 LOC How do we get these right? Mostly testing 11
  • 12. Software on many individual processors is small Permits aggressive analysis and testing Constrained domain simplifies testing Embedded systems are (by definition) special-purpose devices 12
  • 13. The “Real System Problem” Many interesting embedded codes are proprietary Necessary tools may be expensive or nonexistent Compilers, debuggers, simulators May not be able to run it in the lab Often lacks specifications and oracles 13
  • 14. Consequently, academic embedded work may be… Forced to use small, contrived examples Out of tune with industry 14
  • 15. Consequently, academic embedded work may be… Forced to use small, contrived examples Out of tune with industry 15 Solution: Ubiquitous open embedded platforms
  • 16. Arduino Arduino Uno: 8-bit AVR processor @ 16 MHz 2 KB RAM ~$30 Emphasis is on interfacing 16
  • 17. Arduino Nice IDE + libraries + C/C++ Minimal abstraction of the embedded processor 18 new books in 2011 17
  • 18.
  • 19. Very few Arduino tool papers exist
  • 20. This is a big opportunityArduino Nice IDE + libraries + C/C++ Minimal abstraction of the embedded processor 18 new books in 2011 18
  • 21. TinyOS OS and middleware support for sensor networks Sensing Collection and dissemination Localization Applications are in nesC, a C dialect 19
  • 22. TinyOS “Motes” based on a variety of MCUs Cost $50 – $200 Good simulators exist There are a few books 20
  • 23.
  • 24. Many open problems“Motes” based on a variety of MCUs Cost $50 – $200 Good simulators exist There are a few books 21
  • 25. Android OS + middleware for smart phones / tablets ARM based hardware running Linux Much less constrained than motes and Arduino 22
  • 26. Android Application code in Java Great tools Tons of books 23
  • 27.
  • 28. Most are very recent
  • 29. This is not a scary platformApplication code in Java Great tools Tons of books 24
  • 30. ROS – Robot Operating System Linux-based infrastructure for programming robots Primary abstraction is graph of communicating processes Local and distributed 25
  • 31.
  • 32. Plenty of other open embedded platforms exist FreeRTOS Contiki Pacemaker Challenge Etc. Embarrassment of riches Still, huge room for improvement Where’s the open automobile? 27
  • 33. So, let’s test some embedded software But what are we testing for? 28
  • 34. Properties / Oracles Temporal safety Deadlines Or just responsiveness Memory safety Contracts / assertions Reference implementation 29
  • 35. Worst-Case Execution Time What is the upper bound on execution time for a piece of code? We care because the world has deadlines Static analysis of WCET is extremely difficult if there is… A cache Preemption An aggressive processor 30
  • 36. True WCET Number of executions Execution time Conservative WCET Longest observed ET #2 Longest observed ET #1 31
  • 37. 32 + = printf() pthread_attr_setstacksize (&attr, &mystacksize); HANDLE WINAPI CreateThread( LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId );
  • 38. Stack Overflow in TinyOS 33 4 KB
  • 39. Stack Overflow in TinyOS 34 main() 4 KB
  • 40. Stack Overflow in TinyOS 35 main() irq 0 4 KB
  • 41. Stack Overflow in TinyOS 36 main() irq 0 4 KB irq 1
  • 42. Stack Overflow in TinyOS 37 main() irq 0 4 KB irq 1
  • 43. Stack Overflow in TinyOS 38 Not the same thing as buffer overflow! Type safe language doesn’t solve this problem main() irq 0 4 KB irq 1
  • 44. Eliminating Stack Overflow Testing is hard Need to drive code to its WC stack depth Interrupt coincidences are rare Approach: Static analysis of compiled code Can’t estimate stack depth of source 39
  • 45. Estimate WC stack depth of each sequential flow, handling Indirect branches Recursion Loads into the stack pointer Compute “interrupt preemption graph” Find longest cycle in this graph 40
  • 46. 41 in r24, 0x3f ; r24 <- CPU status register cli ; disable interrupts adc r24, r24 ; carry bit <- prev interrupt status eor r24, r24 ; r24 <- 0 adc r24, r24 ; r24 <- carry bit mov r18, r24 ; r18 <- r24 ... critical section ... and r18, r18 ; test r18 for zero breq .+2 ; if zero, skip next instruction sei ; enable interrupts ret ; return from function
  • 47. Stack analysis tool deployed in the TinyOS distribution Results are typically much larger than worst observed stack depths But, we validated its results by randomly firing interrupts 42
  • 49. TinyOS applications are built using components Interface requirements documented but not checked Interface misuse often silent 44
  • 50. We augmented nesC with contracts Dynamic checking reasonable efficient Found some long-standing bugs 45
  • 51. nesC is not type safe Memory safety bugs in TinyOS are difficult We ported an existing safe C dialect Found some otherwise-impossible bugs Main problem was getting overhead under control Whole-program optimization 46
  • 52. 47 Code size 35% 13% -11%
  • 53. 48 Increasing Availability Normal TinyOS: 0% average availability Array Out-of-bounds Normal TinyOS Safe TinyOS: 95% average availability Array Out-of-bounds Rebuild Soft state Safe TinyOS Reboot
  • 54. What about application-level sensornet properties? All the interesting ones are distributed We adapted TOSSIM, a non-cycle-accurate simulator, to be… A random tester A depth-bounded model checker Oracles: Type safety checks Application-level properties 49
  • 55. Application-Level Properties Eventually… Each send buffer is unlocked No cycles in the routing tree All nodes become part of the collection tree All nodes have consistent values 6 out of 8 of these properties require global knowledge 50
  • 56. Found 12 previously unknown bugs in TinyOS 2.0 10 safety, 2 liveness Random testing outperformed depth-bounded model checking Even after a lot of work on POR But required work to shorten long error traces 51
  • 57. Conclusions Open embedded platforms exist Some have steep learning curves Finding oracles is hard Generating valid input is hard Embedded systems are fun and important and rewarding 52