Automated testing in Agile SW development

Size: px
Start display at page:

Download "Automated testing in Agile SW development"

Transcription

1 T Software Testing and Quality Assurance Automated testing in Agile SW development Seppo Sahi SoberIT

2 Introduction Agile methods have strong emphasis on practices that support good quality in the constructive work Pair programming, war room, on-site customer etc. Much of the testing activities are actually constructive work Test-driven development Less testing with destructive attide Agile methods have a very strong focus on quality issues Testing in agile environment Automated unit testing Automated acceptance testing Exploratory testing 2

3 No manual tests Chapter about manual tests in Testing Extreme Programming (Crispin & House 2003) No manual tests. Quick and minimal effort regression testing Keep up a good pace in software development Enables safe refactoring Suitable testing tools not always available Organization has to develop own tools 3

4 Agile acceptance testing with FIT Acceptance testing = A level of testing conducted from the viewpoint of the customer, used to establish the criteria for acceptance of a system.

5 Requirements and acceptance testing Agile requirements definition Specifying requirement in great detail is delayed until the details are really needed Agile acceptance testing In XP Testers, customer and developers design acceptance test together main responsibility in customer Acceptance tests are designed before implementation All acceptance tests are gradually automated Developers use tests as executable specifications Acceptance testing is not a phase in the end it is a tool to carry out a project 5

6 Roles Turning customer requirements into an automated test is a team effort Customer - knows what is needed Design and write tests together with testers and programmers Tester - knows how to test software and where software systems usually break Write more advanced tests (e.g. negative tests, use testing techniques) Programmers are not interested Customers don t have the required skills Consider testing viewpoint early Programmer connects tests and application 6

7 What is FIT and FitNesse? FIT (Framework for Integrated Test) Framework for Acceptance testing FitNesse A Wiki based UI to create, edit and run FIT tests Non-programmers write and run tests Business people, customer etc. A little help from testers and programmers is needed Standard and convenient way to write tests, log results, group tests into suites GUI and command-line based execution tools Available for many programming languages 7

8 Creating and modifying acceptance tests is easy Use Word, Excel or HTML editor 8

9 How acceptance tests plug-in to application (1/2) Simple glue code a.k.a Fixture code is needed Framework offers a variety of ready fixtures from which programmers can inherit their own ones Handles parsing of test data etc. Separation of test data and test code Test data Fixture code Application code Presentation Fixture test fixtures Application under test 9

10 How acceptance tests plug-in to application (2/2) Presentation test fixtures Business rule test fixtures Fixture code Application code UI Presentation API Client-side presentation, validation, calcualtion Business rule API Business rules 10

11 Demo Writing and organizing tests Running tests Writing fixture code 11

12 References FIT homepage - Download framework and tools Example code Articles about agile acceptance testing Crispin, Lisa. 2005, Using Customer Tests to Drive Development, Methods & Tools, Summer Shore, James. 2005, A Vision for Fit. Marick, Brian. 2004, Driving Projects with Examples: a Handbook for Agile Teams. Reppert, Tracy. 2004, Don t Just Brake Software. Make Software., Better Software, July/August

13 Unit testing with JUnit Seppo Sahi SoberIT

14 Unit testing A unit is the smallest possible testable software component Various interpretations exists Procedure / function Class / object / method Small-sized component Goal is to ensure that software units are functioning as intended E.g. a function returns correct value when exercised with valid parameters E.g. function behaves correctly when given an invalid input Automated unit test == a piece of code that exercises another piece of code 14

15 Unit testing - a vital testing level Writing software is difficult and every programmer makes mistakes There will be defects in all software you write The cost of a defect is lowest when it is found in unit testing Defects that slip to upper levels (integration, system or acceptance testing) More difficult to spot Time consuming to debug Trivial bugs on unit level can be hard to resolve on system level Uses organizational resources Writing, prioritizing and managing test and defect reports Bug found during the use in production Loss of money, loss of... Unit testing lays the foundation for good quality software Higher levels of testing are needed to ensure overall quality of software Unit testing lays foundation for effective testing on higher levels Bad unit level quality slows down integration and system testing 15

16 How do you know that your code works correctly? Do you just trust your luck? Do you use printf outputs to see what happens in your code? Do you use debugger to find out how your code really works? Do you ask your friend/colleague to check through your code? Do you create small (temporary) widget to access the piece of code directly runtime? Do you use some ugly, cumbersome, time consuming practice that leaves trash into your code and is thrown up to the user s face when you least expect it Getting here is not possible, something is really messed up in this code!!! Fatal error 9981: Assertion failed : av_d_dx > 0 16

17 Unit testing frameworks Convenient frameworks for writing unit tests as part of the programming task In the same environment with the same language Tools of xunit family are the most famous ones junit CppUnit NUnit The unit testing frameworks provide a convenient way of writing and executing unit tests Standard and convenient way to write tests, log results, group tests into suites GUI and command-line based execution tools Integrated to IDEs Convenient report generators Xml, html 17

18 Demo Framework features IDE integration 18

19 Naming conventions for junit tests Naming conventions tell what class and method is under test 1. import junit.framework.testcase; public class TriangleTest extends TestCase 4. { /** 8. * Tests that {@link Triangle#classify()} can classify an 9. * impossible triangle. 10. */ 11. public void testclassify_withimpossibletriangle() { 12. Triangle impossibletriangle = new Triangle(8, 3, 4); String classification = impossibletriangle.classify(); 15. String expectedclassification = "impossible"; assertequals("one side longer than two others together" "should be impossible.", 19. expectedclassification, 20. classification); 21. } } 19

20 Naming conventions for junit tests (2/2) CODE: Triangle.java TEST FOR THE CODE: TriangleTest.java classify() testclassify() isisosceles()...() testisisosceles() testisisosceles_withequilaterialtriangle() testisisosceles_withnonisoscelestriangle() Test method name Begins with test......followed by the name of the method it tests......and side conditions of the test test...() test...() 20

21 Basic test flow Create test data (12) Perform operation and fetch result (14) Specify expected result of the operation (15) Check that result matches the expected (17-20) Clean up 1. import junit.framework.testcase; public class TriangleTest extends TestCase 4. { /** 8. * Tests that {@link Triangle#classify()} can classify an 9. * impossible triangle. 10. */ 11. public void testclassify_withimpossibletriangle() { 12. Triangle impossibletriangle = new Triangle(8, 3, 4); String classification = impossibletriangle.classify(); 15. String expectedclassification = "impossible"; assertequals("one side longer than two others together" "should be impossible.", 19. expectedclassification, 20. classification); 21. } } 21

22 Simple Test class 1. import junit.framework.testcase; public class VectorTest extends TestCase { 4. private Vector testvector = null; protected void setup() { 7. testvector = new Vector(); 8. } protected void teardown() { 11. testvector = null; 12. } public void testisempty() { 15. asserttrue("vector is not empty", testvector.isempty()); 16. } public void testaddelement() { 19. testvector.add(new Object()); 20. assertequals("wrong size!", 1, testvector.size()); 21. } public static void main(string[] args){ 24. junit.textui.testrunner.run(vectortest.class); 25. } 26. } 22

23 Assert method summary 1/2 assertequals(string msg, Object expected, Object actual) Compares two values for equality. The test passes if the values are equal. Comparison methods for all primitive data types, too (int, float, long, byte, char..) asserttrue(string msg, boolean b) Evaluates a boolean expression. The test passes if the expression is true. assertfalse(string msg, boolean b) Evaluates a boolean expression.the test passes if the expression is false. assertnull(string msg, Object a) Compares an object reference to null. The test passes if the reference is null assertnotnull(string msg, Object o) Compares an object reference to null. The test passes if the reference is not null. 23

24 Assert method summary 2/2 assertsame(string msg, Object a, Object b) Compares two object references using the == operator. The test passes if both refer to the same object. assertnotsame(string msg, Object a, Object b) Compares two object references using the == operator. The test passes if both refer to different objects. fail(string msg) Causes the current test to fail All asserts take a string as the first parameter Provides documentation Shows up in the JUnit TestRunner interface Good messages can tell you what is wrong without starting up the debugger Check possible assertxxx() methods from JUnit JavaDocs! 24

25 Unit testing best practices (1/3) Write automated unit tests rather than use printf or debugger Automated unit tests retain value over time Tomorrow, after five years,... No need for human interaction Write once run with minimal effort Test code should contain as little logic as possible Introducing more logic will introduce more errors Don t use loops, branches etc. Unit tests should be independent Don t assume a specific execution order Don t assume specific execution time Tests have no side effects 25

26 Unit testing best practices (2/3) Write tests like they were small increments Each test tests very small and targeted subject Tests build on each other - utilize existing tests to create new ones Keep test methods short Kent Beck: Long tests indicate the likelihood of a design problem Refactor your code so that it can be tested in smaller parts JUnit is designed to stop on the first failing assert on purpose! Use method naming conventions Test name should describe functionality tested and side conditions E.g. testadduserwithalreadyexistinguser Document your unit tests Use method naming conventions Write JavaDocs for test methods Include a message in assertxxx() 26

27 Unit testing best practices (3/3) Treat test code like production code Remember readibility and clarity Remember coding conventions Store data in ways that can be managed by the source control system Test data evolves along with test cases If it can't break on its own, it's too simple to break otherwise, write unit tests testing setx() and getx() usually ignored Run all your unit tests as often as possible, ideally every time the code is changed. For larger systems, you may just run specific test suites that are relevant to the code you're working on Keep all tests running Tests have to be maintained like application code 27

28 Agile unit testing and test-driven development

29 Document driven vs. agile unit testing Principle 7. Testing should be carried out by a group that is independent of the development group Course book presents a unit testing viewpoint which appreciates this principle Unit testing should be separate task conducted after the development is done Unit test design is based on written specifications Modern ideas of unit testing represent slightly different viewpoint Unit tests are written by developer Automation is essential part of unit testing Unit tests might even be written before the actual program code This lecture is mostly about agile unit testing Read the course book Ch. 6 and understand the difference The same tools are used by both disciplines 29

30 Agile unit testing Test-driven development is practiced Writing and running tests is integral part of daily development rhythm Developers QA and programming tool All unit tests are automated Automated tests are run as often as possible Gather all your tests to a test suite and use it for regression testing Integration, nightly, milestone During development; after every change to the code; new code or bugfix 30

31 Test-driven development Writing test before code to be tested a little test, a little code, a little test, a little code,... Tests are added gradually during implementation not in large lump afterwards Process of writing tests drives low-level design and programming Tests specify what code should do Tests validate that code does what it should Actually, a design and coding practice One of the core practices of Extreme Programming Developers have been applying TDD for several decades 31

32 TDD episode (1/2) Proceeds step by step 1. Write a test. Write test 2. Design and implement just enough to make the test pass. 3. Repeat. Testing and coding alternate in very small steps Duration of one cycle should be a few minutes Fail Write code Run tests Pass Small steps difficult to make mistake 32

33 TDD episode (2/2) Episode is over when you can t write a failing test anymore Write test for each requirement of the code Write test for each point that can possibly break One cycle at a time Don t write a bunch of tests at once Refactor if you ever see the chance to make the design simpler Run all tests after finishing episode Make sure you did not brake anything else 33

34 Demo: CommandLineParameters class Class that represents command line parameters given Format should be /<param> <value>, e.g. /backup true /interval

35 Test-Driven Development claimed benefits (1/2) Close feedback loop TDD cycle is very short know if code is working right after you programmed it Task-orientation Encourage programmer to decompose problem into manageable programming tasks Helps to maintain focus Helps to measure progress and scope work Low-level design Programmer is forced to think which classes and methods to create, how they are used, how to name them, what arguments does a method take, what does a method return 35

36 Test-Driven Development claimed benefits (2/2) Results better code If the test is too hard to write, the code being tested is too complicated Results testable code Programmer can t end up with code that cannot be tested Effect on quality Testing becomes part of the development process and gets done Side effect of TDD is that code gets thoroughly unit tested 36

37 Try it! The only way to know! Personal experiences Good feeling about the code written General confidence that your code does what you have intended it to do Good feeling when checking your code into version control with all green Tests really get written when they are written beforehand You allways have an up-to-date regression testing suite TDD helps you to keep focus on the current task Program only what is needed to see the green light Promote best practices System.out.println is used for displaying messages for user not for developer Debugger is used for debugging 37

38 Example of testbase growth in a project that used TDD 4 developers, iteration length 2 weeks Pre-project Iteration 1 Iteration 2 Iteration 3 Iteration 4 Iteration 5 Iteration 6 Maintenance Application Testcode Comments Comments in testcode SQL code 38

TEST DRIVEN DEVELOPMENT

TEST DRIVEN DEVELOPMENT PERSONAL SOFTWARE ENGINEERING PROJECT: TEST DRIVEN DEVELOPMENT Kirsi Männistö kirsi.mannisto@welho.com 60114V PSEA_Test_driven_development.rtf Page 1 of 1 RoadRunners Change history Version Description

More information

Tools for Unit Test - JUnit

Tools for Unit Test - JUnit Tools for Unit Test - JUnit Conrad Hughes School of Informatics Slides thanks to Stuart Anderson 15 January 2010 Software Testing: Lecture 2 1 JUnit JUnit is a framework for writing tests Written by Erich

More information

Tools for Unit Test JUnit

Tools for Unit Test JUnit Tools for Unit Test JUnit Stuart Anderson JUnit is a framework for writing tests JUnit 1 Written by Erich Gamma (Design Patterns) and Kent Beck (extreme Programming) JUnit uses Java s reflection capabilities

More information

Unit Testing with JUnit and CppUnit

Unit Testing with JUnit and CppUnit Unit Testing with JUnit and CppUnit Software Testing Fundamentals (1) What is software testing? The process of operating a system or component under specified conditions, observing or recording the results,

More information

Test suites Obviously you have to test your code to get it working in the first place You can do ad hoc testing (testing whatever occurs to you at

Test suites Obviously you have to test your code to get it working in the first place You can do ad hoc testing (testing whatever occurs to you at JUnit Test suites Obviously you have to test your code to get it working in the first place You can do ad hoc testing (testing whatever occurs to you at the moment), or You can build a test suite (a thorough

More information

Tuesday, November 15. Testing

Tuesday, November 15. Testing Tuesday, November 15 1 Testing Testing Waterfall model show testing as an activity or box In practice, testing is performed constantly There has never been a project where there was too much testing. Products

More information

Testing in Agile Software Development

Testing in Agile Software Development Testing in Agile Software Development T 76.5613, Software Testing and Quality Assurance Slides by Juha Itkonen Lecture delivered by 4.10.2006 V-model of testing Benefits of the V-model Intuitive and easy

More information

Practical Objects: Test Driven Software Development using JUnit

Practical Objects: Test Driven Software Development using JUnit 1999 McBreen.Consulting Practical Objects Test Driven Software Development using JUnit Pete McBreen, McBreen.Consulting petemcbreen@acm.org Test Driven Software Development??? The Unified Process is Use

More information

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing.

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing. Overview CS 619 Introduction to OO Design and Development ing! Preliminaries! All sorts of test techniques! Comparison of test techniques! Software reliability Fall 2012! Main issues: There are a great

More information

Analysis of the Test Driven Development by Example

Analysis of the Test Driven Development by Example Computer Science and Applications 1 (2013) 5-13 Aleksandar Bulajic and Radoslav Stojic The Faculty of Information Technology, Metropolitan University, Belgrade, 11000, Serbia Received: June 18, 2013 /

More information

Introduction to Automated Unit Testing (xunit) Brian Nielsen Arne Skou

Introduction to Automated Unit Testing (xunit) Brian Nielsen Arne Skou Introduction to Automated Unit Testing (xunit) Brian Nielsen Arne Skou {bnielsen ask}@cs.aau.dk Conventional Test Execution Ad hoc manner Manual stimulation & observation E.g. adding a function to a module,

More information

Unit Testing and JUnit

Unit Testing and JUnit Unit Testing and JUnit Moinul Hossain CS 791Z 03/02/2015 Outline What is Software Testing? What and Why Unit Testing? JUnit JUnit features and Examples Test Driven Development (TDD) What is Software Testing?

More information

Test Driven Development TDD

Test Driven Development TDD Test Driven Development TDD Testing Testing can never demonstrate the absence of errors in software, only their presence Edsger W. Dijkstra (but it is very good at the latter). Testing If it's worth building,

More information

Software Design and Analysis CSCI 2040

Software Design and Analysis CSCI 2040 Software Design and Analysis CSCI 2040 Introduce two important development practices in the context of the case studies: Test-Driven Development Refactoring 2 Logic is the art of going wrong with confidence

More information

EECS 4313 Software Engineering Testing

EECS 4313 Software Engineering Testing EECS 4313 Software Engineering Testing Topic 03: Test automation / JUnit - Building automatically repeatable test suites Zhen Ming (Jack) Jiang Acknowledgement Some slides are from Prof. Alex Orso Relevant

More information

Chapter 15. Software Testing The assert Statement

Chapter 15. Software Testing The assert Statement 177 Chapter 15 Software Testing We know that a clean compile does not imply that a program will work correctly. We can detect errors in our code as we interact with the executing program. The process of

More information

1 of 5 3/28/2010 8:01 AM Unit Testing Notes Home Class Info Links Lectures Newsgroup Assignmen [Jump to Writing Clear Tests, What about Private Functions?] Testing The typical approach to testing code

More information

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015

xtreme Programming (summary of Kent Beck s XP book) Stefan Resmerita, WS2015 xtreme Programming (summary of Kent Beck s XP book) 1 Contents The software development problem The XP solution The JUnit testing framework 2 The Software Development Problem 3 Risk Examples delivery schedule

More information

Software Testing Lecture 1. Justin Pearson

Software Testing Lecture 1. Justin Pearson Software Testing Lecture 1 Justin Pearson 2017 1 / 50 Four Questions Does my software work? 2 / 50 Four Questions Does my software work? Does my software meet its specification? 3 / 50 Four Questions Does

More information

Test automation / JUnit. Building automatically repeatable test suites

Test automation / JUnit. Building automatically repeatable test suites Test automation / JUnit Building automatically repeatable test suites Test automation n Test automation is software that automates any aspect of testing n Generating test inputs and expected results n

More information

Test automation Test automation / JUnit

Test automation Test automation / JUnit Test automation Test automation / JUnit Building automatically repeatable test suites Test automation is software that automates any aspect of testing Generating test inputs and expected results Running

More information

EVALUATION COPY. Test-Driven Development Using NUnit and C# Student Guide Revision 4.6. Unauthorized reproduction or distribution is prohibited.

EVALUATION COPY. Test-Driven Development Using NUnit and C# Student Guide Revision 4.6. Unauthorized reproduction or distribution is prohibited. Test-Driven Development Using NUnit and C# Student Guide Revision 4.6 Object Innovations Course 4105 Test-Driven Development Using NUnit and C# Rev. 4.6 Student Guide Information in this document is subject

More information

Verifying and Documenting ADTs: Javadoc, Java Assertions and JUnits

Verifying and Documenting ADTs: Javadoc, Java Assertions and JUnits Verifying and Documenting ADTs: Javadoc, Java Assertions and JUnits Slide 1 / 63 Documenting Java Code Regular Java comments: /* */ for programmers who must read or modify your code One Liners : // for

More information

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018 Object-oriented programming 1 and data-structures CS/ENGRD 2110 SUMMER 2018 Lecture 1: Types and Control Flow http://courses.cs.cornell.edu/cs2110/2018su Lecture 1 Outline 2 Languages Overview Imperative

More information

Object Oriented Software Design - I

Object Oriented Software Design - I Object Oriented Software Design - I Unit Testing Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa November 28, 2011 G. Lipari (Scuola Superiore Sant Anna) Unit Testing November

More information

print statements, debugger expressions, test scripts. Writing expressions in a debugger only that t a program works now. An application typically

print statements, debugger expressions, test scripts. Writing expressions in a debugger only that t a program works now. An application typically JUnit testing Current practice print statements, debugger expressions, test scripts. Writing expressions in a debugger only that t a program works now. An application typically undergoes many changes over

More information

8. Quality Assurance

8. Quality Assurance 8. Quality Assurance Prof. Dr. Dirk Riehle, M.B.A. Friedrich Alexander-University Erlangen-Nürnberg Version of 22.03.2012 Agile Methods by Dirk Riehle is licensed under a Creative Commons Attribution-

More information

https://www.lri.fr/ linaye/gl.html

https://www.lri.fr/ linaye/gl.html Software Engineering https://www.lri.fr/ linaye/gl.html lina.ye@centralesupelec.fr Sequence 3, 2017-2018 1/61 Software Engineering Plan 1 2 3 4 5 2/61 Software Engineering Software Testing 3/61 Software

More information

Software Engineering Testing and Debugging Testing

Software Engineering Testing and Debugging Testing Software Engineering Testing and Debugging Testing Prof. Dr. Peter Thiemann Universitt Freiburg 08.06.2011 Recap Testing detect the presence of bugs by observing failures Debugging find the bug causing

More information

Software Testing Workshop 2014 Introduction

Software Testing Workshop 2014 Introduction Software Testing Workshop 2014 Introduction May 3 rd 2014. FAST, Islamabad. About Us Majd Uddin 15+ years of experience with a decade in software testing Promoting software quality: M.Sc. (CS) from PUCIT,

More information

Manuel Oriol, CHCRC-C, Software Testing ABB

Manuel Oriol, CHCRC-C, Software Testing ABB Manuel Oriol, CHCRC-C, 08.11.2017 Software Testing Slide 1 About me 1998 2004 2005 2008 2011 Slide 2 Introduction Why do we test? Did you have to deal with testing in the past? Slide 3 Ariane 5 http://www.youtube.com/watch?v=kyurqduyepi

More information

Agile Software Development. Lecture 7: Software Testing

Agile Software Development. Lecture 7: Software Testing Agile Software Development Lecture 7: Software Testing Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Slides are a modified version of the slides by Prof. Kenneth M. Anderson Outline Testing Terminology Types

More information

11 Using JUnit with jgrasp

11 Using JUnit with jgrasp 11 Using JUnit with jgrasp jgrasp includes an easy to use plug-in for the JUnit testing framework. JUnit provides automated support for unit testing of Java source code, and its utility has made it a de

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

AgileBill Krebs. Agile3d Academy. Enterprise Open Distributed. Agile Quality. Years 30 Books 240. Certs 8. Badges 6. O, Rq, Pm, Qa, Ns, Agile 01

AgileBill Krebs. Agile3d Academy. Enterprise Open Distributed. Agile Quality. Years 30 Books 240. Certs 8. Badges 6. O, Rq, Pm, Qa, Ns, Agile 01 Agile3d Academy AgileBill Krebs Agile Quality Enterprise Open Distributed Years 30 Books 240 Certs 8 Badges 6 O, Rq, Pm, Qa, Ns, Agile 01 Agile Testing: A Practical Guide for Testers and Agile Teams By

More information

Software Design Models, Tools & Processes. Lecture 6: Transition Phase Cecilia Mascolo

Software Design Models, Tools & Processes. Lecture 6: Transition Phase Cecilia Mascolo Software Design Models, Tools & Processes Lecture 6: Transition Phase Cecilia Mascolo UML Component diagram Component documentation Your own classes should be documented the same way library classes are.

More information

Software Engineering

Software Engineering Software Engineering Lecture 13: Testing and Debugging Testing Peter Thiemann University of Freiburg, Germany SS 2014 Recap Recap Testing detect the presence of bugs by observing failures Recap Testing

More information

Extreme programming XP 6

Extreme programming XP 6 Extreme programming XP 6 Planning Game 3 Planning Game Independent: Stories should be as independent as possible. When thinking of independence it is often easier to think of order independent. In other

More information

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Lecture 04 Software Test Automation: JUnit as an example

More information

Automated Unit Testing A Practitioner's and Teacher's Perspective

Automated Unit Testing A Practitioner's and Teacher's Perspective Automated Unit Testing A Practitioner's and Teacher's Perspective Prof. Peter Sommerlad HSR - Hochschule für Technik Rapperswil Institute for Software Oberseestraße 10, CH-8640 Rapperswil peter.sommerlad@hsr.ch

More information

Testing Stragegies. Black Box Testing. Test case

Testing Stragegies. Black Box Testing. Test case References: Teach Yourself Object-Oriented Programming in 21 Days by A.Sintes, 1 Testing Stragegies Test case a set of inputs and expected outputs looks at specific piece of functionality to determine

More information

Test Automation. Fundamentals. Mikó Szilárd

Test Automation. Fundamentals. Mikó Szilárd Test Automation Fundamentals Mikó Szilárd 2016 EPAM 2 Blue-chip clients rely on EPAM 3 SCHEDULE 9.12 Intro 9.19 Unit testing 1 9.26 Unit testing 2 10.03 Continuous integration 1 10.10 Continuous integration

More information

Software Test. Levels of test. Types of test. Regression test The JUnit tool for unit testing Java programs. System test Integration test Unit test

Software Test. Levels of test. Types of test. Regression test The JUnit tool for unit testing Java programs. System test Integration test Unit test Levels of test System test Integration test Unit test Types of test Black box White box Software Test Regression test The JUnit tool for unit testing Java programs OOP: Software Test 1 Introduction Sofware

More information

Agile Manifesto & XP. Topics. Rapid software development. Agile methods. Chapter ) What is Agile trying to do?

Agile Manifesto & XP. Topics. Rapid software development. Agile methods. Chapter ) What is Agile trying to do? Topics 1) What is trying to do? Manifesto & XP Chapter 3.1-3.3 2) How to choose plan-driven vs? 3) What practices go into (XP) development? 4) How to write tests while writing new code? CMPT 276 Dr. B.

More information

TOOLS AND TECHNIQUES FOR TEST-DRIVEN LEARNING IN CS1

TOOLS AND TECHNIQUES FOR TEST-DRIVEN LEARNING IN CS1 TOOLS AND TECHNIQUES FOR TEST-DRIVEN LEARNING IN CS1 ABSTRACT Test-Driven Development is a design strategy where a set of tests over a class is defined prior to the implementation of that class. The goal

More information

Dealing with Bugs. Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 27 04/21/2009

Dealing with Bugs. Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 27 04/21/2009 Dealing with Bugs Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 27 04/21/2009 University of Colorado, 2009 1 Goals 2 Review material from Chapter 11 of Pilone & Miles Dealing with

More information

Test-Driven Development JUnit

Test-Driven Development JUnit Test-Driven Development JUnit Click to edit Master EECS text 2311 styles - Software Development Project Second level Third level Fourth level Fifth level Wednesday, January 18, 2017 1 Simulator submission

More information

OHJ-306x: Software Testing Introduction to the Course Project Part 1: General Information and Project phases 1 & 2: Unit testing

OHJ-306x: Software Testing Introduction to the Course Project Part 1: General Information and Project phases 1 & 2: Unit testing 1 OHJ-306x: Software Testing Introduction to the Course Project Part 1: General Information and Project phases 1 & 2: Unit testing Antti Jääskeläinen, leading course assistant Matti Vuori, course assistant

More information

CSE 8B Intro to CS: Java

CSE 8B Intro to CS: Java CSE 8B Intro to CS: Java Winter, 2006 January 10 (Day 1) Introduction Unit Testing Administrative Details Programming assignments (30%) Weekly Due Monday night (midnight) Lowest assignment dropped Quizzes

More information

Inverting the Pyramid

Inverting the Pyramid Inverting the Pyramid Naresh Jain naresh@agilefaqs.com @nashjain http://nareshjain.com Time/Money/Opportunity Cost Plan Back in the Stone-age Happiness/Excitement Design Distribute Work in Isolation Integrate

More information

Unit Testing In Python

Unit Testing In Python Lab 13 Unit Testing In Python Lab Objective: One of the hardest parts of computer programming is ensuring that a program does what you expect it to do. For instance, a program may fail to meet specifications,

More information

Chapter 9. Software Testing

Chapter 9. Software Testing Chapter 9. Software Testing Table of Contents Objectives... 1 Introduction to software testing... 1 The testers... 2 The developers... 2 An independent testing team... 2 The customer... 2 Principles of

More information

Levels of Testing Testing Methods Test Driven Development JUnit. Testing. ENGI 5895: Software Design. Andrew Vardy

Levels of Testing Testing Methods Test Driven Development JUnit. Testing. ENGI 5895: Software Design. Andrew Vardy Testing ENGI 5895: Software Design Andrew Vardy Faculty of Engineering & Applied Science Memorial University of Newfoundland March 6, 2017 Outline 1 Levels of Testing 2 Testing Methods 3 Test Driven Development

More information

XP: Planning, coding and testing. Planning. Release planning. Release Planning. User stories. Release planning Step 1.

XP: Planning, coding and testing. Planning. Release planning. Release Planning. User stories. Release planning Step 1. XP: Planning, coding and testing Annika Silvervarg Planning XP planning addresses two key questions in software development: predicting what will be accomplished by the due date determining what to do

More information

Software Development Methodologies

Software Development Methodologies Software Development Methodologies Lecturer: Raman Ramsin Lecture 8 Agile Methodologies: XP 1 extreme Programming (XP) Developed by Beck in 1996. The first authentic XP book appeared in 1999, with a revised

More information

Software Development Process Models

Software Development Process Models Software Development Process Models From classical notions to more agile approaches th@cs.toronto.edu, BA8134 Code & Fix or Cowboy Coding 1) Write program 2) Test and fix program Problems: program users

More information

Software Engineering I (02161)

Software Engineering I (02161) Software Engineering I (02161) Week 3 Assoc. Prof. Hubert Baumeister DTU Compute Technical University of Denmark Spring 2016 Recap Requirements Engineering functional / non-functional requirements Elicitation,

More information

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)?

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)? Testing CMSC 433 Programming Language Technologies and Paradigms Spring 2007 Testing Feb. 15, 2007 Some slides adapted from FSE 98 Tutorial by Michal Young and Mauro Pezze Execute program on sample input

More information

Levels of Testing Testing Methods Test Driven Development JUnit. Testing. ENGI 5895: Software Design. Andrew Vardy

Levels of Testing Testing Methods Test Driven Development JUnit. Testing. ENGI 5895: Software Design. Andrew Vardy Testing ENGI 5895: Software Design Andrew Vardy Faculty of Engineering & Applied Science Memorial University of Newfoundland March 6, 2017 Outline 1 Levels of Testing 2 Testing Methods 3 Test Driven Development

More information

Testing. My favourite testing quote: Program testing can be used to show the presence of bugs, but never to show their absence!

Testing. My favourite testing quote: Program testing can be used to show the presence of bugs, but never to show their absence! Testing Some resources The most time-consuming of a development project. See for example https://www.itu.dk/people/sestoft/ papers/softwaretesting.pdf - Peter Sestoft testing notes Testing My favourite

More information

Credit where Credit is Due. Lecture 29: Test-Driven Development. Test-Driven Development. Goals for this lecture

Credit where Credit is Due. Lecture 29: Test-Driven Development. Test-Driven Development. Goals for this lecture Lecture 29: Test-Driven Development Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003 Credit where Credit is Due Some of the material for this lecture is taken from

More information

Lecture 15 Software Testing

Lecture 15 Software Testing Lecture 15 Software Testing Includes slides from the companion website for Sommerville, Software Engineering, 10/e. Pearson Higher Education, 2016. All rights reserved. Used with permission. Topics covered

More information

Programming Embedded Systems

Programming Embedded Systems Programming Embedded Systems Lecture 8 Overview of software testing Wednesday Feb 8, 2012 Philipp Rümmer Uppsala University Philipp.Ruemmer@it.uu.se 1/53 Lecture outline Testing in general Unit testing

More information

Laboratorio di Tecnologie dell'informazione

Laboratorio di Tecnologie dell'informazione Laboratorio di Tecnologie dell'informazione Ing. Marco Bertini marco.bertini@unifi.it http://www.micc.unifi.it/bertini/ Code testing: techniques and tools Testing can show the presence of errors, but not

More information

Sample Exam. Advanced Test Automation - Engineer

Sample Exam. Advanced Test Automation - Engineer Sample Exam Advanced Test Automation - Engineer Questions ASTQB Created - 2018 American Software Testing Qualifications Board Copyright Notice This document may be copied in its entirety, or extracts made,

More information

Test Automation Blunders

Test Automation Blunders Test Automation Blunders Prepared and presented by Dorothy Graham email: 1 Blunder from old Norse word blundra meaning to shut one s eyes now means mistake caused by ignorance, carelessness or not thinking

More information

Software Engineering I (02161)

Software Engineering I (02161) Software Engineering I (02161) Week 3 Assoc. Prof. Hubert Baumeister DTU Compute Technical University of Denmark Spring 2013 Recap Requirements Engineering user- / system requirements functional- / non-functional

More information

BEHAVIOR DRIVEN DEVELOPMENT BDD GUIDE TO AGILE PRACTICES. Director, Strategic Solutions

BEHAVIOR DRIVEN DEVELOPMENT BDD GUIDE TO AGILE PRACTICES. Director, Strategic Solutions BEHAVIOR DRIVEN DEVELOPMENT BDD GUIDE TO AGILE PRACTICES Presenter: Joshua Eastman Director, Strategic Solutions ABOUT THE SPEAKER Josh has over seven years of experience as an accomplished software testing

More information

Main concepts to be covered. Testing and Debugging. Code snippet of the day. Results. Testing Debugging Test automation Writing for maintainability

Main concepts to be covered. Testing and Debugging. Code snippet of the day. Results. Testing Debugging Test automation Writing for maintainability Main concepts to be covered Testing and Debugging Testing Debugging Test automation Writing for maintainability 4.0 Code snippet of the day public void test() { int sum = 1; for (int i = 0; i

More information

Introduc)on to tes)ng with JUnit. Workshop 3

Introduc)on to tes)ng with JUnit. Workshop 3 Introduc)on to tes)ng with JUnit Workshop 3 We have to deal with errors Early errors are usually syntax errors. The compiler will spot these. Later errors are usually logic errors. The compiler cannot

More information

Software Testing part II (white box) Lecturer: Giuseppe Santucci

Software Testing part II (white box) Lecturer: Giuseppe Santucci Software Testing part II (white box) Lecturer: Giuseppe Santucci 4. White box testing White-box (or Glass-box) testing: general characteristics Statement coverage Decision coverage Condition coverage Decision

More information

CS211 Computers and Programming Matthew Harris and Alexa Sharp July 9, Boggle

CS211 Computers and Programming Matthew Harris and Alexa Sharp July 9, Boggle Boggle If you are not familiar with the game Boggle, the game is played with 16 dice that have letters on all faces. The dice are randomly deposited into a four-by-four grid so that the players see the

More information

Lecture 8 Classes and Objects Part 2. MIT AITI June 15th, 2005

Lecture 8 Classes and Objects Part 2. MIT AITI June 15th, 2005 Lecture 8 Classes and Objects Part 2 MIT AITI June 15th, 2005 1 What is an object? A building (Strathmore university) A desk A laptop A car Data packets through the internet 2 What is an object? Objects

More information

Efficient Regression Test Model for Object Oriented Software

Efficient Regression Test Model for Object Oriented Software Efficient Regression Test Model for Object Oriented Software Swarna Lata Pati College of Engg. & Tech, Bhubaneswar Abstract : This paper presents an efficient regression testing model with an integration

More information

Write for your audience

Write for your audience Comments Write for your audience Program documentation is for programmers, not end users There are two groups of programmers, and they need different kinds of documentation Some programmers need to use

More information

Eclipse Summit Europe Summary

Eclipse Summit Europe Summary Eclipse Summit Europe 2007 Symposia Integrating Test-Driven Development in the Development Process Summary Christine Mitterbauer, George Mesesan MicroDoc Computersysteme GmbH Elektrastrasse 6 D-81925 München

More information

Testing in an Agile Environment Understanding Testing role and techniques in an Agile development environment. Just enough, just in time!

Testing in an Agile Environment Understanding Testing role and techniques in an Agile development environment. Just enough, just in time! Testing in an Agile Environment Understanding Testing role and techniques in an Agile development environment. Just enough, just in time! Today s Topics How the Tester s Role Changes in Agile Testing in

More information

An Introduction to Unit Testing

An Introduction to Unit Testing An Introduction to Unit Testing Brian Henderson Programmer Analyst, Collaborative Data Services bhenders@fhcrc.org CDS Seminars & Training Classes CDS Brownbag seminars Nov 28 th - SharePoint Tips & TricksSharePoint

More information

Test First Software Development

Test First Software Development Test First Software Development Jacob Kristhammar Roger Schildmeijer D04, Lund Institute of Technology, Sweden {d04jk d04rp}@student.lth.se 2008-02-06 Abstract In this in-depth study we will try to explain

More information

Topic 01. Software Engineering, Web Engineering, agile methodologies.

Topic 01. Software Engineering, Web Engineering, agile methodologies. Topic 01 Software Engineering, Web Engineering, agile methodologies. 1 What is Software Engineering? 2 1 Classic Software Engineering The IEEE definition: Software Engineering is the application of a disciplined,

More information

Testing on Steriods EECS /30

Testing on Steriods EECS /30 1/30 Testing on Steriods EECS 4315 www.eecs.yorku.ca/course/4315/ How to test code? 2/30 input code output Provide the input. Run the code. Compare the output with the expected output. White box testing

More information

Chapter 8 Software Testing. Chapter 8 Software testing

Chapter 8 Software Testing. Chapter 8 Software testing Chapter 8 Software Testing 1 Topics covered Introduction to testing Stages for testing software system are: Development testing Release testing User testing Test-driven development as interleave approach.

More information

Test-Driven Development (TDD)

Test-Driven Development (TDD) Test-Driven Development (TDD) CS 4501 / 6501 Software Testing [Lasse Koskela, Test Driven, Chapters 2-3] 1 Agile Airplane Testing Test harness: Appearance matches Color coding in place Fly 6ft (or 2m)

More information

Unit Testing as Hypothesis Testing

Unit Testing as Hypothesis Testing Unit Testing as Hypothesis Testing Jonathan Clark September 19, 2012 5 minutes You should test your code. Why? To find bugs. Even for seasoned programmers, bugs are an inevitable reality. Today, we ll

More information

Continuous Integration using Cruise Control

Continuous Integration using Cruise Control Continuous Integration using Cruise Control Presented By Tom Grant PlatinumSolutions, Inc. Thursday, April 14 th, 2005 What is Integration? Definition: the act of combining into an integral whole In software

More information

hw6, BFS, debugging CSE 331 Section 5 10/25/12 Slides by Kellen Donohue

hw6, BFS, debugging CSE 331 Section 5 10/25/12 Slides by Kellen Donohue hw6, BFS, debugging CSE 331 Section 5 10/25/12 Slides by Kellen Donohue Agenda hw4 being graded hw5 may be graded first, for feedback to be used on hw6 hw6 due next week Today hw6 BFS Debugging hashcode()

More information

Agile Testing Practices Good Food for all Teams

Agile Testing Practices Good Food for all Teams Agile Testing Practices Good Food for all Teams www.netobjectives.com info@netobjectives.com 1 January 30, 2007 Abstract Agile testing practices have evolved in part as a response to short duration cycles.

More information

Lecture 20: SW Testing Presented by: Mohammad El-Ramly, PhD

Lecture 20: SW Testing Presented by: Mohammad El-Ramly, PhD Cairo University Faculty of Computers and Information CS251 Software Engineering Lecture 20: SW Testing Presented by: Mohammad El-Ramly, PhD http://www.acadox.com/join/75udwt Outline Definition of Software

More information

csc444h: so(ware engineering I matt medland

csc444h: so(ware engineering I matt medland csc444h: so(ware engineering I matt medland matt@cs.utoronto.ca http://www.cs.utoronto.ca/~matt/csc444 tes2ng top- 10 infrastructure source code control including other types of testing reproducible builds

More information

No Source Code. EEC 521: Software Engineering. Specification-Based Testing. Advantages

No Source Code. EEC 521: Software Engineering. Specification-Based Testing. Advantages No Source Code : Software Testing Black-Box Testing Test-Driven Development No access to source code So test cases don t worry about structure Emphasis is only on ensuring that the contract is met Specification-Based

More information

Software Engineering I (02161)

Software Engineering I (02161) Software Engineering I (02161) Week 3 Assoc. Prof. Hubert Baumeister DTU Compute Technical University of Denmark Spring 2017 Contents Programming Tips and Tricks Booleans Constants Delegation Requirements

More information

Test-Driven Development JUnit

Test-Driven Development JUnit Test-Driven Development JUnit Click to edit Master EECS text 2311 styles - Software Development Project Second level Third level Fourth level Fifth level Wednesday, January 24, 2018 1 Unit Testing Testing

More information

Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation

Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation Yan Shi SE 2730 Lecture Notes Verification and Validation Verification: Are

More information

QUIZ. What is wrong with this code that uses default arguments?

QUIZ. What is wrong with this code that uses default arguments? QUIZ What is wrong with this code that uses default arguments? Solution The value of the default argument should be placed in either declaration or definition, not both! QUIZ What is wrong with this code

More information

HOW TO WRITE USER STORIES (AND WHAT YOU SHOULD NOT DO) Stuart Ashman, QA Director at Mio Global Bob Cook, Senior Product Development Manager, Sophos

HOW TO WRITE USER STORIES (AND WHAT YOU SHOULD NOT DO) Stuart Ashman, QA Director at Mio Global Bob Cook, Senior Product Development Manager, Sophos HOW TO WRITE USER STORIES (AND WHAT YOU SHOULD NOT DO) Stuart Ashman, QA Director at Mio Global Bob Cook, Senior Product Development Manager, Sophos Welcome This presentation will discuss Writing user

More information

Test-Driven Development (a.k.a. Design to Test) CSE260, Computer Science B: Honors Stony Brook University

Test-Driven Development (a.k.a. Design to Test) CSE260, Computer Science B: Honors Stony Brook University Test-Driven Development (a.k.a. Design to Test) CSE260, Computer Science B: Honors Stony Brook University http://www.cs.stonybrook.edu/~cse260 Person-hours Labor is sometimes measured in person-hours,

More information

Been testing software for over 10 years Started out as a Manual Tester Moved to Automation testing Now leading teams, defining quality in

Been testing software for over 10 years Started out as a Manual Tester Moved to Automation testing Now leading teams, defining quality in Been testing software for over 10 years Started out as a Manual Tester Moved to Automation testing Now leading teams, defining quality in organizations. Started as a reflection of how much software testing

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

CSE : Python Programming. Packages (Tutorial, Section 6.4) Announcements. Today. Packages: Concretely. Packages: Overview

CSE : Python Programming. Packages (Tutorial, Section 6.4) Announcements. Today. Packages: Concretely. Packages: Overview Announcements CSE 399-004: Python Programming Lecture 07: Packages, Command-line arguments, and Unit testing February 26, 2007 http://www.seas.upenn.edu/~cse39904/ No homework this week There may be one

More information

Verification and Validation

Verification and Validation Chapter 5 Verification and Validation Chapter Revision History Revision 0 Revision 1 Revision 2 Revision 3 Revision 4 original 94/03/23 by Fred Popowich modified 94/11/09 by Fred Popowich reorganization

More information