Test Driven Development

Who hasn’t had a deployment go a bit sideways?  For all the talk of DevOps these days, the ability to push out code can still be challenging.  When I heard David Moore, our guest today, talk about the increased confidence they have in pushing out database changes in very short cycles, I was interested.  While we have talked about tSQLt in the past, David’s experience of trying to implement test driven development and the results they experienced are worth considering.  While the results can be impressive, the cultural shift required to introduce and use the framework is also a point of discussion in this episode.  I also asked David why the examples we see are so simple that it almost seems pointless to get started.

Episode Quotes

“There is a trade-off between the amount of time that you’re willing to invest in this and the benefit that you get back from it. [But] it’s better to have some tests than no tests at all.”

“It’s much easier to do this from the beginning than trying to write tests for legacy code.”

“You do want to make sure your tests are not too complicated, so keep them as simple as possible.”

Listen to Learn

00:40     Intro
02:04     Compañero Shout-Outs
03:00     What have I learned
04:46     SQL Server in the News
05:23     Intro to the guest and topic
06:42     Extreme Programming, why do automated testing, and how David got started
10:40     Just how long were those changes taking at the end of David’s recent project?
11:37     A culture change has to happen in order for this to work well
12:45     This is how you get started…tSQLt…GitHub…
15:28     More details on the stored procedure
17:14     The amount of testing that you want to do is going to vary by project and by team
19:22     Writing automated tests for legacy code is really hard
21:43     Where and when to get started with testing
22:36     Why you want to do this in SQL Server
25:18     The order and locations of testing and promotion on David’s project
27:30     A few other principles of automated testing
33:15     It took about a month for David to feel like he was comfortable
35:08     SQL Family Questions
40:29     Closing Thoughts

Our Guest

david moore cropped 288x300

David Moore

David Moore is a software/data engineer with 20+ years of experience in a variety of roles, developing applications and data solutions.  With a passion for continuous improvement, he seeks ways to make agile practices practical.  He serves as a consultant with CapTech (www.captechconsulting.com).

Meet the Hosts

carlos chacon headshot

Carlos Chacon

With more than 10 years of working with SQL Server, Carlos helps businesses ensure their SQL Server environments meet their users’ expectations. He can provide insights on performance, migrations, and disaster recovery. He is also active in the SQL Server community and regularly speaks at user group meetings and conferences. He helps support the free database monitoring tool found at databasehealth.com and provides training through SQL Trail events.

eugene meidinger headshot

Eugene Meidinger

Eugene works as an independent BI consultant and Pluralsight author, specializing in Power BI and the Azure Data Platform. He has been working with data for over 8 years and speaks regularly at user groups and conferences. He also helps run the GroupBy online conference.

kevin feasel headshot

Kevin Feasel

Kevin is a Microsoft Data Platform MVP and proprietor of Catallaxy Services, LLC, where he specializes in T-SQL development, machine learning, and pulling rabbits out of hats on demand. He is the lead contributor to Curated SQL, president of the Triangle Area SQL Server Users Group, and author of the books PolyBase Revealed (Apress, 2020) and Finding Ghosts in Your Data: Anomaly Detection Techniques with Examples in Python (Apress, 2022). A resident of Durham, North Carolina, he can be found cycling the trails along the triangle whenever the weather's nice enough.

Want to Submit Some Feedback?

Did we miss something or not quite get it right? Want to be a guest or suggest a guest/topic for the podcast?

Let's find what you're looking for