Introduction to Software Testing (Paul deGrandis) [Reading assignment: Chapter 15, pp. 231-252 and notes by Paul deGrandis]

Slides:



Advertisements
Similar presentations
Java Testing Tools. junit is a testing harness for unit testing. emma is a code coverage tool. The tools can be used in concert to provide statement and.
Advertisements

Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
Module 7: Advanced Development  GEM only slides here  Started on page 38 in SC09 version Module 77-0.
MAHDI OMAR JUNIT TUTORIAL. CONTENTS Installation of Junit Eclipse support for Junit Using Junit exercise JUnit options Questions Links and Literature.
Unit Testing Testing. Plan Java jUnit (test cases) Emma (coverage) C Check (test cases) Splint (static checking)
DEV-13: You've Got a Problem, Here’s How to Find It
Static code check – Klocwork
Introduction to Java Lab CS110A – Lab Section 004 Instructor: Duo Wei.
Tutorial 0 SimpleScalar Installation CPEG-323 Intro. To Computer Engineering Tom St. John September 19, 2008.
1 The Problem o Fluid software cannot be trusted to behave as advertised unknown origin (must be assumed to be malicious) known origin (can be erroneous.
Examining the Code [Reading assignment: Chapter 6, pp ]
Continous architecture analysis in 3D. 2 Stefan Rinderle Kontinuierliche Architekturanalyse in 3D ○ Bachelor an der HS Karlsruhe ○ Master "Software Engineering"
Testing Dr. Andrew Wallace PhD BEng(hons) EurIng
CSE 403 Lecture 11 Static Code Analysis Reading: IEEE Xplore, "Using Static Analysis to Find Bugs" slides created by Marty Stepp
Test-Driven Development With Visual Studio 2005 Erno de Weerd Info Support.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
Maven & Bamboo CONTINUOUS INTEGRATION. QA in a large organization In a large organization that manages over 100 applications and over 20 developers, implementing.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
© 2012 IBM Corporation Rational Insight | Back to Basis Series Chao Zhang Unit Testing.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
Ali Shahrokni Application Components Activities Services Content providers Broadcast receivers.
JUnit in Action SECOND EDITION PETAR TAHCHIEV FELIPE LEME VINCENT MASSOL GARY GREGORY ©2011 by Manning Publications Co. All rights reserved. Slides Prepared.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
AUTOBUILD Build and Deployment Automation Solution.
Introduction to Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
Programming Tools gcc make utility Open Source code Static and Shared Libraries gdb Memory debugging tools.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
INFSO-RI JRA2: Testing senarious ETICS AH meeting Budapest, Iune 2009 Eva Takacs, Jozsef Kuti, András Milassin 4D Soft.
CPSC1301 Computer Science 1 Overview of Dr. Java.
Dr. Tom WayCSC Testing and Test-Driven Development CSC 4700 Software Engineering Based on Sommerville slides.
Introduction to Software Testing. Types of Software Testing Unit Testing Strategies – Equivalence Class Testing – Boundary Value Testing – Output Testing.
COMP 121 Week 1: Testing and Debugging. Testing Program testing can be used to show the presence of bugs, but never to show their absence! ~ Edsger Dijkstra.
Static Analysis James Walden Northern Kentucky University.
Ch 22 Verification and Validation
Unit Testing with JUnit and Clover Based on material from: Daniel Amyot JUnit Web site.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
Discussion on Testing Simantics Technical Board Meeting
1 Splint: A Static Memory Leakage tool Presented By: Krishna Balasubramanian.
Confidential Continuous Integration Framework (CIF) 5/18/2004.
DrJava A lightweight pedagogic environment for Java Eric Allen, Robert Cartwright, and Brian Stoler Rice University
EMI INFSO-RI Software Metric Definitions, Reports and Analysis in EMI Authors: Eamonn Kenny (TCD), Gianni Pucciani (CERN) Date: Tuesday 12 th April.
CISC 367 Software Tools Introduction. Software Tools What are they? What is the goal of software tools? What is an IDE and its goal?
Announcements You will receive your scores back for Assignment 2 this week. You will have an opportunity to correct your code and resubmit it for partial.
Secure Programming with Static Analysis Brian Chess, Ph.D.
CS223: Software Engineering Lecture 21: Unit Testing Metric.
16 Copyright © 2004, Oracle. All rights reserved. Testing the Migrated Oracle Database.
Findbugs Tin Bui-Huy September, Content What is bug? What is bug? What is Findbugs? What is Findbugs? How to use Findbugs? How to use Findbugs?
SOFTWARE TESTING TRAINING TOOLS SUPPORT FOR SOFTWARE TESTING Chapter 6 immaculateres 1.
Jester – The JUnit Test Tester
Unit Testing.
YAHMD - Yet Another Heap Memory Debugger
Debugging Memory Issues
Why should we test? How should we test?
Quality Control in the dCache team.
Installing and running the local check projects in Eclipse
Testing & Testing Tools
slides borrowed and adapted from Alex Mariakis and CSE 390a
CodePeer Update Arnaud Charlet CodePeer Update Arnaud Charlet
CodePeer Update Arnaud Charlet CodePeer Update Arnaud Charlet
Test-driven development (TDD)
Testing and Test-Driven Development CSC 4700 Software Engineering
Module 01 ETICS Overview ETICS Online Tutorials
Overview Unit testing Building Version control.
Continuous Integration
CS 240 – Advanced Programming Concepts
Helping you make your code better
Java Code Coverage Tools - EclEmma and JaCoCo
White Box testing & Inspections
Java phoneME CDC AMS July, 15, 2008 by Wooram Noh.
Presentation transcript:

Introduction to Software Testing (Paul deGrandis) [Reading assignment: Chapter 15, pp and notes by Paul deGrandis]

Overview Terms and Definitions Tool Overview Static Checkers Unit Testing Coverage and Profiling Memory Analysis Bug Reporting and Tracking Continuous Integration

NOTE All the material and examples from here on are generated using a single makefile. Log into tux, then: wget mv vandvmakefile Makefilehttp:// Export your classpath: export CLASSPATH=`pwd`/junit/junit-4.4.jar:`pwd`/emma/emma.jar:. To make and download all tools and examples: make

Tool Overview Verification Static Checking Unit Tests for code correctness Memory and performance specifications Validation Unit Tests for behavior and requirements

Static Checkers Does not execute the code Finds suspicious code or security vulnerabilities Tools C - SPLINT, GCC Warnings Java - FindBugs, PMD Cyclone - a safe C GNU Compiler Collection FindBugs - Find Bugs in Java

Static Checkers - C Screenshots

Static Checkers - C Demo Installation of SPLINT Compiling using GCC Warning Running Splint

Static Checkers - C Demo Installation of SPLINT Download wget wget Untar tar -xzvf splint src.tgz Make (during make, splint checks itself) cd splint-3.1.2/./configure make

Static Checkers - C Demo Compiling using GCC Warnings see the screenshot three slides back

Static Checkers - C Demo Running SPLINT Simple and Basic splint -preproc +weak +show-summary +stats../src/*.c Dependable Software splint -preproc +checks +show-summary +stats../src/*.c

Static Checkers - Java Screenshots

Static Checkers - Java Demo Installation of FindBugs Running FindBugs

Static Checkers - Java Demo Installation of FindBugs Download wget Untar tar -xvzf findbugs tar.gz cd findbugs-1.2.1

Static Checkers - Java Demo Running FindBugs Run It./findbugs

Unit Tests Validate a unit of code; smallest testable part Executes the code in a sandboxed environment Testing mostly for functional requirements can also test some non-functional requirements Many approaches and schools of thought History Based, Risk Based, Data Path, DOE

Unit Tests Frameworks-C Screenshots Check Unit Test Framework

Demo Unit Tests Frameworks- C Installation of Check Writing a Check unit test Compiling your test(s) Running your test(s)

Demo Unit Tests Frameworks- C Installation of Check Download wget Untar tar -xvzf check tar.gz Make (notice the GCC warnings passed) cd check /configure make

Demo Unit Tests Frameworks- C Writing a Check unit test Write your test fixtures Write your test(s) Write your test suite Write your main method (execute your suite)

Demo Unit Tests Frameworks- C Writing a Check unit test Write your test fixtures

Demo Unit Tests Frameworks- C Writing a Check unit test Write your test(s)

Demo Unit Tests Frameworks- C Writing a Check unit test Write your test suite

Demo Unit Tests Frameworks- C Writing a Check unit test Write your main method (execute your suite)

Demo Unit Tests Frameworks- C Compiling your test(s) See README in check/check- example/square

Demo Unit Tests Frameworks- C Running your test(s) See README in check/check- example/square

Unit Tests Frameworks-Java Screenshots

Demo Unit Tests Frameworks- Java Installation of Junit Writing a Junit unit test Compiling your test(s) Just use javac Running your test(s) just use java (look at the cookbook)

Demo Unit Tests Frameworks- Java Installation of Junit Download wget Add the jar to your classpath export CLASSPATH=$CLASSPATH:`pwd`/junit-4.4.jar:.

Demo Unit Tests Frameworks- Java Writing a Junit unit test Write your test fixtures Write your test(s) Write your test suite Write your main method (execute your suite)

Demo Unit Tests Frameworks- Java Writing a Junit unit test Write your test fixtures

Demo Unit Tests Frameworks- Java Writing a Junit unit test Write your test(s)

Demo Unit Tests Frameworks- Java Writing a Junit unit test Write your test suite(s)

Demo Unit Tests Frameworks- Java Writing a Junit unit test Write your main method

Code Coverage Degree to how much code was tested (E.g., How confident are we in our tests and code) Criteria: Statement - Has each line been executed Condition - Every evaluation (if/else, try/catch, switch, loop) Path - Every route of code

Code Coverage - C Screenshots GCC - GCOV

Demo Code Coverage - C See the Screenshot one slide back

Code Coverage - Java Screenshots EMMA

Demo Code Coverage - Java Installation of Emma Download wget Unzip unzip emma lib.zip Instrument Your Code java -cp emma.jar:./sample:../junit/junit-4.4.jar emma instr -outdir./sampleout -cp./sample/ SimpleTest Run Your Code and Generate a report java SimpleTest java -cp emma.jar emma report -r html -in sampleout/coverage.em,sampleout/coverage.ec

Memory Analysis Sandboxes an application in a VM Uses: Memory Leak - allocate memory, but don’t free Buffer Overflow - access memory outside of a fixed buffer Profiling - performance analysis

Memory Analysis - C Screenshots Valgrind

Demo Memory Analysis - C Installation of Valgrind Download wget Untar tar -xvjf valgrind tar.bz2 Make (notice the GCC warnings passed) cd valgrind /configure make

Demo Memory Analysis - C Running of Valgrind Compile with debugging enabled gcc -g myprog.c Run Valgrind valgrind --leak-check=yes myprog arg1 arg2 Full tutorial and infoformation

Memory Analysis - Java Screenshots JConsole

Issue and Bug Tracking Organizes and tracks issues, enhancements, features, and bugs in a software system Usually contains a database backend and a web frontend Generate report of project and team metrics and productivity

Issue and Bug Tracking Trac ( ) Roundup ( ) Tracker ( )

Continuous Integration Committing changes early and often Building and testing at least nightly If code breaks, revert Integration issues discovered early as developers work with the latest code

You now know … … static checkers … unit testing tools … coverage and profiling tools … memory analysis tools … Bug reporting and tracking tools