Fail early, fail often, succeed sooner!

Similar documents
CPSC 330 Software Engineering

Agile.NET Development Test-driven Development using NUnit

JUnit. Introduction to Unit Testing in Java

<Insert Picture Here> What's New in NetBeans IDE 7.2

Continuous Integration with Jenkins. Coaching of Programming Teams (EDA270) J. Hembrink and P-G. Stenberg [dt08jh8

Break It Before You Buy It!

The Hitchhiker's Guide to Mobile Apps Test Automation Galaxy

Introduction to C Unit Testing (CUnit) Brian Nielsen Arne Skou

Unit Testing webmethods Integrations using JUnit Practicing TDD for EAI projects

Software Construction

Test-Driven Development

Testing Automation for Distributed Applications By Isabel Drost-Fromm, Software Engineer, Elastic

Code Quality Assurance. Peter Kofler, Code Cop FH Technikum Wien, February 2010

Agile Web Application Testing

XP & Scrum. extreme Programming. XP Roles, cont!d. XP Roles. Functional Tests. project stays on course. about the stories

Case Studies of Free Test Tools Successful Test Tool Use without a Big Budget

How To Be Successful At An Agile Software Engineering

Test-Driven Development. SC12 Educator s Session November 13, 2012

Software Continuous Integration & Delivery

Open Source HTTP testing tool. Stefane Fermigier

Agile So)ware Development

JavaScript Applications for the Enterprise: From Empty Folders to Managed Deployments. George Bochenek Randy Jones

Name of chapter & details

Test-Driven Development of Ajax enabled web applications on the Java platform

Testing: Python, Java, Groovy, etc.

Test Driven Development Part III: Continuous Integration Venkat Subramaniam

Benefits of Test Automation for Agile Testing

Agile Techniques and Tools. White Paper

Continuous Integration

Test Driven Development

Agile Testing Intelliware Development Inc. BC

Introduction and Agenda

NXTware Remote. Advanced Development and Maintenance Environment for OpenVMS and other Strategic Platforms

In depth study - Dev teams tooling

XP and TDD. Extreme Programming and Test Driven Development. Bertrand Meyer, Manuel Oriol Andreas Leitner. Chair of Software Engineering ETH Zurich

Approach of Unit testing with the help of JUnit

RUnit - A Unit Test Framework for R

Test-Driven Development and Unit Testing with Parasoft Concerto

Best Practices for Improving the Quality and Speed of Your Agile Testing

Unit Testing with zunit

Test What You ve Built

Unit testing with JUnit and CPPUnit. Krzysztof Pietroszek

Description. Benefits. Requirements. Selection process. Duration

Continuous Integration

Software Engineering. Top-Down Design. Bottom-Up Design. Software Process. Top-Down vs. Bottom-Up 13/02/2012

Using Agile with Large, Geographically Dispersed Development Teams

Unit Testing & JUnit

Jenkins Continuous Build System. Jesse Bowes CSCI-5828 Spring 2012

sveltest: A testing language

The Importance of Continuous Integration for Quality Assurance Teams

Integrated Error-Detection Techniques: Find More Bugs in Java Applications

Testing. Chapter. A Fresh Graduate s Guide to Software Development Tools and Technologies. CHAPTER AUTHORS Michael Atmadja Zhang Shuai Richard

}w!"#$%&'()+,-./012345<ya

Coding in Industry. David Berry Director of Engineering Qualcomm Cambridge Ltd

Automating Functional Tests Using Selenium

Advanced Software Testing

the first thing that comes to mind when you think about unit testing? If you re a Java developer, it s probably JUnit, since the

A Quick Overview of Software Engineering. Paul Klint

Licensed for viewing only. Printing is prohibited. For hard copies, please purchase from

Test (Automation) for Mobile Phone Applications for StarEast 2011

Expert PHP 5 Tools. Proven enterprise development tools and best practices for designing, coding, testing, and deploying PHP applications.

Chapter 8 Software Testing

Chapter 5. Regression Testing of Web-Components

Continuous Integration: Improving Software Quality and Reducing Risk. Preetam Palwe Aftek Limited

How To Write Unit Tests In A Continuous Integration

EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH CERN ACCELERATORS AND TECHNOLOGY SECTOR

Automated Testing Options for PL/SQL Steven Feuerstein PL/SQL Evangelist, Quest Software

Using JUnit in SAP NetWeaver Developer Studio

Making Test Automation Work in Agile Projects

Agile Testing (October 2011) Page 1. Learning Objectives for Agile Testing

Crowdsourcing suggestions to programming problems for dynamic web development languages

Implementing Continuous Integration Testing Prepared by:

No no-argument constructor. No default constructor found

DRUPAL CONTINUOUS INTEGRATION. Part I - Introduction

Live Specifications: From Requirements to Automated Tests and Back

TAPE. Test Code Adaptation Plugin for Eclipse. Lehmia Kiran Department of Computer Sciences NUCES-FAST Lahore, Pakistan

Course Catalog for QA Software Testing Training

TSG Quick Reference Guide to Agile Development & Testing Enabling Successful Business Outcomes

Introduction to Automated Testing

The AppSec How-To: 10 Steps to Secure Agile Development

Continuous Integration

Testing Tools Content (Manual with Selenium) Levels of Testing

Chapter 9 Software Evolution

Java Software Quality Tools and techniques

Test Automation Integration with Test Management QAComplete

A Practical Guide to Test Case Types in Java

RUP. Development Process. Iterative Process (spiral) Waterfall Development Process. Agile Development Process. Well-known development processes

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University

Tools, Trends and Techniques for Developing Scientific Software

White Paper. Software Development Best Practices: Enterprise Code Portal

Continuous Integration

Software Engineering. So(ware Evolu1on

4. Test Design Techniques

TE TER. Continuous testing and delivery. number 21. SUBSCRIBE It s FREE for testers. Including articles by: Roy de Kleijn Polteq.

Rake Task Management Essentials

Automated Integration Testing & Continuous Integration for webmethods

Bridging the Gap Between Acceptance Criteria and Definition of Done

Experimental Comparison of Concolic and Random Testing for Java Card Applets

Atomate Development Process. Quick Guide

Topics in Website Testing. [Reading assignment: Chapter 14, pp ]

Transcription:

Fail early, fail often, succeed sooner!

Contents Beyond testing Testing levels Testing techniques TDD = fail early Automate testing = fail often Tools for testing Acceptance tests

Quality Erja Nikunen 3

Testing in different levels Unit testing Does a single object work? Integration testing Do multiple objects work together? Functional testing Does my application work? Acceptance testing Does the customer like my application? Regression testing Does a bug fix result in another fault in the application? Erja Nikunen 4

Techniques used in testing: white-box testing You know the code and you do your best to break the code grey-box testing You peek a little inside, e.g. know the architecture black box testing Focuses on input and output Erja Nikunen 5

Fail early i.e. Test-Driven Development practice Write a Test Case --> Watch it Fail --> Fix it --> Watch it pass --> Refactor the code Red Write a test to fail Tidy up, eliminate redundancies Refactor Green Make the code work Erja Nikunen 6

All failing Order of tests! Erja Nikunen 7

Pros and cons of TDD Writing tests first require you to really consider what you want from the code Creates a detailed specification (you understand the problem better) Less time spent in the debugger and when it is required you usually get closer to problem quickly Tells you whether your last change (or refactoring) has broken previously working code Allows the design to evolve and adapt to your changing understanding of the problem. Unit tests are simple and act as documentation for the code Improves quality and reduces bugs It s hard to learn and master You have to accept that some of the tests become obsolete (you have to delete them) You trust too much on your tests (remember: they are code just like any other code) You might try to fix the tests to show green by making ad hoc decisions forgetting to solve the real problem Erja Nikunen 8

Fail often i.e. test automation Automate the tests, and the tests can be run whenever Automate the tests, and free developers time to more challenging problems Automate the tests, and run them on a separate server not in the developer s setup Automate the tests, and you get a regression test suite Erja Nikunen 9

Fail often i.e. continuous integration Erja Nikunen 10

Continuous integration Continuous integration wraps version control, compilation and testing into a single repeatable process CI is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Erja Nikunen 11

Continuous integration server like Jenkins An example of a build history of a project Erja Nikunen 12

Continuous integration server like Jenkins Shows how tests are succeeded in separate builds Shows for example FindBugs static analyzer trend Dm: Found reliance on default encoding in sofa.model.mapbuilder.loadmap(): Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly. Erja Nikunen 13

Tools for unit testing There are hundreds of tools for different levels of testing One popular family is <x>unit family for different programming languages: Junit, Cunit, CppUnit, PHPUnit, PyUnit, JsUnit,. This family can be used for unit testing but also for integration testing/ functional testing Erja Nikunen 14

Unit Test Types Basic -- cases with small to medium sized inputs that are so simple they should obviously work. Calling every method in several ways Call assertequals(x, y) also in case it returns false Edge -- these are also cases that are simple but represent edge conditions -- the empty string, the empty list, etc. Advanced -- harder, more complex cases. Testing e.g. using the knowledge about the code, synchronization, complex algorithms, Erja Nikunen 15

<x>unit All of the <x>unit family of testing libraries rely on test cases where you basically make a proposition or claim of the behaviour of the program. You claim that if your programs gets a certain input, it will give back an output you want. These are called assertions. Junit is introduced in the Java testing session assertequals("testing clear ", 0, <calling clear and showing result>); Erja Nikunen 16

Assertions (many more available) fail(string message) Gives a message that test didn t go through asserttrue(string message, boolean condition) Checks if the condition is true assertfalse(string message, boolean condition) Checks if the condition is assertequals(object expected, Object actual) Checks if the parameters expected and actual have equal values Erja Nikunen 17

C and C++ CodeLite and Code::Blocks IDE s are introduced in the C testing session CodeLite has integrated UnitTest++ and this will also be introduced in C testing session CodeLite is not <x>unit family but has something similar: CHECK_EQUAL(10, i); CHECK_EQUAL("foo", str); 14.5.2013 Erja Nikunen 18

Acceptance testing Acceptance tests are black box test cases that are jointly written by a developer and a customer. An acceptance test is a concrete situation, or scenario, that the system might encounter when using the functionality of a user story. Erja Nikunen 19

Summary Change your perspective from developer to tester! Write tests as early as possible! Automate your testing as much as possible! Erja Nikunen 20

Further reading Head First Software Development, By: Dan Pilone & Russ Miles Publisher: O'Reilly Media, Inc. http://www.agiledata.org/essays/tdd.html by Scott W. Ambler The Art of Agile Development: Test-Driven Development by James Shore http://www.jamesshore.com/agile- Book/test_driven_development.html And many many more. Erja Nikunen 21

Questions?