BusterJs with RequireJs/Backbone

posted by Jake on

BusterJs is a still-in-beta library that allows for testing your Javascript. It's got a wealth of cool features. The browser capturing is awesome for running your Javascript directly in the browsers you choose from one runner. You can also execute within Node. In short, it rocks. But, how to get this rockin' with your project, specifically your AMD RequireJs with BackboneJs combo project is the lock that must be opened before daily buster love can be had.

PhantomJs meets Jasmine

posted by Bryan on

In developing a mobile web application, it would be ridiculous to avoid writing javascript unit tests. After all, they are simple to write and run. Recently, I implemented running our already existing Jasmine tests using PhantomJs and integrated this process into our continuous build environment. Works smooth!

Test-driven Development on MarkLogic

posted by Jake on

Unit testing is a required part of a healthy software development lifecycle and a balanced breakfast. But test-driven development is a rockin' part of an *awesome* development lifecycle. What's the difference? If you don't test-drive the dev of your MarkLogic XQuery, you may never come back to test again. Test-driven XQuery development will ease your headaches, put you into the plush seat of a developer with confidence, and rocket you down the road to making all your wildest dreams come true. Kachow!

Unit Testing XQuery on MarkLogic

posted by Jake on

Unit testing is a required part of a healthy software development lifecycle. Business logic in MarkLogic Xquery needs the same insurance of superb testing as any other language.

Principles: Come learn the motivation for unit testing and how test-driven development can increase your productivity writing solid Xquery code in an Agile-coding environment.

Skills: We'll code Xquery examples to learn general skills including the TDD workflow, how to isolate your code for unit testability, and how to test one thing at a time. In each case, we'll address how to apply these skills specifically to development in the MarkLogic ...

EasyMock Cause-Effect Exception Mapping

posted by Jake on

EasyMock is a great tool for separating external dependencies from unit tests. There is a learning curve to learning the mock method of testing, and unfortunately, EasyMock does not give very good prompts when you do something wrong. The exception messages are actually quite cryptic. This article is meant to be a crude mapping of exception output and the behavior that might have caused it. At least, this is a log of many of my experiences with EasyMock and how I usually get into the messes I do. It is quite possible that the same exception output could be had ...

Expose Fields via Java Reflection

posted by Jake on

For unit testing purposes, I often want to set field values in objects so that I can setup for the test conditions. One of most annoying things about testing is the urge to change code design for just the sake of testing -- especially if it's in a way that is considered less safe, like exposing elements or lessening accessibility. (This is not to say that trying to test code can reveal certain code smells and prompt refactoring). I, myself, have a number of setter methods with this comment prepended: "// for test only comments". Stinkers! Well, sometimes enough becomes enough ...