SQL Server Database Unit Testing in your DevOps pipeline

In this episode, Robert is joined by Phil Japikse, who explores how in modern development practices, unit testing is part of the development process, not a chore to be tackled after you write your code.
Phil spends most of the time on Test Driven Development (aka Test Driven Design), where you write a test first and then write just enough code to pass the test and then refine the code as you add more tests. In TDD, the tests embody the requirements the code must satisfy.
He also briefly covers Behavior Driven Development [50:20] and Mocks [53:45].
Resources:
Very informative. This series is going to be great, can't wait.:D
This was a informative video but I still have questions. I have watched a bunch of tutorial videos on how to test 3 + 1 = 4 but I am having trouble implementing tests into my projects. How do I test my repositories that get data from a database?
@Adam: testing repose is more about integration testing. To test the code that uses the repos, you need to mock out the repos, as we briefly discussed. You can also use xUnit to test your repos, but keep in mind the performance hit, keeping the database state consistent between test runs, and many other factors that come into play with integration tests. You can write a test that gets records and asserts what was returned, just as you test 3+1=4.
@japikse Thank you so much. I finally got one to work. I was trying to over complicate the test. Thanks again for the help.
Thanks for the video. Machine Specs looks pretty cool. Understand that this video was all about unit testing but there is a brief discussion about integration tests ~@54:29. Philip mentions that he would show how one could have integration tests running against a db. Is this going to be covered on another episode? If not, could you share your thoughts/tools/materials on how to do it?
@Gabriel, my apologies. We did say we would get back to that, and never did. That happens on live shows sometimes. I bet we can do one on integration testing with xUnit, MSpec, and MOQ next time I'm in Redmond. Let me talk to @Robert about that.
This looks like its going to be a great series. Looking forward to it. I use unit tests in my own, personal projects. Work is somewhat of a different matter. There's lots of reasons for that, but I don't think you want to hear them. Bottom line, on newer projects we do use MS Test. Still learning the practice, though. For example, we had to spend a lot of time trying to get to 100% code coverage on some projects, which meant writing lots of low effective tests (e.g.: testing that an int property, when assigned, returned the assigned value). Oh well, we're getting there.
"You have to learn wax on wax off before you start on the katas" - love it.
@japikse:Thanks for a terrific video. This is the first unit testing overview that I've been able to get my head completely around - it makes sense of what have been for me, "loose end" questions. That said, consider this another vote/request to see a video on integration testing! Thanks!
@Doctor Who: You don't have to go for 100% coverage. full code coverage doesn't necessarily mean good test suite. That's the biggest mistake we generally do and then after tiring we leave doing unit testing all together. Best approach is to test critical pieces and cover all the use cases and if your code coverage is lingering at 80% its good to go. We don't really need to test every single property, just test the business logic and you should be fine.
This is wonderful! I love this series. I have been using Nunit but very glad to come to know of Xunit and Machine Specifications. For BDD, I find SpecFlow cleaner and concise [IMO].
Thanks again!
Are the sample projects no longer available ?
The URL has morphed a bit. It is now: https://github.com/skimedic/presentations/tree/master/UnitTesting
@Robert - can you update the link in the show notes?
@japikse: Updated
why talking about code coverage if this tool does not even exist in VS for Mac?