Category Archives: Testing

Testing Stripe.com WebHooks With Requestb.in

SignalLeaf uses Stripe.com for billing. One of the cool things it does is provide web hooks to get events so that you can have your system do things in response to those events. Examples of events include customer creation, customer … Continue reading 

Also posted in API, Runscope, SignalLeaf, Stripe | 1 Comment

Semantics, Modules And Testing: Why (And How) I Test Internal Components, Not Private Methods

I saw someone tweet about a new-ish JavaScript library called Autooc. recently. I had not heard of it, so I clicked the link to find out more. It looks like an interesting project. I’ll have to look at it further … Continue reading 

Also posted in AntiPatterns, Behavior Driven Development, CommonJS, Community, Javascript, Marionette, Modules, NodeJS, NPM, Principles and Patterns, Unit Testing | 1 Comment

Test styles and avoiding setup/teardown

Curious about NSpec, Amir Rajan posted a challenge that posited that NSpec can make your tests cleaner. The results are summarized here: https://gist.github.com/amirrajan/6701522 One thing that is in stark contrast with my tests: https://gist.github.com/jbogard/6690905 And the others is that I … Continue reading 

| Leave a comment

Run tests explicitly in xUnit.net

I’ve more or less ditched NUnit as my default automated testing platform in .NET, preferring the more sensible defaults of xUnit.net. Switching wasn’t so bad – it mostly involved moving setup/teardown methods to constructors/Dispose methods. One piece that was missing … Continue reading 

| Leave a comment

Strategies for isolating the database in tests

One of the keys to having maintainable tests are to make sure that tests are isolated and reproducible. For unit tests, this is easy as long as we stay away from global variables, static classes and in general global state. … Continue reading 

| Leave a comment

On Testing “Trivial Code”

I can’t resist jumping on the band-wagon and telling people that they’re wrong, so here goes… :D Mark “Ploeh” Seemann wrote a post on testing trivial code. There have been several responses saying he’s wrong and that you shouldn’t test … Continue reading 

Also posted in AntiPatterns, Principles and Patterns, Quality, Test Automation, Unit Testing | Leave a comment

Are your unit tests still hard to read ? – Should Assertion Library

I created the Should library to fill a gap in the testing ecosystem in the .Net space.  Simply put, I took what I liked about using extension methods to make a more readable set of assertions, but made the library … Continue reading 

Also posted in AntiPatterns, Model-View-Controller, Pragmatism, Principles and Patterns, Ruby | 6 Comments

Own Your Work

This post is mostly here to share a link. Jeremy Miller posted ‘“Code Complete” is a polite fiction, “Done, done, done” is the hard truth‘. Before clicking through I thought I was going to disagree. After reading through, I agree … Continue reading 

Also posted in .NET, Analysis and Design, AntiPatterns, C#, Model-View-Controller, Rails, Ruby, Security | 49 Comments

Testing with queries and repositories (a simple example)

Not being much of a fan of the Repository pattern, or better yet, not a fan of applying it as a universal data access strategy, one question that comes up often is “but what about testing”? But the question should … Continue reading 

| Leave a comment

JavaScript Unit Tests: Jasmine vs Mocha

Someone recently asked me whether I prefer Jasmine or Mocha for unit testing JavaScript. My answer is: Jasmine and Mocha are both great. I use both, depending on the project and team. There’s a great community around both, and you’ll … Continue reading 

Also posted in ChaiJS, Jasmine, Javascript, MochaJS, Unit Testing | 7 Comments