Book Image

Mastering ArcGIS Server Development with JavaScript

By : Raymond Kenneth Doman
Book Image

Mastering ArcGIS Server Development with JavaScript

By: Raymond Kenneth Doman

Overview of this book

Table of Contents (18 chapters)
Mastering ArcGIS Server Development with JavaScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Testing through code


These are all good reasons to create tests for your applications. Testing is one method of ensuring that your code does as expected. It defines clear use cases, with clearly defined, expected results. Testing also acts as a sort of project documentation. It tells other developers who work with the project how the code is supposed to behave.

Now that you understand why testing is important, let's look at the testing methodologies used by other developers over the years.

Unit testing

Unit testing is when individual components or modules of code are loaded into a testing framework and tested individually. Tests are developed and results are compared to expected values. For object-oriented programming, individual objects can be loaded and tested without having to wait for other components to load.

JavaScript objects and modules lend themselves well to unit testing. Developers can write scripts to load modules individually, pass values into functions and objects, and see what...