On November 28, 2013 I came across this question on StackOverflow – Sitecore Unit Testing is not a success? Luckily I could answer it and provide information to the user dpwulp94 but on the first read I was astonished that we as developers do give up unless there is some motivation or solution for the problems we face. My effort for this blog post is to encourage people to break through the barriers of limitations provided by the initial version of any application. Make the effective changes not only in frameworks but also in the attitude and approach of the common problems faced by Sitecore community developers.
Sitecore Unit Testing is not a success or is it ? “Unit Testing is always useful for anything that is written in C# (or should I say in OO Language)” is what I said on the post but now the front end frameworks are also rapidly changing for the ability to write tests around it. dpwulp94 was implying that after a good amount of research he was planning to give up (“Should we give up or can we get it working and in what way?”), but giving up for the time being and revisiting it with a fresh approach is the key with testing. All I could suggest again is watching
- Another interesting video by codeflood.
- Automated Testing with Sitecore V2 video by Alistair Deneys from Hedgehog
and read Alistair Deneys’ blog post Unit Testing in Sitecore is not Scary There are also more Unit Testing videos mentioned in Unit Testing Sitecore using NUnit, serializing content blog post if you want more information on how to do Unit Testing in Sitecore. Coming back to the StackOverflow answer, I also mentioned that “I can gauge the blockage that you are facing. But have a read of Testing Strategies – Opinionated Advice by Kevin Obee.” Sometimes while doing Unit Testing we loose the focus of being pragmatic and just follow the Unit Testing Principles. Confessing in the answer that “I faced that and establishing the balance would be the key. In no way I am suggesting that you might have gone in this direction, but just suggesting that sometimes taking a step back, reflecting on what we ACTUALLY want to TEST and restarting helps a lot.” After reading through the answer a positive comment by dpwulp94 was “The article of Unit Testing in Sitecore is not scary seems great. But it would be nice if there are some people on StackOverFlow who encountered the same problem, writen above. And (of course) how that was being solved” To this I would completely agree and would like open source isolation testing framework for Sitecore like Sitecore.FakeDb gain more light. If this interests you check out this video by Pavel Veller from BrainJocks Keep open source projects coming and let’s make Sitecore Testing better by the day. Happy Sitecoring !