How To Test Your Code

Similar documents
Virtual Hosting & Virtual Machines

Comparing Virtualization Technologies

Module I-7410 Advanced Linux FS-11 Part1: Virtualization with KVM

Date: December 2009 Version: 1.0. How Does Xen Work?

The QEMU/KVM Hypervisor

Red Hat Linux Internals

Efficient Load Balancing using VM Migration by QEMU-KVM

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

KVM: Kernel-based Virtualization Driver

Useful USB Gadgets on Linux

EXPLORING LINUX KERNEL: THE EASY WAY!

BY STEVE BROWN, CADENCE DESIGN SYSTEMS AND MICHEL GENARD, VIRTUTECH

Kernel Testing: Tool and Techniques. Matt Porter Texas Instruments 21 February 2013

KVM: A Hypervisor for All Seasons. Avi Kivity avi@qumranet.com

Virtualization and Other Tricks.

Introduction of Virtualization Technology to Multi-Process Model Checking

Mobile Application Testing

Operating Systems (Linux)

Embedded Software Development

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

Porting Plan 9 to the PowerPC Architecture. Ian Friedman Ajay Surie Adam Wolbach

Enhancing Hypervisor and Cloud Solutions Using Embedded Linux Iisko Lappalainen MontaVista

Scalar Network Analyzer

Overview. Open source toolchains. Buildroot features. Development process

Track One Building a connected home automation device with the Digi ConnectCore Wi-i.MX51 using LinuxLink

Embedded Linux Platform Developer

Yun Shield User Manual VERSION: 1.0. Yun Shield User Manual 1 / 22.

Securing Your Cloud with Xen Project s Advanced Security Features

Embedded Linux development with Buildroot training 3-day session

Highly Reliable Systems. FirstRAID DXR TM. Documentation Supplement V1.1. Copyright 2007 by Highly Reliable Systems. All Rights Reserved.

7a. System-on-chip design and prototyping platforms

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

CS312 Solutions #6. March 13, 2015

Embedded Linux development training 4 days session

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

VMware Server 2.0 Essentials. Virtualization Deployment and Management

Dual-boot Windows 10 alongside Windows 8

White Paper. Real-time Capabilities for Linux SGI REACT Real-Time for Linux

Embedded Software development Process and Tools:

The following is a summary of the key features of the ARM Injector:

Introduction to Mirametrix EyeTracker

Designing and Embodiment of Software that Creates Middle Ware for Resource Management in Embedded System

Fastboot Techniques for x86 Architectures. Marcus Bortel Field Application Engineer QNX Software Systems

DSO138 oscilloscope program upgrade method

Operating System Structures

TMA Management Suite. For EAD and TDM products. ABOUT OneAccess. Value-Adding Software Licenses TMA

Software Development Processes For Embedded Development A checklist for efficient development using open-source tools

Linux flash file systems JFFS2 vs UBIFS

Installing & Using KVM with Virtual Machine Manager COSC 495

An Introduction to Service Containers

Stress Testing Technologies for Citrix MetaFrame. Michael G. Norman, CEO December 5, 2001

Bioreactor Process Plant Powered by NI LabVIEW and NI CompactRIO

HP Thin Client Imaging Tool

Virtualization of Linux based computers: the Linux-VServer project

TESSY Automated dynamic module/unit and. CTE Classification Tree Editor. integration testing of embedded applications. for test case specifications

Testing Automation for Distributed Applications By Isabel Drost-Fromm, Software Engineer, Elastic

Copyrighted , Address :- EH1-Infotech, SCF 69, Top Floor, Phase 3B-2, Sector 60, Mohali (Chandigarh),

Application-Level Debugging and Profiling: Gaps in the Tool Ecosystem. Dr Rosemary Francis, Ellexus

Chapter 2 System Structures

Android Virtualization from Sierraware. Simply Secure

HRG Assessment: Stratus everrun Enterprise

Achieve Automated, End-to-End Firmware Management with Cisco UCS Manager

Ways to Use USB in Embedded Systems

Installation and setup of remote keyboard for monitoring system Multiscreen 5.x

Example of Standard API

SVC400P/SVC800P. 4/8 Camera Live Tracking Vehicle DVR Installation Manual. Version 1.0

BeagleBone Black: Installing Operating Systems

Part I Courses Syllabus

Installing and Configuring Windows Server Module Overview 14/05/2013. Lesson 1: Planning Windows Server 2008 Installation.

Professional Xen Visualization

Update on filesystems for flash storage

The Yocto Project Eclipse plug-in: An Effective IDE Environment for Embedded Application and System Developers

Contents III: Contents II: Contents: Rule Set Based Access Control (RSBAC) 4.2 Model Specifics 5.2 AUTH

WIND RIVER INTELLIGENT DEVICE PLATFORM XT

Testing Python. Applying Unit Testing, TDD, BDD and Acceptance Testing

Embedded Development Tools

Virtualization System Vulnerability Discovery Framework. Speaker: Qinghao Tang Title:360 Marvel Team Leader

Linux/Open Source and Cloud computing Wim Coekaerts Senior Vice President, Linux and Virtualization Engineering

Cloud Storage. Parallels. Performance Benchmark Results. White Paper.

Debugging A MotoHawk Application using the Application Monitor

Who s Endian?

KINDLE FORENSICS: ACQUISITION & ANALYSIS

Sun xvm VirtualBox Product Overview

find model parameters, to validate models, and to develop inputs for models. c 1994 Raj Jain 7.1

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

The Art of Virtualization with Free Software

ODP Application proof point: OpenFastPath. ODP mini-summit

Next Generation Now: Red Hat Enterprise Linux 6 Virtualization A Unique Cloud Approach. Jeff Ruby Channel Manager jruby@redhat.com

Survey of Filesystems for Embedded Linux. Presented by Gene Sally CELF

Developing tests for the KVM autotest framework

Certification Authorities Software Team (CAST) Position Paper CAST-26

Firebird and RAID. Choosing the right RAID configuration for Firebird. Paul Reeves IBPhoenix. mail:

APx4 Wireless System-on-Module 5/8/2013 1

Pen Drive to Pen Drive and Mobile Data Transfer Using ARM

Transcription:

Testing embedded software

Overview 1 Testing = Efficient software development 2 Testing embedded software = special 3 Open source = more testing? 2

Testing is omnipresent in the software development process Develop Integrate Validate Deploy 3

Writing tests saves time Development is modifying code Every change risks breaking the code The longer it takes to find a problem, the more costly to fix Write tests early, to save time later More difficult to add test to existing software 4

Think of the future You will modify your code Other developers will modify your code Make sure those modifications can be tested make your own tests available to others Automation Standardize on test framework Standardize on how tests are run Document your test approach 5

Focus on saving time No need to focus on coverage Smoke test for all features (Optional) built-in self-test of the complete firmware Unit test for the feature being worked on Focus on tricky parts of implementation Put support for tests into the implementation Assertions Tracing Tests must run fast So not complete! 6

Testing embedded software is special Software depends on hardware Limited access to hardware and hardware itself is limited Time is important Updates are essential 7

Embedded software is written for specific hardware Requires specific inputs and outputs Target has different architecture than PC Endianness Memory model Hardware accelerators Target has limited resources Memory Disk Speed 8

Hardware test setup Make hardware available remotely Accessible over network I/O's can be controlled remotely Power can be controlled remotely 9

Example test setup for wireless device Culprit Culprit DUT UART Controller PC 10

Simulation overcomes limited access to hardware Different levels of simulation Emulation: qemu (PowerPC, ARM, MIPS, M68K, SPARC) Virtualization: KVM, VirtualBox Stubbing/hardware abstraction PC has much more resources and performance Many more test tools on PC than on real platform Simulation of inputs is essential for reproducability Stubbing makes for the easiest testing and debugging More effort to maintain the HAL HAL isn't tested 11

In embedded software time is a factor Time is essential part of functionality Race conditions are time-dependent Test code (tracing, assertions) may affect timing 12

Testing must take into account timing Time-sensitive tests on target platform Using file input Simulate time Using profiling info to insert simulation delays (Idea of Johan Cockx, Imec) 13

Working update system is essential for embedded systems If update goes wrong, device is dead No alternative boot methods Not reachable Developer must make sure that updates never fail Power failure: corrupted software or filesystem Integrity of transfer: corrupted software Compatibility between pieces: e.g. kernel module Compatibility with hardware: e.g. wrong board support Package manager helps a lot, but no silver bullet Fallback boot should always exist 14

Testing and open source software Open source tools to support testing Unit tests Doctest D-Bus Testing of open source tools Gstreamer Linux kernel 15

Not many open source tools exist to help developer with testing opensourcetesting.org lists 36 unit test frameworks But these are not entirely useful for the developer No need to have extensive reporting Fixtures and datasets don't give so much added value Still some advantages Lowers threshold to add tests Validation team will love you 16

QtTestLib is a useful unit test framework QtTestLib offers Selective execution Fixtures Data sets Benchmarking (= top-level profiling) Mock for user input in GUI 17

Python's documentation test is perfect for developer tests Python documentation tests are in the code itself Low threshold to add test Easy to update test, it's right there Can easily run tests associated with specific function even if they call other functions Unfortunately, nothing similar exists outside python (AFAIK) 18

D-Bus is great for IPC D-Bus helps for testing It is also a great tool for testing Bindings for scripting language Create stub implementation of required methods/signals Verify method return value against expected return value Insert signals into the code to expose internals 19

Developer tests are even more important for open source There is no validation team cycles are longer Contributors don't know the code higher risk of breaking things Many contributors larger benefit from sharing tests Contributors only interested in added feature needs to be motivated to also update tests 20

Gstreamer has testing but it's not good enough All Gstreamer elements have a test required to enter gst-plugins-good Many stub elements e.g. videotestsrc However: Not trivial to run specific test May take long (e.g. videocrop) Gstreamer should: Add boilerplate to test more than just buffer I/O e.g. handling of QoS, caps, events Put the tests closer to source code, so contributors see them Split into fast individual tests 21

Linux kernel has stubs and test framework For most device types, stub implementation exists For USB gadget: dummy_hcd, zero For MTD (= flash): block2mtd Linux Test Project (LTP) offers a large test suite Mainly for filesystems and networking Mainly regression, load and performance tests Simple to select specific test Good boilerplate good base to write new test 22

Conclusions Developer should write tests from the start It saves time! Share the tests with other developers Even more important for open source projects For embedded systems, hardware abstraction / stubs are essential 23

www.mind.be www.essensium.com Essensium NV Mind - Embedded Software Division Gaston Geenslaan 9, B-3001 Leuven Tel : +32 16-28 65 00 Fax : +32 16-28 65 01 email : info@essensium.com 24

Spread the word! Feel free to use these slides elinux.org, look for ELC Europe 2010 Text at http://mind.be/?page=embedded-software-testing http://mindlinux.wordpress.com 25