Kalamazoo X 2017 Recap

Holy shit.

Another amazing Kalamazoo X. This year was even more special because I was honored to be asked to speak. To be honest, speaking at Kalamazoo X was on my bucket list, but I never thought it would happen. It’s like the pinnacle of my speaking career. Doing a technical talk is easy. Doing live demos is easy. Being this vulnerable and open with a room full of people, some of which you work with, or have known for years, but never opened up like this? It’s fucking hard.

I was a nervous wreck leading up to it – is this too much? Am I going to regret this? Are people going to look at me differently, or treat me differently?

It went really well, actually. As usual, all talks leading up to mine fit mine perfectly, and all after did the same. Somehow we always get a theme or three running through all of the talks unintentionally. Yes, it’s always by accident – Mike isn’t that good of a planner.

My live tweets are compiled here: https://storify.com/g33klady/kalamazoo-x-2017. I always get a lot of encouragement from people for live-tweeting – both those that aren’t able to make it, and from those that have hearing difficulties. It’s my way of note taking, so I’m glad that it helps others!

CodeMash 2017 Recaps

Another CodeMash here and gone. I got in around 450 tweets this year – seemed like I didn’t attend as many sessions.

Here are the recaps (via Storify) for the sessions I attended!

Precompilers (Tues and Wed)

Storify: https://storify.com/g33klady/codemash-2017-days-1-and-2-precompilers

Day 3 Sessions (Thursday)

Storify: https://storify.com/g33klady/codemash-2017-day-3

Day 4 Sessions (Friday)

  • Mashing Up QA and Security with Craig Stuntz
  • (I was going to attend Over-Achiever, Under-Believer: How to Match Your Confidence to Your Competence with Maureen Zappala but a few minutes in I realized it was a re-versioning of the first talk in my recap from last year: https://storify.com/g33klady/codemash-2016-day-4)
  • Getting Started in Functional Programming with F# with Reid Evans
  • Leading Hackers and Hacking Leaders with Jonathan Popham

Storify: https://storify.com/g33klady/codemash-2017-day-4

Using SQL Databases and REST together in Integration Automation with C# and NUnit

EDIT: One mindful reader noted that I should be using good practices to protect my code from SQL Injection. So there are some updates below, and the code is also updated! I used this as my guide: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.parameters.aspx

One part of my talk and resources on Testing RESTful Web Services that I hinted at but didn’t quite get to was using SQL databases. A lot of us will be testing a REST service along with it’s backing SQL database, so it’s useful to know how to link them together in our C# automation!

I’ve added to my repository to include some checks against the AdventureWorks2012 SQL database, continuing to use C# and NUnit. Gitter’s database isn’t publicly available (nor should it be!) and I can’t find an AdventureWorks API that I could use for my checks – maybe that will be a later, more complete example. But for now, we’re doing some pretending!

If you’d like to follow along, grab the AdventureWorks2012 database backup from Microsoft by grabbing this zip AdventureWorks2012-Full Database Backup.zip. Unzip and restore the database (google it if you need help :D).

Look through the tables, run some queries, and see what we’re working with. For the coding examples in the repo, I’m mainly looking at the Production.ProductInventory table, which depends on the Production.Product table for ProductIds. From the Product table, I’m going to pick a product to work with – I like #875: Racing Socks, L. Querying the ProductInventory table, I see there’s 288 (presumably pairs) of Large Racing Socks.

Let’s pretend that we have an inventory system that uses a REST service, which in turn grabs data from and updates our database. If we pull something off the shelf to send to a customer, we scan it into the system. The system identifies it, and sends a call like:

PUT http://ourwarehouse/api/products/875/inventory/-1

then the API goes into the database and essentially does:

UPDATE Production.ProductInventory 
SET Quantity = quantity - 1 where ProductID = 875

So with our checks, we would:

  1. Do a SELECT query on the database for the product and see what the quantity is
  2. Perform the PUT operation with the REST service
  3. Do the SELECT query again to see what the quantity is now
  4. Verify the new quantity is what we’re expecting

Utility Methods

First we can write some utility methods to execute our queries against the database. We start with a Utility class and add references to System.Data and System.Data.SqlClient.

Our first utility method is to execute a SQL query to get the quantity of a product. We’ll pass the product ID and connection string, and it will return a DataTable for us.

public static DataTable GetQuantityOfProduct(string productId, 
  string connectionString)
	string commandText = "SELECT Quantity FROM " +
                 "AdventureWorks2012.Production.ProductInventory WHERE " +
                 "ProductID = @ID;";
	using (SqlConnection connection = new SqlConnection(connectionString))
		SqlCommand command = new SqlCommand(commandText, connection);
		command.Parameters.Add("@ID", SqlDbType.NVarChar);
		command.Parameters["@ID"].Value = productId;
		using (var da = new SqlDataAdapter(command))
			var dt = new DataTable();
			return dt;

Another utility method we’ll want is to execute an Update SQL command, to update the quantity (since we don’t have an API).

Again this method takes in the product ID, as well as quantity and connection string, but this method returns a code, not a DataTable. If our command is successful, we’re expecting the return code to be the number of rows affected. If it’s -1, then something went wrong.

public static int UpdateQuantityOfProduct(string productId, int quantity,
 string connectionString)
	int code = 0;
	string commandText = 
            "UPDATE AdventureWorks2012.Production.ProductInventory " +
            "SET Quantity = @Quantity WHERE ProductID = @ID;";
	using (SqlConnection connection = new SqlConnection(connectionString))
	   using (SqlCommand command = new SqlCommand(commandText, connection))
		command.Parameters.Add("@Quantity", SqlDbType.Int);
		command.Parameters["@Quantity"].Value = quantity;
		command.Parameters.Add("@ID", SqlDbType.NVarChar);
		command.Parameters["@ID"].Value = productId;
		code = command.ExecuteNonQuery();
	return code;


Connection Strings

We’ll put our connection string for the database in our App.config file. We need to specify the server, which database, and the security we’re using. Mine is set up locally, with Integrated Security (Windows Authentication).

    <add key="dbConnectionString" value="Data Source=MSSQLSERVER12;
            Initial Catalog=AdventureWorks2012;Integrated Security=True"/> 

We’ll grab the connection string in the SetUp method in our test class:

private static string _connectionString;
public void SetUp()
     _connectionString = ConfigurationManager.AppSettings["dbConnectionString"];

The First Check

Let’s get started with our first check! Remember we’re going to:

  1. Do a SELECT query on the database for the product and see what the quantity is
  2. Perform the PUT operation with the REST service
  3. Do the SELECT query again to see what the quantity is now
  4. Verify the new quantity is what we’re expecting

0. Setup

First we need to specify a few things, including which product we’re going to use, how we’re going to modify the quantity, and create our query string.

int quantityModifier = -1;
string productId = "875";

So we’re going to take 1 away from our inventory, of product 875 or the amazing racing socks in large.


1. Do a SELECT query on the database to get initial quantity

First we execute the query, and get a DataTable in return. We could return just that individual field, but then our utility method wouldn’t be as useful or we’d have too many doing the same thing -sometimes we’ll want an entire row, sometimes we’ll want many rows. You can do it either way. Here, we’ll do the work in our test to get the field we want, which is the first row and first column.

DataTable initialInventoryDt = 
    Utilities.GetQuantityOfProduct(productId, _connectionString);
int initialQuantity = Int32.Parse(initialInventoryDt.Rows[0][0].ToString());

Now we can figure out what the expected quantity will be when we’re done with our check.

int expectedQuantity = initialQuantity + quantityModifier;

2. Peform PUT operation with the REST service

If we had this pretend REST service set up, our code now would look something like this:

string url = String.Format("http://ourwarehouse/api/products/{0}/inventory/{1}, 
    productId, quantityModifier");
HttpResponseMessage response = Utilities.SendHttpWebRequest(url, "PUT");
    "Response code to PUT was not successful");

However, we don’t. So we have to fake it by doing an UPDATE command to the database directly.


And we add this code:

int code = UpdateQuantityOfProduct(productId,expectedQuantity,_connectionString);
Assert.IsTrue(code == 1, "more than 1 row was affected, something went wrong");

REMEMBER this is ONLY because we don’t have that REST service and we’re faking what the service would do!

3. Do the SELECT query again to get the new quantity

Again we perform our select query, and grab the returned value

DataTable updatedInventoryDt = 
    Utilities.GetQuantityOfProduct(productId, _connectionString);
int updatedQuantity = Int32.Parse(updatedInventoryDt.Rows[0][0].ToString());

4. Verify the new quantity that we’re expecting

Now we just do our Assert!

Assert.AreEqual(expectedQuantity, updatedQuantity, 
    "Updated Quantity is not as expected; it is " + updatedQuantity + 
    " but should be " + expectedQuantity);

Other Checks

We could also do a check of the GET method, to make sure our service is pulling information from the right table. Our steps would be:

  1. Do a SELECT query on the database for the product to get the quantity
  2. Perform the GET operation with the REST service to get the quantity
  3. Verify the quantities returned from both match

This example is in the repo, so you can check it out there!

There are many other variations that we could perform, as well, but these are some basic building blocks.

Wrap Up

I hope that this walkthrough and the code help you to be able to automate checks against SQL databases as well as REST services! Let me know if you think something is missing, or if you need some clarity, or if you find a bug in my code!

Also apologies about the formatting here – I need to find a good code snippet plugin to use in WordPress! Let me know if you have any suggestions!

She used this one neat trick to model JSON as classes in C#, and her audience was stunned!

I recently presented my talk Testing RESTful Web Services for the first time at the QL Technology Conference in Detroit. In this talk, I cover why we should test web services, and how to test RESTful web services both with tools like Postman, and C# and NUnit.

I was not prepared for, mid-demo, resounding applause from the audience. I was demoing a cool trick I learned from a teammate, and apparently it was new magic to the audience. Awesome! So I decided to blog about it, to spread the word of this fancy magic and help everyone save time when testing RESTful web services within Visual Studio.

What was that magic? It’s the ability to take a JSON response and quickly turn it into a class – a super fast way to model JSON responses!



If you already know how to do it, awesome! Spread the word!

What you need:

  • a JSON response to copy/paste
  • Visual Studio, with a solution loaded (we’ll use C#, not sure how it works with other languages)

I’ll use the same examples from my talk – it uses the gitter API (http://gitter.im).

First, create a new class file in your project:

  • Right-click in Solution Explorer where you want the file to go
  • Select Add -> Class
  • Type a name and click Add

Then, paste the JSON as classes!

  • Copy the JSON you want to model as a class
  • Inside the class file in Visual Studio, put your cursor inside the namespace
  • Choose Edit -> Paste Special -> Paste JSON As Classes
  • Much rejoicing!

You’ll need to clean up the class a bit, but it will definitely save you time!ClassesAndJson.png

I hope you’re able to use this neat trick to help you in your testing of web services!

You will want to choose your JSON responses for modeling carefully – make sure it has all of the potential properties! Otherwise, down the road when you’re deserializing, you’ll hit a failure because the JSON will have an extra property that your class is missing.

Any other neat tricks you can share?

CAST 2016 Recaps

CAST 2016 was held in Vancouver, BC. This was my first time to Vancouver, but I love the Pacific Northwest, so I was pretty sure I was going to love it there. Spoiler alert: I loved it in Vancouver!

I’m so happy I got to attend CAST this year, after missing last year due to project work. Since I first attended in 2014, I knew that CAST was a can’t-miss conference for me for as long as it runs. Putting the “confer” back in “conference” is the style that really appeals to me – as an audience, we’re not just talked at; we engage in active discussion. Everyone is part of the conversation.

This year, I feel like I learned things about myself as a person and as a professional, as well as some solid takeaways to implement at work. Some of the best takeaways came from side conversations, which is true to the spirit of CAST!

On the first day of CAST, I attended two tutorials:

Here’s the link to the Storify for day 1: https://storify.com/g33klady/cast-2016

On the second day of CAST, I attended the following sessions:

  • Opening Keynote: Automation, Software Design, and the Human Factor with Nicholas Carr
  • Babble & Dabble: Creating Bonds Across Disciplines with Katrina Clokie and Carol Brands
  • Afternoon Keynote: Test Management Revisited with Anne-Marie Charrett
  • Cooperating to Exercise Judgment and Skill: Requirements with Julie Lebo
  • How King Uses AI in Testing with Alexander Andelkovic

Here’s the link to the Storify for day 2: https://storify.com/g33klady/cast-2016-day-2

On the third and last day of CAST, I attended the following sessions:

  • Opening Keynote: Neuro-Diversity & Software Development with Sallyann Freudenberg
  • Alpha Testing as a Catalyst For Organizational Change with Steven Woody
  • How Do I Reach The Congregation When I’m Preaching To The Choir with Erik Davis and Rob Bowyer
  • It’s Certainly Uncertain – Fostering Healthy Uncertainty on Software Projects with Fiona Charles

Here’s the link to the Storify of day 3: https://storify.com/g33klady/cast-2016-day-3

Of course I did some sightseeing in Vancouver! Here’s a collection of some of those posts:


Kalamazoo X 2016 Recap

Basically, Kalamazoo X 2016 was fucking intense. I’m still processing, I may have more to write later, but I had to at least Storify and get out some thoughts before the initial bits went away: https://storify.com/g33klady/kalamazoo-x-2016-tweet-recap

I’m proud to help make sure KalX happens, and I hope to help make it happen every year. I need this conference – it speaks to me differently each year, it gives me what I need to hear and feel. I think I heard someone say it’s like the Room of Requirement of conferences.

One note – I feel like we need to rebrand it. It’s not “soft skills” as people know it. I don’t know what to call it, though.

I witnessed some people on their phones playing games, and initially I was like “ugh, wtf”. But after talking with one of those people, I realized – this shit is too intense. They’re trying to detach! I now have some empathy for those folks, but I feel like if they come in thinking “I’m going to learn to be better in meetings!” and we throw KalX at them, we might make some people lose their shit…



BestConferenceEver = KalamazooX

KalamazooX is the “non-technical conference for technical people”. It really is the best conference I’ve ever attended, and I go every year since the first one I went to – no exceptions. The best part about this conference, is that it’s SO FREAKIN’ CHEAP for the value! At $75 for standard registration, $35 for students, even with travel and hotel, you’ll end up paying way less than any other conference’s cheapest tickets.

This is my “official” blurb about KalamazooX – how I feel about this amazing conference, from last year:

I’ve only attended 5 or 6 different conferences in my career, but the feeling and motivation I get after KalamazooX is incomparable. The single track, back-to-back talks are intense and life-changing. I’ve meditated and made gratitude lists, been inspired to speak at conferences, laughed, thought deeply about my life, cried – all during KalamazooX. The X conference is definitely one I will never miss – it’s always first on my calendar with time blocked off to go. I can learn the latest technologies and best practices at any other tech conference or online. What makes KalamazooX different is the work we’re putting into ourselves – it doesn’t only change our professional lives but our personal lives as well, all in one amazing conference. I always leave the X conference a different person than who I was when I walked in.

This year, 2016 KalamazooX will be held at the Fetzer Center on the WMU Campus in Kalamazoo, MI, on Saturday, April 30. There’s an amazing list of speakers, like every year – Christina Aldan, Kate Catlin, Ed Finkler, Leon Gersing, Jay Harris, Cory House, Lauren Scott, and Alan Stevens.

Do yourself a favor, and sign up for KalamazooX! It will absolutely change your life!

Suggested (to me) Books on Leadership

I recently tweeted for suggestions on books about self leadership, and leadership in general – especially books that personally helped people. I wasn’t looking for “I heard this book is great” but rather “this book helped me to become a better leader” etc.

I’m compiling the list here because I got a variety of suggestions in various tweets, and I want to have a definitive list when I go looking for books and not have to troll through my twitter mentions 😛 But also compiling here as it may help others!

Several people suggested Becoming a Technical Leader by Gerald Weinberg, along with Weinberg’s Secrets of Consulting, and Becoming a Change Artist. I should just read all of his books I guess…

One Minute Manager by Kenneth Blanchard and Spencer Johnson (blog post w/ suggestion here: http://qahiccupps.blogspot.co.uk/2014/09/the-sixty-second-team.html)

The Power of Servant Leadership by Robert Greenleaf

Tribal Leadership by David Logan (as well as the TED talk: https://www.ted.com/talks/david_logan_on_tribal_leadership?language=en)

And of course, Jim Holmes’ book The Leadership Journey – I read what he has so far, and am excited for him to finish it (nudge nudge)!

Thanks to @spectacledbear, @qahiccupps, @jessclancaster, @codebully, and @pkirkham for their suggestions!


CodeMash 2016

CodeMash 2016 was awesome, as per usual. This year, I think we had a much larger turnout of testers than before. We even had some testing related open spaces!

I wasn’t able to go to all of the sessions I wanted to, but I live-tweeted the ones I did attend! I ended CodeMash with about 400 tweets, according to the rough count I got from Twitter (top is day 1 of CodeMash, before I started tweeting, bottom is after my final CodeMash tweet on Friday):



The big screens in the main hall where my face was far too often (tweet)

Here’s the Storify of the Precompilers I attended, which were


On Thursday, I attended the following sessions (which are in the Storify link below them):

  • Is your API leaking? Breaking APIs to increase security with Joe Kuemerle

  • A whole team approach to testing with Jon Kruger
  • Accessibility of the modern web with Brian Greene
  • Growing a Testing Whole Quality Team The Hard Way with Jim Holmes
  • Open Space – tester lean coffee
  • How do we solve for XX? with Kate Catlin

  • Jam Session!


On Friday, I attended the following sessions (which are in the Storify link below them):

  • Oppose Your Impostor! How to Be Freed From Feeling Like a Fraud with Marueen Zappala
  • How to Stop Hating your Test Suite with Justin Searls
  • Automation in Testing, Go Beyond Test Automation with Richard Bradshaw
  • My God, it’s Full of Tests with Kyle Lewis
  • Open Space – testing discussions
  • Secrets of Success in the Style of Glee with Jennifer Marsman


Coding the right thing: not just for developers

This tweet came across my feed recently and I emphatically agreed:


It occurs to me, however, that we as testers sometimes don’t see ourselves falling into the category of needing such advice. There’s the oft repeated “coding the right thing rather than coding the thing right”:


We throw together a script that walks through the application, that performs a particular use case, and we run it and we have this sense of security that if it passes, we are ensuring good code is going out the door.

But are we, as testers, doing due diligence with our code, the same way we expect the developers to? Are we doing design reviews to ensure we’re actually coding the right thing? Are we getting code reviews? Are we reviewing and refactoring our own code as the application code changes? Are we pair programming? From what I’ve seen, some of us are. Many are not.


We cannot advocate that “test code is as important as application code” if we don’t treat it as such. We can teach almost anyone how to write a script to automate use cases of an application. We should be teaching them how to think more – what will this code actually do? What does it accomplish? If it passes, what does it prove? Am I actually asserting anything, or am I just having it click buttons and fill in fields with no actual check in place? It is one thing to write a script to assist you in manual testing – perhaps to get you to a certain point so that you can get to the real testing quicker. It is another to write such a script and treat it as the test itself.

If you write test automation, I challenge you to reconsider what your code actually accomplishes, what a passing check means. Reconsider the design and architecture choices made. What did you mean to do? What did you miss?

I challenge you to treat your code as if it is application code. I challenge you to treat your code as you want the developers you work with to treat theirs. And remember that test automation is not testing (at least not until the machines take over) – you need a brain to test.