Introduction to Software Testing Chapter 8.1 Building Testing Tools Instrumentation. Chapter 8 Outline



Similar documents
Software Testing. Definition: Testing is a process of executing a program with data, with the sole intention of finding errors in the program.

Introduction to Automated Testing

Formal Software Testing. Terri Grenda, CSTE IV&V Testing Solutions, LLC

Module 10. Coding and Testing. Version 2 CSE IIT, Kharagpur

Introduction to Synoptic

Standard for Software Component Testing

Software testing. Objectives

Basis Path Test Suite and Testing Process for WS-BPEL

Test case design techniques I: Whitebox testing CISS

Generating Automated Test Scripts for AltioLive using QF Test

National University of Ireland, Maynooth MAYNOOTH, CO. KILDARE, IRELAND. Testing Guidelines for Student Projects

Software Testing. Jeffrey Carver University of Alabama. April 7, 2016

Random Testing: The Best Coverage Technique - An Empirical Proof

Register File, Finite State Machines & Hardware Control Language

Introduction to Functional Verification. Niels Burkhardt

Comparing the effectiveness of automated test generation tools EVOSUITE and Tpalus

Web Applications Testing

Industrial Adoption of Automatically Extracted GUI Models for Testing

AP Computer Science Java Subset

Test Case Design Techniques

Software Testing. Quality & Testing. Software Testing

Test Design: Functional Testing

Environment Modeling for Automated Testing of Cloud Applications

Proceedings of the International MultiConference of Engineers and Computer Scientists 2013 Vol I, IMECS 2013, March 13-15, 2013, Hong Kong

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

Test case design techniques I: Whitebox testing CISS

Techniques and Tools for Rich Internet Applications Testing

Tools for Integration Testing

Using Eclipse CDT/PTP for Static Analysis

Search-based Data-flow Test Generation

Simple Solution for a Location Service. Naming vs. Locating Entities. Forwarding Pointers (2) Forwarding Pointers (1)

Unit Testing & JUnit

Load testing with. WAPT Cloud. Quick Start Guide

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Software Testing & Analysis (F22ST3): Static Analysis Techniques 2. Andrew Ireland

JustClust User Manual

Generating Test Cases With High Branch Coverage for Web Applications

CS 111 Classes I 1. Software Organization View to this point:

Automate Your BI Administration to Save Millions with Command Manager and System Manager

Software Engineering. Software Testing. Based on Software Engineering, 7 th Edition by Ian Sommerville

SOFTWARE TESTING. A Craftsmcm's Approach THIRD EDITION. Paul C. Jorgensen. Auerbach Publications. Taylor &. Francis Croup. Boca Raton New York

Help on the Embedded Software Block

Appium mobile test automation

Experimental Comparison of Concolic and Random Testing for Java Card Applets

Naming vs. Locating Entities

WebSphere Business Monitor

Load Testing with JMeter

Compiler Construction

J a v a Quiz (Unit 3, Test 0 Practice)

AUTOMATED TEST GENERATION FOR SOFTWARE COMPONENTS

Testing, Debugging, and Verification

CREDIT CARD FRAUD DETECTION SYSTEM USING GENETIC ALGORITHM

Tailored Source Code Transformations to Synthesize Computationally Diverse Program Variants. Benoit Baudry, Simon Allier, Martin Monperrus

Using Code Coverage Tools in the Linux Kernel

A binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:

Coverity White Paper. Effective Management of Static Analysis Vulnerabilities and Defects

Fuzzing in Microsoft and FuzzGuru framework

An Open Framework for Reverse Engineering Graph Data Visualization. Alexandru C. Telea Eindhoven University of Technology The Netherlands.

Software Testing. Theory and Practicalities

Vendor: Brio Software Product: Brio Performance Suite

Analog Monitoring Tool AMT 0.3b User Manual

>

Data Structures and Algorithms Written Examination

Optimizing Configuration and Application Mapping for MPSoC Architectures

NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide

Basics of VTune Performance Analyzer. Intel Software College. Objectives. VTune Performance Analyzer. Agenda

File System Management

1 White-Box Testing by Stubs and Drivers

HBase Schema Design. NoSQL Ma4ers, Cologne, April Lars George Director EMEA Services

Translating to Java. Translation. Input. Many Level Translations. read, get, input, ask, request. Requirements Design Algorithm Java Machine Language

Vendor: Crystal Decisions Product: Crystal Reports and Crystal Enterprise

Contents. System Development Models and Methods. Design Abstraction and Views. Synthesis. Control/Data-Flow Models. System Synthesis Models

UML-based Test Generation and Execution

Computer Programming I

Towards a Framework for Generating Tests to Satisfy Complex Code Coverage in Java Pathfinder

Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case.

Conditionals (with solutions)

Automatic Test Data Synthesis using UML Sequence Diagrams

JUnit Automated Software Testing Framework. Jeff Offutt. SWE 437 George Mason University Thanks in part to Aynur Abdurazik. What is JUnit?

Load Balancing and Termination Detection

Data Structures Fibonacci Heaps, Amortized Analysis

MPLS Network Design & Monitoring

TECHNICAL UNIVERSITY OF CRETE DATA STRUCTURES FILE STRUCTURES

The BSN Hardware and Software Platform: Enabling Easy Development of Body Sensor Network Applications

I would like to express my gratitude to the following people who provided me with help and support through out this project.

Introduction to Computers and Programming. Testing

Transcription:

Introduction to Software Testing Chapter 8. Building Testing Tools Instrumentation Paul Ammann & Jeff Offutt www.introsoftwaretesting.com Chapter 8 Outline. Instrumentation for Graph and Logical Expression Criteria. Building Mutation Testing Tools Introduction to Software Testing (Ch 8.), www.introsoftwaretesting.com Ammann & Offutt

Categories of Test Tools Research Private non-commercial Commercial Test management Simple coverage Metrics Code independent Moderate techniques Acceptors Mostly complete Some code-based Often special purpose Advanced techniques Generators Very powerful Often code-based Usually incomplete General purpose Introduction to Software Testing (Ch 8.), www.introsoftwaretesting.com Ammann & Offutt Types of Test Tools. Coverage analyzers (Acceptors) What coverage? (most common is node) What level? (sometimes object code). Flow graph generators. Metrics. Instrumentation support. Test execution automation Runs scripts and reports results JUnit, HttpUnit,. Capture / replay Useful for GUIs 7. Stubs and Drivers 8. Test data generators Graph path based Data flow Logic based Functional Mutation Random Only random test data generators exist Introduction to Software Testing (Ch 8.), www.introsoftwaretesting.com Ammann & Offutt

Tools Instrumentation The key technology behind many test tools is instrumentation Tools Instrumentation Coverage analysis is measured with instrumentation Instrument : One or more statements inserted into the program to monitor some aspect of the program Must not affect the behavior May affect timing Source level or object code level public int min (int A, B) int m = A; if (A > B) m = B; return (m); Mark: if body is reached Introduction to Software Testing (Ch 8.), www.introsoftwaretesting.com Ammann & Offutt

Instrumenting for Statement Coverage. Each node is given a unique id # Node # or statement #. Create an array indexed by id #s nodecover [ ]. Insert an instrument at each node nodecover [ i ] ++;. Save nodecover [ ] after each execution Must accumulate results across multiple test cases Introduction to Software Testing (Ch 8.), www.introsoftwaretesting.com Ammann & Offutt 7 Statement Coverage Example int nodecover[] = 0,0,0,0,0,0,0,0,0,0 Read (nodecover []) nodecover [] ++ nc []++ nc []++ nc []++ nc []++ nc [7]++ After running a sequence of tests, any node for which nodecover[node]==0 has not been covered. nc []++ 9 7 8 nc [9]++ nc [8]++ 0 nc [0]++ Introduction to Software Testing (Ch 8.), www.introsoftwaretesting.com Ammann & Offutt 8

Edge Coverage Instrumentation ec []++ int edgecover[] = 0,0,0,0,0,0,0,0,0,0,0,0,0 Read (edgecover []) ec []++ For each edge e, put edgecover[e]++ on the edge. ec []++ 7 8 If edgecover[e] == 0, e has not been covered. 9 0 Note that the arrays could be boolean Introduction to Software Testing (Ch 8.), www.introsoftwaretesting.com Ammann & Offutt 9 CACC Coverage Instrumentation CACC_Mark_ (A, B) if (A && B) if (C && (D E)) CACC_Mark_ (C, D, E) A && B F t T t t F t T CACCCover [ ] CACC_Mark_ (A, B) if (!A) // Don t allow short circuit if (B) CACCCover[]++; else if (A) if (B) CACCCover []++; else CACCCover[]++ Introduction to Software Testing (Ch 8.), www.introsoftwaretesting.com Ammann & Offutt 0

CACC Coverage Instrumentation () C && (D E) CC [ ] F t t T t f f t t F f t T f 7 t f F t f T 8 CACC_Mark_ (C, D, E) if (! C) if (D E) CACCCover []++; else if (! D) if (! E) CACCCover []++; else CACCCover []++; CACCCover [8]++; else // C and D if (! E) CACCCover []++; CACCCover [7]++; else CACCCover []++; Introduction to Software Testing (Ch 8.), www.introsoftwaretesting.com Ammann & Offutt All-Uses Coverage Instrumentation defcover [y] = def (y) def (x, y) defcover [x] = defcover [y] = For each track of location. variable, keep its current def use (x) use (x) usecover [, x, defcover[x]] ++ usecover [, x, defcover[x]] ++ use (y) At each use, increment a counter for the def that usecover [, y, defcover[y]] ++ reached it. Introduction to Software Testing (Ch 8.), www.introsoftwaretesting.com Ammann & Offutt

Instrumentation Summary Instrumentation can be added in multiple copies of the program Source code Java byte code (or other intermediate code) Executable Instrumentation must not change or delete functionality Only add new functionality Instrumentation may affect timing behavior Requires the program to be parsed Once parsed, inserting instruments is straightforward Most challenging part is the user interface Present reports as dumps of instrument arrays? Present tables? Program source with colored annotations? Graph of program with colored annotations? Introduction to Software Testing (Ch 8.), www.introsoftwaretesting.com Ammann & Offutt 7