test driving your s-wing

14
Test Driving Your S-Wing By Patrick Kua emailpat <at> thekua.com || pkua <at> thoughtworks.com

Upload: rose-hudson

Post on 30-Dec-2015

33 views

Category:

Documents


3 download

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

Page 1: Test Driving Your S-Wing

Test Driving Your S-Wing

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

thoughtworks.com

Page 2: Test Driving Your S-Wing

The The AgendaAgenda

Page 3: Test Driving Your S-Wing

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

Page 4: Test Driving Your S-Wing

Writing Acceptance Tests

Page 5: Test Driving Your S-Wing

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

unsaved changes

Confirm Exit

Page 6: Test Driving Your S-Wing

VS

SourcSourcee

TestTest

Page 7: Test Driving Your S-Wing

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());}

Page 8: Test Driving Your S-Wing

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…

Page 9: Test Driving Your S-Wing

Glue

Presenters

Views

How it all works (Yawn… I mean Architecture)

Layout Managers

Repository

Page 10: Test Driving Your S-Wing

Implementing Confirmation of Exit

Actually Exit

Page 11: Test Driving Your S-Wing

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

Page 12: Test Driving Your S-Wing

Robust Acceptance

Tests

Page 13: Test Driving Your S-Wing

Top Tips

Page 14: Test Driving Your S-Wing

Questions?

The resources for this presentation can be found at:

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