Unit Testing with FlexUnit. by John Mason mason@fusionlink.com



Similar documents
Slides prepared by : Farzana Rahman TESTING WITH JUNIT IN ECLIPSE

+ Introduction to JUnit. IT323 Software Engineering II By: Mashael Al-Duwais

JUnit. Introduction to Unit Testing in Java

Unit testing with JUnit and CPPUnit. Krzysztof Pietroszek

Unit Testing. and. JUnit

Automation of Flex Building and Unit Testing or Continuous Integration with Flex, FlexUnit, and Ant

Test Driven Development with Continuous Integration: A Literature Review

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

Unit Testing JUnit and Clover

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

Accelerate Software Delivery

Introduction to Agile Software Development. EECS 690 Agile Software Development

Effective unit testing with JUnit

Test Driven Development

Unit Testing webmethods Integrations using JUnit Practicing TDD for EAI projects

Introduction to Agile Software Development Process. Software Development Life Cycles

Continuous Integration Optimizing Your Release Management Process

Test-Driven Development

Introduction. Motivational Principles. An Introduction to extreme Programming. Jonathan I. Maletic, Ph.D.

Xtreme RUP. Ne t BJECTIVES. Lightening Up the Rational Unified Process. 2/9/2001 Copyright 2001 Net Objectives 1. Agenda

Continuous Integration: Aspects in Automation and Configuration Management

Workshop on Agile Test Strategies and Experiences. Fran O'Hara, Insight Test Services, Ireland

Agile Software Development and Service Science

JDemo - Lightweight Exploratory Developer Testing

Extreme Programming and Embedded Software Development

Author: Sascha Wolski Sebastian Hennebrueder Tutorials for Struts, EJB, xdoclet and eclipse.

Testing Rails. by Josh Steiner. thoughtbot

Software Construction

Testing Tools Content (Manual with Selenium) Levels of Testing

Using JUnit in SAP NetWeaver Developer Studio

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

Advanced Test-Driven Development

Test Driven Development Part III: Continuous Integration Venkat Subramaniam

Agile in Financial Services A Framework in Focus

Distributed Agile Development. Bapiraju Nandury Product Development Manager Bangalore Development Centre

Automated Integration Testing & Continuous Integration for webmethods

Know the Difference. Unified Functional Testing (UFT) and Lean Functional Testing (LeanFT) from HP

We ( have extensive experience in enterprise and system architectures, system engineering, project management, and

Unit Testing and JUnit

Web Applications Testing

How To Model In An Agile World

What Does Large Mean? Copyright 2003 by N. Josuttis and J. Eckstein 3. Why is Large an Issue?

Testing, Debugging, and Verification

Agile Software Development and Service Science

Testing and Quality in Agile Development Speaker: Allan Watty Company: ABB Inc Website:

Automated Web Applications Testing

Agile.NET Development Test-driven Development using NUnit

Introduction to extreme Programming (XP)

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

Test-Driven Development as a Defect-Reduction Practice

Agile QA s Revolutionary Impact on Project Management

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

Unit Testing & JUnit

Comparative Analysis of Various Automated Test Tools for Flex Application

Functional UI testing of Adobe Flex RIA. Viktor Gamov August,

Continuous Integration: Put it at the heart of your development

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

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

Barely Sufficient Software Engineering: 10 Practices to Improve Your Research CSE Software

Python as a Testing Tool. Chris Withers

Agile Software Development in the Large

Java course - IAG0040. Unit testing & Agile Software Development

Maximizing the value of good testing practice in an Agile environment. Delivering on time, in scope, on budget and at the right level of quality

OpenMake Dynamic DevOps Suite 7.5 Road Map. Feature review for Mojo, Meister, CloudBuilder and Deploy+

PHPUnit Manual. Sebastian Bergmann

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

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

JOSHUA GANDERSON : Senior Web Application Developer jag@josh.com

Comparing Agile Software Processes Based on the Software Development Project Requirements

Performance Testing from User Perspective through Front End Software Testing Conference, 2013

Quality Cruising. Making Java Work for Erlang. Erik (Happi) Stenman

Continuous Delivery. Alejandro Ruiz

D25-2. Agile and Scrum Introduction

Ingegneria del Software Corso di Laurea in Informatica per il Management. Agile software development

Software Engineering I (02161)

Agile and Secure: Can We Be Both?

Test Driven Development

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

AgileSoftwareDevelopmentandTestingApproachandChallengesinAdvancedDistributedSystems

A Survey of Evidence for Test Driven Development in Academia

Agile Web Application Testing

An Overview of Agile Testing

An Initial Investigation of Test Driven Development in Industry

Transcription:

Unit Testing with FlexUnit by John Mason mason@fusionlink.com

So why Test? - A bad release of code or software will stick in people's minds. - Debugging code is twice as hard as writing the code in the first place. - It's your job!

Where did TDD come from? Extreme Programming - Software Engineering Methodology - First propsed by Kent Beck in March 1996 from the Chrysler Comprehensive Compensation System (C3) - Wrote Extreme Programming Explained in Oct 1999

From Existing Practices -NASA, "test first" practices -Leo Brodie Thinking Forth published in 1984, advocating a bottom up and incremental design pattern

Some items that XP advocated.. -UML designs -Source control -Pair Programming -Test driven development with Unit Testing -just to name a few, IXP has currently 23 practices listed..

Several layers to Software Testing Application layer -Acceptance Testing -testing a completed product before transfer of ownership If by the customer.. -Beta Testing -User Acceptance testing (w If by the vendor.. -Release Acceptance -QA Testing

Several layers to Software Testing Application Layer -Usability Testing - Selenium, http://wiki.openqa.org - AutoTestFlash, http://osflash.org/autotestflash System Layer -Load Testing - Grinder, http://grinder.sourceforge.net/

Several layers to Software Testing Code Layer -Unit Testing -test the core logic of the software coding

Unit Testing -Unit Testing -test functionality of a single class or unit -Test Driven development (TDD) -write the tests first then write the code -Continuous Testing -runs all the unit tests during a build or SVN update -let's the automated tools to the heavy lifting -Continuous Integration (CI) -Continuous Testing among a team -Cruise Control - http://cruisecontrol.sourceforge.net

Unit Testing Frameworks -JUnit -SQLUnit -tsqlunit -CFUnit -CFCUnit -ASUnit -FlexUnit -Just about every language as a UT framework

FlexUnit -It's actually a bad name for it. -Tests any AS3 class used in either Flash, Flex or AIR -the front end GUI display is written in Flex -can be run via Flex Builder/browser, Command-Line and ANT

Common Elements of any UT -assertions, the list of expected results - assertequals() - assertfalse() - assertnotnull() - assertnotundefined() - assertnull() - assertstrictlyequals() - asserttrue() - assertundefined()

Common Elements of any UT Test Fixture -any properties or objects that need to be initialized to run the test -Two common methods - setup() - teardown()

Common Elements of any UT Test Case - the smallest unit - tests for a particular response

Common Elements of any UT Test Suite - A collection of Test Cases

Common Elements of any UT Test Runner - calls the tests and displays the results - starttest()

Common Elements of any UT Test Harness - automated scripting to run the tests

Difference with FlexUnit from CFUnit - ActionScript has an Asynchronous behavior - Unless you tell FlexUnit that you are expecting an asynchronous event, your test may yield a false positive. -FlexUnit has a addasync() function to handle this -Daniel Rinehart has a blog post on this.. -http://life.neophi.com/danielr/2007/03/asynchronous_testing_with_flex.html

Another important note.. One test case is never enough.. You need to test for.. -Good data -Bad data -Edge cases

Let's look at some code!

Continuous Integration (CI) - Uses the JUnit report - Throws it to CruiseControl - http://cruisecontrol.sourceforge.net

Conclusion -Some Unit Testing is better than none -Unit Testing is only as good as you make it -It needs to be integrated into your development process -A good idea to include the Unit Testing classes in your SVN repository -You computer can automate a lot of the heavy lifting -You actually do have time to do testing!

Recommended Reading Pragmatic Programmers Series http://www.pragmaticprogrammer.com Code Complete, Steve McConnell Writing Effective Test Cases, Alistair Cockburn http://www.extremeprogramming.org http://www.martinfowler.com/

Recommended Reading Unit Testing Frameworks http://cfunit.sourceforge.net/ http://www.cfcunit.org/cfcunit/ http://www.asunit.com/ http://code.google.com/p/as3flexunitlib/

Recommended Reading Flex and Ant http://weblogs.macromedia.com/pmartin/archives/2006/06/flexunit_ant.cfm - Peter Martin Continuous Integration Cruise Control - http://cruisecontrol.sourceforge.net/index.html

Thanks for coming! For any additional questions or comments.. - Email: mason@fusionlink.com - Source code and examples on labs.fusionlink.com