• Complain

Mark Ethan Trostler - Testable JavaScript

Here you can read online Mark Ethan Trostler - Testable JavaScript full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2013, publisher: OReilly Media, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Mark Ethan Trostler Testable JavaScript
  • Book:
    Testable JavaScript
  • Author:
  • Publisher:
    OReilly Media
  • Genre:
  • Year:
    2013
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Testable JavaScript: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Testable JavaScript" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

One skill thats essential for any professional javascript developer is the ability to write testable code. This book shows you what writing and maintaining testable javascript for the client- or server-side actually entails, whether youre creating a new application or rewriting legacy code.From methods to reduce code complexity to unit testing, code coverage, debugging, and automation, youll learn a holistic approach for writing javascript code that you and your colleagues can easily fix and maintain going forward. Testing javascript code is complicated. This book helps you simply the process considerably. * Get an overview of Agile, test-driven development, and behavior-driven development * Use patterns from static languages and standards-based javascript to reduce code complexity * Learn the advantages of event-based architectures, including modularity, loose coupling, and reusability * Explore tools for writing and running unit tests at the functional and application level * Generate code coverage to measure the scope and effectiveness of your tests * Conduct integration, performance, and load testing, using Selenium or CasperJS * Use tools for in-browser, Node.js, mobile, and production debugging * Understand what, when, and how to automate your development processes

Mark Ethan Trostler: author's other books


Who wrote Testable JavaScript? Find out the surname, the name of the author of the book and a list of all author's works by series.

Testable JavaScript — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Testable JavaScript" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Testable JavaScript
Mark Ethan Trostler
Beijing Cambridge Farnham Kln Sebastopol Tokyo Dedication For Inslee - photo 1

Beijing Cambridge Farnham Kln Sebastopol Tokyo

Dedication

For Inslee, Walter, and MichelleTrostlers Trostlers Trostlers Woo!

Special Upgrade Offer

If you purchased this ebook directly from oreilly.com, you have the following benefits:

  • DRM-free ebooksuse your ebooks across devices without restrictions or limitations

  • Multiple formatsuse on your laptop, tablet, or phone

  • Lifetime access, with free updates

  • Dropbox syncingyour files, anywhere

If you purchased this ebook from another retailer, you can upgrade your ebook to take advantage of all these benefits for just $4.99. to access your ebook upgrade.

Please note that upgrade offers are not available from sample content.

Preface

You have to test your code, so why not make the process as easy and painless as possible? Client-side JavaScript is especially difficult to test properly, as we have very little control over the environment within which our code runs. Multiple operating systems, multiple versions of operating systems, multiple browsers, and multiple versions of browsers, not to mention plug-ins, extensions, different languages, zoom levels, and who knows what else, all conspire to hinder the performance of our applications. These permutations slow down, break, crash, and eat our applications for lunch. Its a jungle out there! Server-side JavaScript gives us significantly more control, as by and large, we control the execution environment. However, Rhino and Node.js applications do not have the full gamut of mature tools, the testing procedures, and the ecosystem that other languages do. Further, the asynchronous nature of Node.js complicates testing. It is interesting that a language so intertwined with asynchronous execution has essentially zero built-in support for that mode of execution.

Regardless, testingespecially JavaScript testingis complicated. Our best shot at taming this complexity is to take full control of what we actually do control: the code. Code exists across a continuum, from someone elses to yours on one axis and from legacy to nonlegacy on the other.

What is legacy code? Im a fan of Michael Featherss definition in his excellent book, Working Effectively with Legacy Code (Prentice Hall): legacy code is code without tests. This code either will not survive or will never be touched by anyone. When the time comes to touch legacy code, it gets rewritten. Take a look at your current project; any code that does not have tests will likely be rewritten. Probably not by the author of the code, but by whoever is now tasked with dealing with iteither enhancing or bug-fixing it. Unless tests are written, this is dead code that will have to be rewritten. The code may be spectacular, but the only way it will survive is if it never causes bugs and if no one ever requests enhancements or new features for it. Even then, how happy are you to ship production code with no tests? Even if the code worked before, are you content to keep rolling the dice? Is your company, which owns the code, content to keep rolling the dice? Typically the piper must be paid, and this code will just get rewritten. Its too bad the company had to pay to have this possibly spectacular code written twice, but such is the case with legacy code.

As you can see in the matrix shown in , it is very easy for any legacy code youve written to fall into someone elses hands and be rewritten. That path is typically less painful than bringing someone elses legacy code up to speed with tests. It is very easy to move from side to side in this matrix, as code changes hands constantly, moving into and out of your purview with great agility. Moving down is the hardest path for code to take; writing tests for existing code is a job no one wants to do, and most people will go to impressively great lengths to avoid ittypically resulting in a complete rewrite.

Figure 1 Current versus legacy code Unfortunately moving up in this matrix - photo 2

Figure 1. Current versus legacy code

Unfortunately, moving up in this matrix happens with some regularity. Code that starts out with tests can lapse into legacy code if it falls into the wrong hands. Vigilance is required to keep tests up to date as more enhancements and features are bolted on, but this is a much simpler process than writing tests for code without any (or with very few) tests.

The Goal of This Book

This book aims to keep your JavaScript code in the lower-right quadrant of by taking a holistic approach to development. Its not just about writing tests or testing first, but rather understanding how the choices you make while coding, good and bad, will affect you (your code and your employment) down the road.

Starting with the good habits of structuring your code syntactically and semantically for testability, writing the right tests at the right times, running them regularly, and monitoring their results will keep you in that lower-right sweet spot in the matrix.

This book attempts to bridge the gap between sane development practices and JavaScript. JavaScript is a weird little language. Starting with its senseless name, JavaScript was originally used by nonprogrammers to add some interactivity to web pages. Even if real programmers used the language in its early days, the dynamics between the language, the DOM, and the browser environment took some getting used to.

As more and more professional programmers started working with the language, best practices began to be understood and codified. Tools for working with JavaScript, debuggers, test harnesses, IDE support, and more began to emerge. The language itself was modified using lessons learned from several years out in the wild. JavaScript was starting to grow, and grow up. But a lot of weirdness remains, and more powerful tools are still around the corner.

With the advent of server-side JavaScript via Node.js, PhantomJS and other applications can now be written entirely in JavaScript. Not too long ago, that was not only impossible, but also thought to be insane. No one is laughing now!

This book attempts to pull together lessons learned from decades of study and experience with testing and quality assurance (QA), and to apply those lessons to JavaScript. Almost all the examples and code snippets in this book are written in JavaScript (some Perl has snuck in there!).

Who This Book Is For

This books primary target audience is people who encounter JavaScript professionally. Beginning, intermediate, or guru-level developers are all welcome, as this book has something for everyone.

JavaScript may not be the only language you use, but you write or test significantly sized chunks of it. Someone is paying you (hopefully good!) money to wrangle JavaScript to run either in the browser or, lucky you, on the server. If you are dealing with JavaScript every day with an application of any size, this book is right up your alley.

This book is also for you if you are on a QA or tools team that must test JavaScript are right in your wheelhouse. This books aims to make testing as easy as possible, and then automate all of it. Hopefully, this book will make peoples lives easier. Thats just how I roll.

If you write only a little JavaScript, this book still has lots of good information for youespecially the chapters on complexity (). The remaining chapters still have good information within, mind you! But they probably do not directly address your pain points. A lot of pain has led to my writing this bookIve learned from previous mistakes and hard work, and so should you! Learning good habits from the start will make you much more productive and happy.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Testable JavaScript»

Look at similar books to Testable JavaScript. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Testable JavaScript»

Discussion, reviews of the book Testable JavaScript and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.