Blog

Category Filtering: 'unit-testing'

27
May 2015

Gavin Pickin

Post Conference - Session Review - Getting your hooks into Cordova- Workflows and Build Helpers

Android, cfObjective, Cordova / Phonegap, Dev.Objective, Ionic, Javascript, Mobile Development, Node.js, Unit Testing

May 15th, 2015 was the last day of dev.Objective(), and the last session of the day had some great topics, “Devops: journeyman to infrastructure mastery”, ‘Marketing for Developers’, ‘Level Up your Javascript: Understanding the confusing bits’, ‘Web sockets, yes they can do that too', and my session, ‘Getting your Hooks into Cordova - Workflows and Build Helpers'. With mobile and hybrid development really growing into a track of its own, I decided to submit this topic, as I believe Cordova Hooks are a big part of Cordova mobile develop, they save me hours every week, and they are relatively unknown if you search for blog posts about them. When the session was accepted, I took that as a challenge to up my game and really research hooks, and make my presentation a complete resource.

21
May 2015

Gavin Pickin

dev.Objective() is over, returning back to normal life.

CFML Language, cfObjective, Conferences, Dev.Objective, Javascript, Mobile Development, Unit Testing

dev.Objective() conference held last week in Bloomington MN, with IntoTheBox the day prior, was a great geek week as I like to put it. Of course a conference is most importantly there to give you information to grow and learn, but networking is a close second, and it was great to catch up with friends, and make some new ones at the same time.I was lucky enough to be picked to present not one, but two sessions this time, which adds a weight to your shoulders, but is great to give back, and be on the other side of things.

16
March 2015

Gavin Pickin

Speaking at Dev.Objective() x 2 - Cordova Hooks and Testable JavaScript

cfObjective, Conferences, Cordova / Phonegap, Dev.Objective, Javascript, Lucee, Mobile Development, Unit Testing

Dev.Objective() is the 10th year of cf.Objective() rebranded to describe the 5 track professional developer conference more accurately ( more info here).  Still hosting a large number of ColdFusion topics, and a lot of the normal speakers, the content again is simple amazing. Technology is changing and so is this conference, and I am happy to say, that not one, but two of my sessions have been picked for this years Dev.Objective() this May, 12-15th in Bloomington, Mn. 
As usual, my work fuels my blog, and my ideas for sessions, and this year is no different. Lately I have been focusing on Javascript with my Mobile Development, and I have come a long way, compiling knowledge as I go. I think both of these topics are great combinations of all the solid content out there, all in one place to get someone up and running quickly. I was surprised to get both accepted, more work than I was expecting, but I like a challenge, and work well under the gun, so its going to be fun knocking these out. If you are thinking about what conference to attend, you can’t do much better than this one.

22
January 2014

Gavin Pickin

Unit Testing - Online Learning - Great way to understand Dependency Injection

Angular, Dependency Injection, Online Interactive Learning, Unit Testing

We've done a lot lately with Unit Testing, and one of the items we touched on, only briefly, in the scheme of things, was Dependency Injection, and why it is a good practice to use. We also discussed why a Dependency Injection framework like ColdBox's WireBoxSean Corfield's DI/1 from Framework/1, and Coldspring from the XML days are a great benefit, especially as your app gained momentum and size. 

I explained it here, and although I only touched on it, I know Dependency Injection is not an easy concept to grasp, the funny thing, once you actually do it, you think to yourself, wow, thats not complicated at all. Yesterday I blogged about the great videos available online at youtube for Angulars Conference ng-conf, and one of the ones I watched about Dependency Injection was priceless... so todays post is going to discuss that video, and then let you watch the video, and everything will click (I hope).

17
January 2014

Gavin Pickin

Unit Testing 06 - Mocking External Dependencies Part 2

Dependency Injection, Unit Testing

Welcome back to the 6th post in our Unit Testing for Dummies Series, where I walk you through building a small ColdFusion (cfml) application using Test Driven Development, running our tests with TestBoxOrtus Solutions and ColdBox's testing platform. 

Last time we created our WebsiteDAO.cfc and a simple method getWebsite() that would return a query containing the Website Details. In our method, we returned only an empty query at this time, since we are still fleshing out our App, as we explore through our Test Driven Development. Today, we're going to use Mocks to isolate our CUT component under test, which is our Website.cfc (website service). 

09
January 2014

Gavin Pickin

Unit Testing 05 - External Dependencies and Dependency Injection

Dependency Injection, Unit Testing

Our last post was an introduction into what is Mocking, and why we Mock in Unit Testing. We looked at Mocking an dependency of one function on another function internal to our CUT component under test. In this post, we're going to look at dependencies of our function on other objects and functions, and how we use Dependency Injection, or Inversion of Control to give our Website service object access to our WebsiteDAO.

08
January 2014

Gavin Pickin

Unit Testing 04 - Testing with Dependencies

Unit Testing

Welcome back to our Getting Started with Unit Testing - Unit Testing for Dummies you might say, and we're onto our fourth post. We have covered setting up our ColdFusion project (with files on Github) and added TestBox as our Testing FrameworkWe wrote a couple of TDD tests for our objects, and then wrote the objects to pass them.  Then we did some more TDD by writing a more complex test with 10+ assertions, and walked through building our object function to pass the test

Today we're going to look at methods / functions which have dependencies on other objects. Up to this point we have passed information into our methods / functions, which means it is easy to control the test of those methods / functions. Remember that one of the keys to Unit Testing is that we want to isolate each UNIT of code so it is independent of others Units. This obviously becomes more difficult when the code itself is obviously dependent on other components / objects, so we'll look at how to deal with that.

02
January 2014

Gavin Pickin

Unit Testing 03 - More TDD - Building out our Component Objects

Unit Testing

The first couple of Unit Testing posts have got us setup with TestBox and we have written our first real tests for our components. Now it is time to build up our components even more, and in the TDD way, we'll create a few specs, create the tests, then build the methods in our components to pass the tests.

If you haven't followed along, you can go back to Unit Testing 01, and Unit Testing 02, and get the files from my github repo, and then follow along. Step 0 is our base, where we left off from last time, Step 1 is about to begin for blog post 03.

24
December 2013

Gavin Pickin

Unit Testing 02 - TDD - Lets Write Tests for our Objects, then Build them to Pass the Tests

Unit Testing

So we're back for another post in my Getting Started with Unit Testing. In the first post, we got our Testing Environment Setup, so we could browse to our project, then to the first blog, and the first step in that blog, where we could see we had 2 Test Bundles (or Suites) with 1 dummy test in each, copied from the documentation. 

In this post, we're going to remove those dummy or sample tests, and actually write some tests for our new objects. Our objects are actually empty so far, so we'll write some tests, then test them, they'll fail, and then we'll add some code to our objects, to get them to pass. This all part of the Test Driven Development process. I will not explain the pros and cons here in detail, but in short, if you write your tests to cover your specifications, and edge cases, your code will always be better, you can maintain it easier because all of your tests are there, for any member of the team (whether they know the specs and or edge cases) and because your code has to be testable, it should be shorter, single function methods, and just more DRY in general.

22
December 2013

Gavin Pickin

Unit Testing 01 - Setting up my Testing Environment to Test Unit Testing

Unit Testing

Getting Started with Unit Testing is my new Series to help myself, and you, get started with Unit Testing. I am definitely not an expert, but as I go through this process, I'll try and learn and share my experiences, so we can add to the number of ColdFusion and CFML developers using Unit Testing, like they should. Today is the first in the series, so its not that exciting, just mainly a lot of setup.

Ok, so I'm going to start doing some Unit Testing, and I'm going to test my unit testing, with my Test Environment. In english, I'm going to setup a play site, so I can walk through setting up a site with the sole purpose of creating Unit Tests, and I'll install TestBox and play with MxUnit Compatible tests, and some BDD (Behavior Driven Development) test style too.

Blog Search