Editorials

Wrap Up – Software Testing

SSWUGtv
With SSWUG Founder, Stephen Wynkoop
Happy Holidays from SSWUG! ….and join the rest of the community with some Cloud homework.
Watch the Show

Wrap Up – Software Testing
Over the years, software testing has become a passion with me; primarily automated unit testing.

I first experienced automated unit tests working with a team of 14 developers and 20 QA staff to produce an online data warehouse in 3 months. One of the developers was quite adept using NUnit. Since we were coding in SQL Server and ASP .net NUnit was a natural fit.

I was the lead DBA on the project with no .Net experience at the time. So, I was very observant of how things were being done. One of my observations was how often code failed approval, or bugs were found during the QA process. I must say that much of my SQL code did not pass on the first, and even sometimes on the second attempt.

One exception was my colleague who programmed using NUnit. He rarely had any issues with QA. When issues were discovered, his fixes were turned around amazingly quick, and did not result in breaking other portions of code. From that point on I was hooked, and lobbied to have the practice become as standard.

Moreover, I embraced the technique, and worked hard to learn .Net and NUnit. I found ways to integrate automated unit tests into SQL code development. I have also found great success when utilizing automated unit testing for triggers, stored procedures and functions, or even embedded SQL queries.

Many contend that the time required to create automated unit tests does not justify the cost. It has been my experience that the exercise of figuring out how to test your SQL code results in better written code. Moreover, you have to test it somehow anyway. I have found that it takes little more time to automate the testing than manually testing. The rewards are experienced early on as software evolves and code is changed.

Because I have unit tests around my code I find the following benefits:

  • I can quickly estimate the impact of change, and time necessary to make modifications because I can change something, run my unit tests, and evaluate the tests that have failed to know the scope of the change required.
  • I can change code with confidence because my unit tests work as a safety net for scenarios I may not consider when adding or altering something.
  • Unit tests demonstrate to other developers how the code is intended to be used. It acts as a form of documentation, while performing other meaningful tasks. It is always in synch with the code. So I don’t have extra effort to maintain external documentation.

Are you using automated testing with your SQL resoruces? Share your experience by writing to btaylor@sswug.org.

Cheers,

Ben

$$SWYNK$$

Featured Article(s)
Should I hire over-qualified people?
In the recent interview with Steve Wynkoop (founder of SSWUG.org) we covered the “hiring” topic. This article covers the topic of hiring over-qualified candidates in more detail.

Featured White Paper(s)
Top 10 Tips for Optimizing SQL Server Performance
read more)