The next step in test automation: computer-generated tests



Similar documents
Modelling with R and MySQL. - Manual - Gesine Bökenkamp, Frauke Wiese, Clemens Wingenbach

UBUNTU VIRTUAL MACHINE + CAFFE MACHINE LEARNING LIBRARY SETUP TUTORIAL

Making Model-Based Testing More Agile: a Use Case Driven Approach

Downloading and Installing Core FTP

Industrial Adoption of Automatically Extracted GUI Models for Testing

QEMU-KVM + D-System Monitor Setup Manual

Basic Data Mining NOTES. Getting Started- (make sure you are logged in to the web version of Skyward)

Notepad++ The COMPSCI 101 Text Editor for Windows. What is a text editor? Install Python 3

USB HSPA Modem. User Manual

Instructions for downloading and installing the GPS Map update

How To Backup On Ubuntu (Amd64) With Back In Time (Amd) On Windows Xp) On A Windows Xp (Amd32) On Ubunus On A Ubuntu

Planar ContentSmart 2.4 Software User Manual

BASIC PC MAINTENANCE AND BACKUP Lesson 1

Panopto Recording. Click the Panopto Recorder icon found on the Desktop. Click the Log in with Blackboard button. Page 1

Code::Blocks Student Manual

OpenStax-CNX module: m Quadratic Sequences 1; 2; 4; 7; 11;... (1)

Creating Online Surveys with Qualtrics Survey Tool

Standard Glossary of Terms Used in Software Testing. Version 3.01

Tizen Compliance Test (TCT) Hojun Jaygarl (Samsung Electronics), Cathy Shen (Intel)

T-BOX MY MEDIA WINDOWS 7 QUICK START GUIDE

Application Modelling

Managing large sound databases using Mpeg7

Verizon Cloud Desktop Application Help Guide Version

LMS 365 Learning Module Builder Add-in User Guide VERSION X

AzMERIT Secure Browser Installation Manual For Technology Coordinators

Model-Based Spotify. Kristian Karl

Legal Notes. Regarding Trademarks. Model supported by the KX printer driver KYOCERA MITA Corporation

AuthentiMax Software for GloMax -Multi+

1 The Installation of GPGPUsim

SKYWARD. Data Mining. Quick Reference Guide

Linux Development Environment Description Based on VirtualBox Structure

Title: Appium Automation for Mac OS X. Created By: Prithivirajan M. Abstract. Introduction

Industrial Adoption of Automatically Extracted GUI Models for Testing

Yocto Project Eclipse plug-in and Developer Tools Hands-on Lab

How To Run A Password Manager On A 32 Bit Computer (For 64 Bit) On A 64 Bit Computer With A Password Logger (For 32 Bit) (For Linux) ( For 64 Bit (Foramd64) (Amd64 (For Pc

Creating Stop Motion Animation in Corel VideoStudio Pro

BIOS Update SOP. Updating BIOS under Windows Mode for Intel Series (PXX/ZXX/X79)... 2

PARALLELS SERVER 4 BARE METAL README

DropSend Getting Started Guide

Model based testing tools. Olli Pekka Puolitaival

Python for Series 60 Platform

CISE Research Infrastructure: Mid-Scale Infrastructure - NSFCloud (CRI: NSFCloud)

Automating with IBM SPSS

Control Loop Performance Monitor

Introduction to Mirametrix EyeTracker

Best Practice Manual Testing of E2E processes using SAP Solution Manager Test Option 1. Marcus Wefers, ALM Solution Management, AGS, SAP AG

Camtasia Studio. Creating Screen Videos

GETTING STARTED QUICK GUIDE

GUARD1 PLUS SE Administrator's Manual

Be sure to connect the USB cable from TonePort into your computer s USB port, and then proceed with the following steps

Content Management System User Guide

Introduction to Python

Tutorial for Installing Skype 5.0 on your Windows PC

Mass Deploying Bomgar Software to Macs

Generating Automated Test Scripts for AltioLive using QF Test

Microsoft SQL Server 2005 How to Create and Restore Database (GRANTH3) Manually

Steps for running C-program

itunes Basics Website:

Setting up a networked printer on a local PC

Develop a Hello World project in Android Studio Capture, process, store, and display an image. Other sensors on Android phones

Administering Windows-based HP Thin Clients with System Center 2012 R2 Configuration Manager SP1

Using MioNet Senvid Inc. User Manual Version 1.07

Installing Ubuntu. Obtaining files required

Manager Express Release 3.0 Software User Manual Jan 2012

Secure Browser Installation Manual

UPSMON PRO Linux --- User Manual

CLARIION PERFORMANCE MONITORING SCRIPTING GUEST HOME PDF

Manager Express Release 4.0 Software User Manual Mar 2013

Adafruit's Raspberry Pi Lesson 1. Preparing an SD Card for your Raspberry Pi

Hudson configuration manual

Hands-on Guide. FileMaker 8. Making FileMaker Pro 8 your Spreadsheet Companion. Making FileMaker Pro 8 your Spreadsheet Companion

Distributed Version Control with Mercurial and git

1. First login to your RSJoomla! account 2. Head to Resources >> Customer Downloads >> RSMail! membership >> Downloads

Introduction to Automated Testing

Building, testing and deploying mobile apps with Jenkins & friends

DiskPulse DISK CHANGE MONITOR

F-Secure Online Backup Quick Installation Guide

Echo360 Personal Capture

TEST AUTOMATION FRAMEWORK

SingTel PowerON Desktop Backup

TortoiseGIT / GIT Tutorial: Hosting a dedicated server with auto commit periodically on Windows 7 and Windows 8

INTERCALL ONLINE. Customer Portal Manage Account User Guide. View/Edit Owner Profile

Fireworks 3 Animation and Rollovers

DSP Laboratory: Analog to Digital and Digital to Analog Conversion

How to make your system mobile with Paragon Drive Copy 10 and Microsoft Windows Virtual PC

Automated Testing Tool

AlienVault Unified Security Management (USM) 4.x-5.x. Deploying HIDS Agents to Linux Hosts

Desktop, Web and Mobile Testing Tutorials

To set up your Android with Good for Enterprise:

IPMI Firmware Update (AMI) In WEB-GUI/DOS/WIN/Linux

Celestron Handheld Digital Microscope (HDM) Model # Information, Specifications, and Instructions

Blackboard Collaborate Introduction & Handbook

Introduction to the. Programming Language

Transcription:

The next step in test automation: computer-generated tests Antti Kervinen Intel antti.kervinen@intel.com Guest lecture for Software Testing and Quality Assurance Tampere University of Technology, Finland Oct 7 th 2013 Antti Kervinen (Intel) The next step in test automation: computer-generated tests 1 / 32

Welcome to the next level in test automation Typical testing limitations Scripts test the same paths over and over again. Nobody tests most of the paths a user can take. Huge test suites require lots of maintenance. How model-based testing improves the situation: Computer generates tests. In practice, it can cover any number of dierent paths. Tests are generated from relatively small number of models. Remarkably smaller maintenance eort. Antti Kervinen (Intel) The next step in test automation: computer-generated tests 2 / 32

Welcome to the next level in test automation This presentation will give you: basic knowledge on model-based testing. basic knowledge to try out the fmbt tool. Antti Kervinen (Intel) The next step in test automation: computer-generated tests 3 / 32

Contents Part I Introduction to model-based testing (MBT) How MBT diers from test cases and test scripts? What are benets of MBT? When MBT is a good choice? Part II Handson: test generation from scratch Test generation and execution explained MPlayer example Antti Kervinen (Intel) The next step in test automation: computer-generated tests 4 / 32

Dierence between model-based and test case based testing Traditionally test steps are executed in xed order: 1. Instantiate Camera preview. 2. Capture image. 3. Start video capturing. 4. Stop video capturing. This does not depend on the target of the test: unit, integration, system test..., or the purpose of the test: smoke, regression, reliability, performance test... Now, let's see how model-based testing diers from this. Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 5 / 32

Dierence between model-based and test case based testing There are no predened test cases in model-based testing. They are generated automatically. This is possible when you have two things: Library of test steps... preview captureimage startvideocapt stopvideocapt and conditions when they're enabled always if not capturing if not capturing always From these a model-based testing tool can automatically generate many dierent tests. For instance,... Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 6 / 32

Dierence between model-based and test case based testing A reliability test: stopvideocapt captureimage stopvideocapt startvideocapt stopvideocapt preview stopvideocapt startvideocapt preview... A smoke test: startvideocapt stopvideocapt captureimage preview Test generation parameters dene what kind of test is wanted. This will be demonstrated in the next part of the presentation. Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 7 / 32

Dierence between model-based and test case based testing Now you have learned: Part I Introduction to model-based testing (MBT) How MBT diers from test cases and test scripts? What are benets of MBT? When MBT is a good choice? Part II Handson: test generation from scratch Test generation and execution explained MPlayer example Let's nd out some benets next. Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 8 / 32

Benets of model-based testing Benets of model-based testing: 1 Increased test coverage. 2 Easier test case maintenance. First, an example of increased coverage... Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 9 / 32

Benets of model-based testing A reliability test: stopvideocapt captureimage stopvideocapt startvideocapt stopvideocapt preview stopvideocapt startvideocapt preview... Consider the reliability test on the left. If you needed to test these functions, would you have created test cases for stopping video capturing without starting it rst? testing video capturing before and after using preview? creating a preview during video capturing? Most often people do not think of all these cases. Now they were covered automatically. Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 10 / 32

Benets of model-based testing Benets of model-based testing: 1 Increased test coverage. 2 Easier test case maintenance. Next, two questions for audience on maintenance... Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 11 / 32

Benets of model-based testing Question 1 (new feature): You are asked to test that preview, captureimage and video capturing work in portrait, landscape and auto orientation modes. How would you handle this, when you have...... a dozen test cases for testing them and some of their interactions?... library of test steps and conditions? preview captureimage startvideocapt stopvideocapt nextorientationmode always if not capturing if not capturing always always What else these steps can test? Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 12 / 32

Benets of model-based testing Question 2 (disabling tests). Due to changes on a platform, the preview feature will be broken on next week's builds. You are asked to keep testing video and image capturing, and orientations. How would you handle this, when you have...... a dozen test cases for testing preview, captureimage and video capturing plus the orientation testing modications?... library of test steps and conditions? preview captureimage startvideocapt stopvideocapt nextorientationmode always never if not capturing if not capturing always always Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 13 / 32

Benets of model-based testing Benets of model-based testing: 1 Increased test coverage. 2 Easier test case maintenance. We have demonstrated the second benet. As all test cases are generated, making changes even big ones is easy compared to xing a large number of predened test cases. Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 14 / 32

Benets of model-based testing Now you have learned: Part I Introduction to model-based testing (MBT) How MBT diers from test cases and test scripts? What are benets of MBT? When MBT is a good choice? Part II Handson: test generation from scratch Test generation and execution explained MPlayer example Finally, let's see where model-based testing is a good choice and where not. Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 15 / 32

Where model-based testing is a good choice Model-based testing generates tests for you. Anything that can be tested with automated test cases, can be tested using model-based testing, too. More important than where model-based testing can be applied is: Where model-based testing gives greatest benets? Let's see how to recognize these cases... Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 16 / 32

Where model-based testing is a good choice Model-based testing is benecial, if things need to be tested in many situations / congurations Does a call come through? How about when playing music? Watching videos? Capturing a video? Transferring a le using 3G, Wi, Bluetooth and USB? And the same for a Skype call? Just write a test step for each activity, and you will get the tests. Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 17 / 32

Now you can generate tests where the device is used in very interesting ways. If wanted, tools can generate and run a single test for hours or days and keep varying dierent activity combinations all the time. Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 18 / 32 Where model-based testing is a good choice Model-based testing is benecial, if things need to be tested in many situations / congurations you need long tests with lots of variation Take the previous test steps and make the preconditions liberal: music is played during le transfer, video capturing is started during music is played, etc. And calls are received in dierent combinations of activity.

Where model-based testing is a good choice Model-based testing is benecial, if things need to be tested in many situations / congurations you need long tests with lots of variation many combinations or interleavings to be tested Test a service with n concurrent users. Is there an interleaving of user actions that renders the system unresponsive for any of the users? Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 19 / 32

Where model-based testing is a good choice Model-based testing is benecial, if things need to be tested in many situations / congurations you need long tests with lots of variation many combinations or interleavings to be tested you do monkey testing, fuzzing,... Some model-based testing tools (like fmbt) allow inspecting the state of the system under test in preconditions of test steps. This enables, for instance, generating tests that look which buttons are on the display, choose a test step that clicks one of them, and then look again what could be the next test step. A sophisticated test generator allows testing dierent combinations more ecently than a pure random monkey. Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 20 / 32

Where model-based testing is a good choice The other way around, model-based testing is not benecial, if... the system under test is stateless, and there are no dierent combinations (such as parameter values or environment congurations) that should be tested. For a stateless systems it's enough to test every input only once. The order in which test steps are executed and inputs sent does not matter. There is no reason to use model-based testing tools for generating many test step sequences in this case. Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 21 / 32

Summary on Part I Now you have learned: Part I Introduction to model-based testing (MBT) How MBT diers from test cases and test scripts? What are benets of MBT? When MBT is a good choice? Part II Handson: test generation from scratch Test generation and execution explained MPlayer example Next we'll take a look at the fmbt tool. Antti Kervinen (Intel) The next step in test automation / Part I: Model-based testing 22 / 32

Handson: test generation from scratch In this part of the presentation: Test generation and execution explained MPlayer example Antti Kervinen (Intel) The next step in test automation / Part II: Hands-on with fmbt 23 / 32

Test generation and execution explained start choose an enabled input suggested action fmbt test generation and execution: 1 Load test conguration, most importantly model, adapter and end conditions. execute the action on SUT reported action ok by test model? no verdict: fail yes update test model no end conditions? yes verdict: pass/fail/inconc Antti Kervinen (Intel) The next step in test automation / Part II: Hands-on with fmbt 24 / 32

Test generation and execution explained start choose an enabled input execute the action on SUT suggested action reported action fmbt test generation and execution: 1 Load test conguration, most importantly model, adapter and end conditions. 2 Loop... choose one of possible test steps ok by test model? no verdict: fail yes update test model no end conditions? yes verdict: pass/fail/inconc Antti Kervinen (Intel) The next step in test automation / Part II: Hands-on with fmbt 25 / 32

Test generation and execution explained start choose an enabled input execute the action on SUT suggested action reported action fmbt test generation and execution: 1 Load test conguration, most importantly model, adapter and end conditions. 2 Loop... choose one of possible test steps try executing it in an adapter ok by test model? no verdict: fail yes update test model no end conditions? yes verdict: pass/fail/inconc Antti Kervinen (Intel) The next step in test automation / Part II: Hands-on with fmbt 26 / 32

Test generation and execution explained start choose an enabled input execute the action on SUT ok by test model? suggested action reported action yes no verdict: fail fmbt test generation and execution: 1 Load test conguration, most importantly model, adapter and end conditions. 2 Loop... choose one of possible test steps try executing it in an adapter validate executed test step reported by the adapter update test model no end conditions? yes verdict: pass/fail/inconc Antti Kervinen (Intel) The next step in test automation / Part II: Hands-on with fmbt 27 / 32

Test generation and execution explained start choose an enabled input execute the action on SUT ok by test model? suggested action reported action yes no verdict: fail fmbt test generation and execution: 1 Load test conguration, most importantly model, adapter and end conditions. 2 Loop... choose one of possible test steps try executing it in an adapter validate executed test step reported by the adapter execute the test step in test model update test model no end conditions? yes verdict: pass/fail/inconc Antti Kervinen (Intel) The next step in test automation / Part II: Hands-on with fmbt 28 / 32

Test generation and execution explained start choose an enabled input execute the action on SUT ok by test model? update test model suggested action reported action yes no verdict: fail fmbt test generation and execution: 1 Load test conguration, most importantly model, adapter and end conditions. 2 Loop... choose one of possible test steps try executing it in an adapter validate executed test step reported by the adapter execute the test step in test model 3... until any of end conditions is met. no end conditions? yes verdict: pass/fail/inconc Antti Kervinen (Intel) The next step in test automation / Part II: Hands-on with fmbt 29 / 32

Test generation and execution explained fmbt editor supports two modelling languages: GT (graph transformations) and AAL (a pre/postcondition language with adapter blocks). In this example we'll use AAL/Python, that is, AAL where the code is written in Python. AAL syntax for test step denitions: action "name of this test step" { guard() { code: return true i test step can be executed } body() { code: update variables after successful execution } adapter() { code: interact with the system under test } } Antti Kervinen (Intel) The next step in test automation / Part II: Hands-on with fmbt 30 / 32

Testing MPlayer's slave mode We will generate tests for MPlayer's (http://www.mplayerhq.hu) slave mode. In the slave mode MPlayer can be controlled in many ways via standard input. The mode enables using MPlayer as a backend behind a GUI. We will test that pause, continue, step to next / previous le, and adding les to the play list works. Antti Kervinen (Intel) The next step in test automation / Part II: Hands-on with fmbt 31 / 32

Testing MPlayer's slave mode Install git for next steps: sudo apt-get install git yum install git Install fmbt from sources: Install dependencies listed in README: https://github.com/01org/fmbt, then git clone https://github.com/01org/fmbt.git cd fmbt;./autogen.sh;./configure; make; sudo make install (Optional) Install MPlayer to run tests: apt-get install mplayer (Ubuntu, universe or multiverse) yum install mplayer (Fedora, rpmfusion) Download the MPlayer test: git clone https://github.com/askervin/fmbt-mplayertest.git cd fmbt-mplayertest Launch fmbt editor with mplayertest.aal and a test conguration: fmbt-editor mplayertest.aal smoke.conf Antti Kervinen (Intel) The next step in test automation / Part II: Hands-on with fmbt 32 / 32