An Old Trope

February 27, 2015

Not a very long time ago,
in a repository not particularly far away....

It is a period of automation and obsolescence.
Sitecore developers committing
code, day and night, globally.
Spiraling like the arms of a galaxy
sharing tasks, techniques and trade-craft.

During the past few months
I've been developing my 
ultimate tool, the TestStar
A sitecore module with enough
power to test an entire platform.

In pursuit of stability whose breadth
and depth I've not yet known.
To restore freedom for productivity to all.

 

Far Out On The Outer Rim of the Galaxy...

I've reached the end of a long road. I've been building and rebuilding a testing tool for myself for roughly four years now. It began as a web testing Visual Studio project, then morphed into a stand-alone web application with batch script support and unit testing running against NUnit. It has now has grown into a Sitecore module that installs as a web site and can be run from Powershell scripts.

The battle station is heavily shielded and carries a firepower greater than half the starfleet. In it's core reactor system is a set of manager classes that you can request to run tests. I do this through a web service call from javascript. It allows me to run them single-file and post the results as they're completed, giving quick user feedback in the event (especially while web testing) that your system is throwing errors. It also allows me to call the web service from a Powershell script. In this way, tests are running in a Sitecore instance with access to stored information that you can test with, such as IP addresses, language codes and redirect domains.  

The draw for me is that it provides a framework for unit and web testing within a Sitecore context that can help nurture test driven development. This force can have a strong influence on the weak minded and if you were planning on having your junior developers do the testing by hand, those are not the droids you're looking for. A side benefit here too is that it can accelerate development by providing stability controls and automation handlers. I can now do the Kessel run in less than 12 parsecs. I do point-5. That's light speed.  

Here's a diagram showing how the application flows:

TestStar workflow

  1. User engages with test forms
  2. Form contacts web service
  3. Web tests are run
  4. Unit tests are run
  5. PowerShell scripts are generated
  6. Scheduled Tasks run generated PowerShell scripts
  7. PowerShell contacts web service to run tests
  8. Test results can be read from RSS feed

 

The Dark Side

You might be skeptical about ANOTHER module that you have to keep up with AGAIN. Well, consider this, if your empire doesn't have a tight defense, bugs will create weakness in your web application. If your approach is manual testing, it will not be easy. The target areas can sometimes be only two meters wide. Which requires a precise hit. Only a precise hit will setup a chain reaction. I know what you're thinking. "That's impossible even for a computer." But it's not impossible. I used to bulls-eye womprats in my t-16 back home. They're not bigger than 2 meters. 

... Wait... Yeah. I might be getting a bit off course. What I meant is that although, it seems like just another thing to keep track of, it's additional value is well worth the effort. 

Sure, there's all sorts of ways to run unit tests but having multiple tools allow you more flexibility and a greater variety of testing surfaces like through web testing. This tool can also run groups of tests so you can include unit tests provided with installed modules. I'm not sure how widespread that practice is yet but I'm including them within this module and have plans to do it for others I manage. If you want to be able to call these tests as a single effort it might be easier to keep up with a powershell script that can be auto-generated. I'm just saying.     

Engage Your Tractor Beams

If I'm beginning to pique your interest, there's a few ways to get started:

 

With the TestStar, no web system will dare oppose you now. You may fire when ready and may the force be with you.