I've been a zone leader with DZone since 2008, and I'm crazy about community. Every day I get to work with the best that JavaScript, HTML5, Android and iOS has to offer, creating apps that truly make at difference, as principal front-end architect at Avego. James is a DZone Zone Leader and has posted 639 posts at DZone. You can read more from them at their website. View Full User Profile

Swing Extreme Testing

  • submit to reddit
Published by: Packt Publishing
ISBN: 1847194826

Reviewer Ratings




Buy it now

One Minute Bottom Line

The main stumbling block of Test Driven Development adoption has been the fact that user interfaces are considered difficult to test in an automated fashion. This book gives guidance to Java developers from the practical experiences of the author. This is one of the most important test focussed books, and one which I would highly recommend. There is a wide range of testing issues covered in this book and it is presented with full, relevant and useful examples. The methodology is clear and makes perfect sense.


The book kicks off with a very interesting list of roadblocks to getting software tested effectively. The fact that test is the last step in a waterfall process, that UI's are difficult to test and that testing is simply not interesting enough for developers.

Chapter 1 explains the Extreme Testing approach. Examples are brought in straight away along with discussion on what classes and methods should be tested, and which shouldn't. Lots of questions about a testing strategy for your project are addressed here.

Chapter 2 shows how to develop 'normal' unit tests - those not involving the UI. This is an important chapter for those who need a refresher on writing tests, or who wonder if tests can really be written first.

Chapter 4 introduces a key concept for the following chapters - the Cyborg class. This is a wrapper around the java.awt.Robot class which allowed the generation of native mouse and keyboard events in test programs. Wrapping Robot means that it is possible to write higher level commands, rather than simple keycode or coordinate commands.

Chapter 7 covers the UI wrapper class component. For every major UI component, a wrapper class is created with convenience methods to activate the controls in that component. It's a clever idea, explained in great detail in this part of the book. Chapter 8 builds on this by describing a method of finding the Swing components, followed immediately by a case study.

Subsequent sections cover the testing of a JavaHelp system, log files, multi-threaded applications and email. Overall, this book will give you a great insight into testing across all parts of your application.



Examples are used throughout the book, giving everything a concrete explanation.