Book Image

Ext JS Application Development Blueprints

Book Image

Ext JS Application Development Blueprints

Overview of this book

Table of Contents (18 chapters)
Ext JS Application Development Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Testability


As with many aspects of software development, there are many different ways of testing. Some will advocate a test-first methodology, where the tests are created first and the code will be written to satisfy these tests. Whichever method is used, we need to take steps to make sure our code can be tested. While this occasionally means adding in some helpful hooks and tricks that are only used to test, we should generally try to avoid this approach and look to write code that is naturally testable; this will often have the fortunate consequence of being better code too.

Sometime back, we talked about selectors and their relationship to testability. Let's look at the selector that Chrome Developer Tools gave us:

#gridview-1014-record-6 > tbody > tr > td > div 

This is a very specific selector and the first part of it is using an ID that was autogenerated by Ext JS. As soon as we add or alter the component hierarchy of the application or change the records being displayed...