Category: Blog

  • Anatomy of a tSQLt test

    I’ve been doing some work on testing database code, and working with the tSQLt framework. I really like the framework more and more, and want to continue to use it. The whole idea of testing is a bit immature in database code, and perhaps software in general, but at least the software people are trying to move forward. At least in places.

    As I’ve been learning, and presenting on this, I’ve started to adopt and follow the simple pattern espoused by the tSQLt framework. It makes sense, and it provides what I think is a good format for unit test. The structure is:

    • Assemble
    • Act
    • Assert

    It’s simple, and it makes it easy to see how a test works.

    Assemble

    Declare variables and create tables you need. Insert data, initialize values and ensure that you have an expected environment on which to base your tests. I think this is especially important for database code tests.

    Act

    This is the place you call your code, or perform some action. Usually easy to do, but there are some thing that might be tough to set up.

    Assert

    This is where you assert, or declare something to be true. A value is equal to another. A result set looks like another. Something that you declare to be true, which could be some condition, like an error has occurred. If it’s true, the test passes. If not, it doesn’t.

    More to Learn

    There is lots more to learn, and I’m trying to do more. However I also need others to not only try to write tests, but evaluate how well they work and also publish some code. Explain to people what has worked, AND what hasn’t. Having that information out there, for a large variety of cases, will help others better test their code.

  • Learning Options in Seattle Next Month

    The 2014 PASS Summit takes place next month. Actually a few weeks, on Nov 3-7, 2014 in Seattle. While many people attend the conference, there are some additional options for learning that you might think about in addition to the conference itself. While the conference is great, getting deeper dives on topics that last more than an hour is something you may consider.

    Make SQL Server Go Faster – A two day class, Monday Nov 3 and Tuesday Nov 4, from Brent Ozar Unlimited. You’ll get two days in depth training on practical tips for improving SQL Server performance. $695, but worth it.

    SQL in the City 2014 – Seattle – From Red Gate, my employer. We’ll have the hour long sessions, but we’ve split things into two tracks and have linked sessions. Our development track, focusing on Continuous Delivery, is really 3 hours of content that has breaks. Lots of admin stuff, and the chance to see how Red Gate tools make your job easier and faster, but we cover concepts that can be applied to other tools, or your own processes.

    Pre-Conference Sessions – Each year there are two days of pre-conference, all day sessions. We’ve had post-conference sessions as well, but not for a few years. This year there are lots of choices, and a couple I struggled to choose between. I decided on Allan Hirt’s pre-con as I could use some HA skills beefing and as a former sysadmin, I find it interesting. If you can swing the $495, it’s a good investment.

    SQL Saturday #337 – Oregon – The Saturday before, if you’re in the area early, Portland is a short drive/train/flight away from Seattle. A free, full day of SQL to get you warmed up for the Summit.

    Also, don’t forget about our Monday Networking Dinner as well. Come join us. It’s free, and you get to meet other SQL Server pros.

  • Networking at the PASS Summit

    The 2014 PASS Summit is coming up in a few weeks and thousands of SQL Server professionals will be coming to Seattle for the event. Many will arrive early, and many will be there for the first or second time in their careers.

    Many of them will be that guy (or girl).

    Don’t start the week off by yourself, or with a few friends. Come network a bit and meet your fellow SQL Server professionals and #sqlfamily. If you live in Seattle, you’re welcome as well, whether you’re attending the Summit or not. It’s free and everyone is welcome.

    The last few years have had Andy Warren and I holding a Networking Dinner on Monday night. It’s been a large success, which by our standards, means that lots of people come and meet each other. We meet new people, and they have a good time. That’s it.

    Anyone can come, just register so we have some idea of how many people to expect. Andy has written a short post, but I wanted to add a bit more detail and spread the word.

    This is a self-funded event, meaning everyone buys their own food and drinks. Or buy something for a friend. We really built this event with the idea that we wanted to organize something for people to come to and meet each other. No pressure, and no expectation of costs or expenses. The first few years we packed a restaurant on the Seattle waterfront and heard from many people that they really enjoyed it.

    Since then, we’ve tried to look for more open environments where people can talk and enjoy some SQL Server talk in a casual atmosphere. We try for a venue that’s not more than 3-4 blocks from the convention center, and we should have a venue soon.

    Our goal is to get people to meet each other. Whether its your first Summit or 14th, whether you started working with SQL Server in the last decade or yesterday, this is just a chance and an organized event to meet others.

    Come join us, tell friends, and be prepared to introduce yourself and have a conversation with someone else. That’s networking, and it’s the most valuable thing you can do for your career.

    We’ve organized a time (and place to be disclosed soon). You can do the same thing. Lots is happening in Seattle, and if you know 20 people, think about creating your own event, dinner, or just casual get together. Pick a time and place, and let PASS know so others can attend.

    Register today and I’ll see you in a couple Mondays.