Test Driving Your S-Wing

Post on 30-Dec-2015

27 views 3 download

Tags:

description

Test Driving Your S-Wing. By Patrick Kua emailpat thekua.com || pkua thoughtworks.com. The Agenda. Unit Integration Tests x 10. Unit Tests x 100s. 0010110101010110 1010001011010101 1010100010110101 0101101010001012 1010101011010100 1011010101011100 1010001011000010. Code. - PowerPoint PPT Presentation

Transcript of Test Driving Your S-Wing

Test Driving Your S-Wing

By Patrick Kuaemailpat <at> thekua.com || pkua <at>

thoughtworks.com

The The AgendaAgenda

Developer LoopDeveloper Loop

Acceptance Tests x1Acceptance Tests x1

Unit Tests x 100sUnit Tests x 100s

Unit Integration Tests x 10Unit Integration Tests x 10

0010110101010110

1010001011010101

1010100010110101

0101101010001012

1010101011010100

1011010101011100

1010001011000010CodeCode

Writing Acceptance Tests

As an author I would like to be prompted for confirmation on exit so that I do not lose any

unsaved changes

Confirm Exit

VS

SourcSourcee

TestTest

public void testOnExitIAmAskedForConfirmation() { MainApplication application =

TestHelper.getMainApplication(); ConfirmationDialog dialog = application.clickExit(); assertNotNull(dialog); assertEquals(“Are you sure you want to Exit?”, dialog.getMessage()); dialog.clickCancel(); assertTrue(application.isShowing());}

How To Implement

• No Frameworks (yay!)• Model View Presenter• Test Things Only Worth Testing• Unit Test as Much as Possible• Code Changes Based on Tests• Demonstration…

Glue

Presenters

Views

How it all works (Yawn… I mean Architecture)

Layout Managers

Repository

Implementing Confirmation of Exit

Actually Exit

Abbot & Costello

http://abbot.sourceforge.net/

Alternatives include:

• Marathon Man– http://marathonman.sourceforge.net

• Jemmy (Netbeans)– http://jacareto.sourceforge.net

• Jacreto– http://jacareto.sourceforge.net

• JFC Unit– http://jfcunit.sourceforge.net

• Pounder– http://pounder.sourceforge.net

Robust Acceptance

Tests

Top Tips

Questions?

The resources for this presentation can be found at:

http://www.thekua.com/conferences/xp2006