JUnit test distribution Bettina Scharpf ACM 2 University of Applied Science Furtwangen.

Slides:



Advertisements
Similar presentations
Unit Testing Australian Development Centre Brisbane, Australia.
Advertisements

Greedy best-first search Use the heuristic function to rank the nodes Search strategy –Expand node with lowest h-value Greedily trying to find the least-cost.
J-Unit Framework.
GoogleTest Primer. Outline Basic Concepts Assertions Basic Assertions Binary Comparison String Comparison Floating-Point Comparison Simple Tests Test.
T ESTING WITH J UNIT IN E CLIPSE Farzana Rahman. I NTRODUCTION The class that you will want to test is created first so that Eclipse will be able to find.
Objectives: Test Options JUnit Testing Framework TestRunners Test Cases and Test Suites Test Fixtures JUnit.
Quicksort CS 3358 Data Structures. Sorting II/ Slide 2 Introduction Fastest known sorting algorithm in practice * Average case: O(N log N) * Worst case:
Testing and Debugging pt.2 Intro to Complexity CS221 – 2/18/09.
Introduction to Eclipse, Unit Testing and JUnit David Rabinowitz.
ISPDC 2007, Hagenberg, Austria, 5-8 July On Grid-based Matrix Partitioning for Networks of Heterogeneous Processors Alexey Lastovetsky School of.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Java Development Tools project.
JUnit Introduction and Advanced Features. Topics Covered  Junit Introduction  Fixtures  Test Suites  Currency Example.
Presentation Outline What is JUnit? Why Use JUnit? JUnit Features Design of JUnit Downloading JUnit Writing Tests – TestCase – TestSuite Organizing The.
George Blank University Lecturer. JUnit for Test Driven Development By Vivek Bhagat, George Blank.
Unit Testing Using PyUnit Monther Suboh Yazan Hamam Saddam Al-Mahasneh Miran Ahmad
Improved results for a memory allocation problem Rob van Stee University of Karlsruhe Germany Leah Epstein University of Haifa Israel WADS 2007 WAOA 2007.
Programmer Testing Testing all things Java using JUnit and extensions.
The Design of JUnit Yonglei Tao. Test-First Development  An essential element in eXtreme Programming (XP)  Test is written before the code  As an executable.
© Dr. A. Williams, Fall Present Software Quality Assurance – JUnit Lab 1 JUnit A unit test framework for Java –Authors: Erich Gamma, Kent Beck Objective:
Lesson 7 Unit Testing /JUnit/ AUBG ICoSCIS Team Assoc. Prof. Stoyan Bonev March, , 2013 SWU, Blagoevgrad.
JUnit The framework. Goal of the presentation showing the design and construction of JUnit, a piece of software with proven value.
Chapter 11, Testing.
Lecture 6 Software Testing and jUnit CS140 Dick Steflik.
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
Introduction to Unit Testing Jun-Ru Chang 2012/05/03.
CPSC 171 Introduction to Computer Science 3 Levels of Understanding Algorithms More Algorithm Discovery and Design.
Principles of Object Oriented Programming Practical session 2 – part A.
Computer Science and Engineering College of Engineering The Ohio State University JUnit The credit for these slides goes to Professor Paul Sivilotti at.
Testing in Extreme Programming
CSC 216/001 Lecture 4. Unit Testing  Why is it called “unit” testing?  When should tests be written?  Before the code for a class is written.  After.
Introduction to JUnit 3.8 SEG 3203 Winter ‘07 Prepared By Samia Niamatullah.
JUnit Dwight Deugo Nesa Matic
Unit Testing with JUnit and Clover Based on material from: Daniel Amyot JUnit Web site.
Frameworks CompSci 230 S Software Construction.
JUnit Dwight Deugo Nesa Matic
Introduction to Object-oriented Programming Java API.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
EMBEDDED REAL-TIME, INC. December 8, 2015 Java Unit Mark Mosher Rochester Java Users Group.
JUnit Don Braffitt Updated: 10-Jun-2011.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 11, Testing.
JUnit. Introduction JUnit is an open source Java testing framework used to write and run repeatable tests JUnit is integrated with several IDEs, including.
S Ramakrishnan1 Systems V & V, Quality and Standards Dr Sita Ramakrishnan School CSSE Monash University.
Unit, Regression, and Behavioral Testing Based On: Unit Testing with JUnit and CUnit by Beth Kirby Dec 13, 2002 Jules.
Test a Little, Code a Little Colin Sharples IBM Global Services New Zealand Colin Sharples IBM Global Services New Zealand.
1 JUnit. 2 Unit Testing with JUnit If code has no automated test case written for it to prove that it works, it must be assumed not to work. An API that.
Topic: Junit Presenters: Govindaramanujam, Sama & Jansen, Erwin.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Today… Modularity, or Writing Functions. Winter 2016CISC101 - Prof. McLeod1.
SWE 434 SOFTWARE TESTING AND VALIDATION LAB2 – INTRODUCTION TO JUNIT 1 SWE 434 Lab.
The Theory of NP-Completeness
Software Construction Lab 10 Unit Testing with JUnit
Don Braffitt Updated: 26-Mar-2013
Smalltalk Testing - SUnit
Introduction to JUnit CS 4501 / 6501 Software Testing
Unit testing Java programs Using JUnit
Chapter 9 – Real Memory Organization and Management
Executing Runtime Checks (For Comp401 and Comp410)
AIM: Clustering the Data together
Selenium HP Web Test Tool Training
Introduction to Testing, SUnit and Error Handling
Introduction to JUnit CS 4501 / 6501 Software Testing
Chapter 11, Testing.
Introduction to JUnit IT323 – Software Engineering II
Unit testing with JUnit
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
CSE 2010: Algorithms and Data Structures Algorithms
Chapter 11: Integration- and System Testing
JUnit Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from the Eclipse 3.0 and.
Mass vs. Weight 5:20.
Principles of Object Oriented Programming
Presentation transcript:

JUnit test distribution Bettina Scharpf ACM 2 University of Applied Science Furtwangen

04/07/2005Bettina Scharpf, ACM 22 Specification “Develop a Grid Service that partitions JUnit tests, does a balanced distribution and saves the results.” Technologies: JUnit ANT Web and Grid Services Globus Toolkit 4 and GRAM Proof of concept: partitioning efficient distribution

04/07/2005Bettina Scharpf, ACM 23 Agenda Introduction to JUnit Test partitioning –atoms Efficient distribution –execution hosts –algorithms Concept

04/07/2005Bettina Scharpf, ACM 24 Introduction to JUnit tests visible behavior –black and white box tests “units” of code -> Java classes by Erich Gamma and Kent Beck “test first”

04/07/2005Bettina Scharpf, ACM 25 Distinction between –errors (e.g. exceptions) and –failures (e.g. value not as expected) test passes or not - nothing inbetween Test runners –with graphical user interface –command line –... Introduction to JUnit

04/07/2005Bettina Scharpf, ACM 26 Organisation of JUnit tests TestSuite Test.run(testResult) TestCase setUp() tearDown() TestCase setUp() tearDown() TestCase setUp() tearDown() TestCase setUp() tearDown() TestCase setUp() tearDown() TestCase setUp() tearDown() TestCase setUp() tearDown() TestSetup setUp() tearDown() setUp() tearDown() TestCase setUp() tearDown()

04/07/2005Bettina Scharpf, ACM 27 Agenda Introduction to JUnit Test partitioning –atoms Efficient distribution –execution hosts –algorithms Concept

04/07/2005Bettina Scharpf, ACM 28 Single test cases Single test case wrapped by TestSetup’s setUp() and tearDown() but: TestSetup partitioning at any price? Test partitioning Atoms in JUnit TestSetup setUp() tearDown() setUp() tearDown() TestCase setUp() tearDown() TestCase setUp() tearDown() setUp() tearDown() TestCase setUp() tearDown() setUp() tearDown() TestCase setUp() tearDown() TestCase setUp() tearDown() =>+

04/07/2005Bettina Scharpf, ACM 29 Agenda Introduction to JUnit Test partitioning –atoms Efficient distribution –execution hosts –algorithms Concept

04/07/2005Bettina Scharpf, ACM 210 Efficient distribution Execution Hosts Problem: Hosts perform differently Solution: Equalize hosts Run reference test on each host Find slowest host Relate each host to the slowest one (using factor) Calculate execution time per slowest host Calculate quota for each particular host (using factor) Sum up known execution times

04/07/2005Bettina Scharpf, ACM 211 Optimal balance vs. preparation time: Check all possibilities (exponential) –Knapsack: must be run (n-1) times for n hosts + exact - very high complexity or Iterate: Assign largest test to host with most capacity left + not very complex + for most cases exact enough Efficient distribution Algorithms

04/07/2005Bettina Scharpf, ACM 212 Agenda Introduction to JUnit Test partitioning –atoms Efficient distribution –execution hosts –algorithms Concept

04/07/2005Bettina Scharpf, ACM 213 Problems: 1.) Partitioning: Optimal partitioning vs. longer cumulative execution time 2.) Efficient distribution: Optimal balance vs. test preparation time Solution: Must be something inbetween... Concept

04/07/2005Bettina Scharpf, ACM ) Partitioning of TestSetup objects – if necessary single test case contained in TestSetup object is too big complete TestSetup object is too big or –if fixture is not too big, amount of TestCases not too high (e. g. depending on the total execution time) Concept Solutions

04/07/2005Bettina Scharpf, ACM ) Balancing the tests –use knapsack for a small number of test cases (configurable) -> optimal “packaging” of tests for one host (each test has a weight and a value which are both the same here) -> iterate: remove assigned tests and “pack a knapsack” for the next host –“expensive first” assign tests iteratively, starting with the most expensive test case and the most performant host Concept Solutions else

04/07/2005Bettina Scharpf, ACM 216 The problem of atoms which are “too big” –has longer execution time than the most performant host (or the most performance left) –Solution put atom on the host with the most performance left calculate: how much longer will the test now take? re-calculate the execution time per slowest host apply “slowest host time” to all execution hosts (won’t extend the entire test duration) Distributing tests with unknown execution time: Round Robin, beginning with the most performant host Concept Solutions

04/07/2005Bettina Scharpf, ACM 217 Concept An Example host A host B host C host D test cases 1.) obtain factor 2.) calculate tests and execution time per host 2.0 (39 sec.) 3.) distribute s s s s14s 7 s 10.5s 14s s left 6.5 s left 8 s left 0 s left 4 s left 2.5 s left 3 s left2 s left1 s left 1.5 s left 2 s left 1 s left 0.5 s left

04/07/2005Bettina Scharpf, ACM 218 Fragen?