7 Crucial Reports for Quality Assurance - Check Sheet

The check sheet is, by far, the easiest report to produce.  The only thing required is an Excel-type application for columns and rows.  The header should be a fact for the dimension you are tracking.  This fact is usually something like a day of the week, week of the month or another time-based milestone, but it doesn't have to be.  The row dimensions are the defect types you are tracking.  So, as an example, let's say we are tracking defects on a web application that's under development.

Read more

7 Crucial Reports for Quality Assurance - Ishikawa or Fishbone Diagram

The Ishikawa, or Fishbone, diagram (or, affectionately known as the "Fishikawa" diagram), is one of the easiest diagrams to create.  No special software is needed, per se.  The content for the Ishikawa diagram is constructed using The 5 Why's as discussed in the previous post.  The answer to each question can be classified under one of six outside factors which makes up a bone from the fish's scale.

Read more

7 Crucial Reports for Quality Assurance

Quality Assurance is not simply measuring the quality of an application.  It's also measuring the quality of your development.  More times than not, development teams become so focused on "fixing bugs" that we "miss the forest for the trees" - we don't stop to assess the quality of the development process.  What good are our bug fixes if we simply introduce new bugs into the system?  How often are we introducing new bugs?  Is there a feature set or an area of the application that seems to have more bugs than other areas?  Is a developer more prone to creating bugs?  With all of the tools that we have at our disposal, it amazes me how little quality assurance tracks the actual development quality.  Instead, we merely have a backlog of bugs which we keep increasing with each new iteration.

Read more

Excluding Object Properties in Angular's $scope.$watch

Want to $watch an object in Angular, but ignore changes on certain properties?  Here's a function that will help you out:

function diff(obj1, obj2, exclude) {
    var r = {};

    if (!exclude) exclude = [];

    for (var prop in obj1) {
        if (obj1.hasOwnProperty(prop)) {
            if (exclude.indexOf(obj1[prop]) == -1) {

                // check if obj2 has prop
                if (!obj2.hasOwnProperty(prop)) r[prop] = obj1[prop];

                // check if prop is object, if so, recursive diff
                else if (obj1[prop] === Object(obj1[prop])) {
                    if (obj2[prop] == undefined || obj2[prop] == null)
                        r[prop] = obj2[prop];
                    else {
                        var difference = diff(obj1[prop], obj2[prop]);
                        if (Object.keys(difference).length > 0) r[prop] = difference;

                // check if obj1 and obj2 are equal
                else if (obj1[prop] !== obj2[prop]) {
                    if (obj1[prop] === undefined)
                        r[prop] = 'undefined';
                    if (obj1[prop] === null)
                        r[prop] = null;
                    else if (typeof obj1[prop] === 'function')
                        r[prop] = 'function';
                    else if (typeof obj1[prop] === 'object')
                        r[prop] = 'object';
                        r[prop] = obj1[prop];


    return r;

And here's how to use it...

$scope.$watch(function () { return vm.objectToWatch; }, function(newValue, oldValue) {

var difference = diff(newValue, oldValue,
    [ newValue.ignoredProp1
    , newValue.ignoredProp2
    , newValue.ignoredProp3
    , newValue.ignoredProp4 

// If 'difference' is empty, then return 
if (Object.keys(difference).length === 0) return;

// 'difference' does contain properties that we DON't want to ignore so do something...

}, true);

And, finally a jsfiddle example.

Karma + Jasmine + Visual Studio (including Visual Studio Code)

I've been developing a LOT of Angular applications lately. Some of them are hybrid projects (Angular w/ MVC); some of my projects have been completely separated (Angular for client-side, with a separate project for an API). Regardless, I always want to ensure that my code has been thoroughly tested with unit tests and acceptance (E2E) tests. When developing hybrid projects, my preferred IDE is Visual Studio. When developing a pure, client-side project, my preferred IDE is Visual Studio Code as it has a lot less remnants/artifacts tied to a solution (.vs, .xproj, .csproj, etc.) eliminating the need for a ridiculously large .gitignore file.  Additionally, I will use WebStorm depending on the need.

Jasmine is a great framework for providing both unit testing and end-to-end, acceptance testing.  Coupled with Karma, Jasmine can monitor file changes to our client-side code and execute tests on every file change in order to ensure that all tests are always passing.  In this blog post, I will demonstrate how to set up and use Karma and Jasmine in both development environments.

Read more

Two Ways to Mock System.Web.HttpContext

The other day I was writing some unit tests for testing my MVC application's forms authentication classes.  I needed to Mock the System.Web.HttpContext object.  There are a couple of ways to do this depending on the version of Visual Studio you are using (i.e. Professional, Premium/Ultimate/Enterprise) and how deep you wish to provide some default data.   One takes a little more leg work and requires some manual data setting, but gives you greater control.  While the other requires less coding for simple basic use.

Read more

Fakes Issue with System.Web

The other day I was writing some unit tests on an MVC project.  I needed to mock (fake) an HttpRequest object using the System.Web assembly.  However, there was a strange issue in creating the fakes assembly and adding it to my Visual Studio solution.  Namely, it didn't show up.Read more

Unit Testing an MVC Model

Do your MVC model properties contain attributes?  Have you ever wanted to unit test the properties to verify that the ModelState fails or succeeds based on given values?  Below is a static method that can be used for your unit tests as you test your models.
Read more

Slipstream SQL Installation

The other day I needed to install SQL Server 2008 R2 SP1 on a machine.  Because I was installing it on a Windows Server 2003, I couldn't simply install SQL 2008, I needed to install R2 SP1 because SQL Server 2008 doesn't like being installed on Windows Server 2003.  Unfortunately, SQL Server 2008 R2 SP1 doesn't have a base installer - there's only an upgrade installer.  So, I was required to perform a procedure call "slipstreaming".  A slipstream installation is one in which the upgrade pack is added to the base installer and installed initially instead of installing the base and upgrading.  In this way, SQL Server 2008 R2 SP1, because it's compatible with Windows Server 2003, would not complain at install time.

Read more

Exploring SharePoint Export

I'm currently working with a client for whom I'm upgrading their mixed 2007 and 2010 farm to SharePoint 2013.  Unfortunately, a site collection on a SharePoint 2007 farm they no longer have access to was exported instead of backed up.  What makes matters worse, whoever performed the export, expanded the .cmp file.  My client wanted the files from export.

While there are a few sites that give instructions on how to perform imports (like, here, here and here), as anyone who has worked with SharePoint 2007, it can be very finicky - everything, including the stars, must line up.  I also tried "re-compressing" the export file since the .cmp file is nothing more than a .cab file.  However, I had additional issues with the resulting .cab file since we were dealing with a 7GB file on a Windows 2003 machine (they don't play nicely together).  I also tried using a tool from Mike Smith to convert the files from the export file.  But, being that Mike hadn't worked on the solution since many years ago, of course, the application was giving me cryptic exception errors.

After all failed attempts, I was finally required to write a PowerShell script that reads the Manifest.xml and converts all of the .dat files to their original filenames in the original SharePoint 2007 file structure.  I've posted the PowerShell script on GitHub.

Have fun!