Test Driving Swing Cheat Sheet

Reviews
Shared by: armani11
Stats
views:
345
rating:
not rated
reviews:
0
posted:
11/9/2008
language:
English
pages:
0
Cheat Sheet on Test Driving Swing Basic Principles: • Avoid the UI Layer where possible • Break down UI components into smallest units possible Model View Presenter Extremely thin layer Each method should be one line of delegation Expose callbacks to register event listeners Maintain state about view Understand which views get updated Only interact with a view of an interface Do most of the work Composed by Patrick Kua (pkua@thoughtworks.com) for Javazone 2006 Views Presenters Acceptance Test Patterns • Fixtures o Describe each significant screen (LoginDialog) with things you can do on each screen. o Use terms that the business uses to describe the things on the screen o Implemented using libraries internally to find existing swing components • Threading o Wrap SwingUtilities in an interface (EventQueue) and another implementation can be used in unit tests to provide consistently predictable results • Be Careful Of o Swing having side effects – frames are not disposed until we stop the JVM – so state may be inconsistent until the application finishes Test Driven Development • Acceptance Tests (1) may spawn multiple unit integration tests and will spawn multiple unit tests • Use the Acceptance Test to drive out other tests • Split types of tests physically as well as run them separately (faster running ones first) • Requires high discipline • Driven by a User Story or a Use Case • Refactor to make code Tips more readable and draw – Small views are better out other design patterns – Name every important UI component • Takes practice Is used to tie the View and Presenters together Threading typically handled here Glue Assemble views into the final layout. Externalised from each view Layout Managers Used by the presenters and might be injected into the presenter Core part of the domain Rich models for business logic Model – Need several types of groups of tests (acceptance or end-to-end, unit integration, and pure unit tests) – Layout generally not worth automated regression testing

Related docs
Driving Permit Test
Views: 6779  |  Downloads: 28
Shit Test Cheat Sheet
Views: 54  |  Downloads: 1
Driving
Views: 1  |  Downloads: 0
Java Cheat Sheet
Views: 39  |  Downloads: 9
Java Cheat Sheet
Views: 128  |  Downloads: 20
New Cheat Sheet
Views: 7  |  Downloads: 1
Cardiology Cheat Sheet
Views: 368  |  Downloads: 25
Contracts Cheat Sheet
Views: 424  |  Downloads: 15
Cheat Sheet
Views: 93  |  Downloads: 7
Cheat Sheet
Views: 6  |  Downloads: 0
Cheat Sheet
Views: 104  |  Downloads: 0
premium docs
Other docs by armani11
Ingram Micol Inc Ammendments and Bylaws
Views: 99  |  Downloads: 0
Knight-Ridder Inc Ammendments and Bylaws
Views: 183  |  Downloads: 3
6 Good Reasons to Write an Article
Views: 535  |  Downloads: 0
Credit-Ask A Vendor For Credit Letter
Views: 290  |  Downloads: 6
southgate-all
Views: 644  |  Downloads: 4
Board First Meeting Minutes California
Views: 266  |  Downloads: 12
ADDRESS BOOK
Views: 482  |  Downloads: 14
Apple Computer Inc Ammendments and By laws
Views: 220  |  Downloads: 3
Standard Sample of Net Office or Industrial Lease
Views: 614  |  Downloads: 29
Sexual harrassment aids
Views: 367  |  Downloads: 14
Berkshire Hathaway Inc Ammendments and By laws
Views: 256  |  Downloads: 3