Archive
Monthly
Go
|
|
DNN Blog
Feb
18
Posted by:
Philip Beadle
Monday, February 18, 2008 12:00 AM
I drew this up to help give an understanding of how the testing of DNN Modules is going to work for my TDD DNN Module template at CodePlex.

This diagram shows how each level of a DNN module can be unit tested using RhinoMocks to generate the mock objects. It also shows where I will be driving the integration testing and also the automation testing using Watin.
Mock objects and mock controllers allow you to create known return values for the methods you are testing. Doing this allows you directly test a piece of code knowing that if the code is corect it will return the value you assigned to the mock object/controller. the unit test is then just that, a test of a unit of work. Once you have the unit tests written you can then do a code coverage analysis and make sure that you code is fully covered (where useful). This allows you to test for each of the code paths in your code. Good code coverage gives you confidence that the code you have written doesnt have black holes.
My favourite part of having a well covered code is that when a bug is reported you can write a test to prove that it is a bug and then modify your code, rerun your tests and know that you didnt intrduce another bug with the fix implemented.
4 comment(s) so far...
Re: TDDDNN - Diagram of how it all fits together so far.
Phil - in Cambrian we have improved the "Provider" configuration so that you can manually configure the providers without the need of the "web.config" file. We have done this by using an "Inversion of Control" Container.
This should improve the ability to use Mock Providers.
By cnurse on
Tuesday, February 19, 2008 7:51 AM
|
Re: TDDDNN - Diagram of how it all fits together so far.
Go Phil Go! It is awesome to see someone architecting standardized testing of DNN modules.
Now if I can only convince someone of the importance of a webservice that can be used to install and manag modules in DNN. This would make it much easier to automate the migration of DNN site changes between development, quality and production instances.
By juchytil on
Tuesday, February 19, 2008 7:51 AM
|
Re: TDDDNN - Diagram of how it all fits together so far.
Hi Charles, I remember reading about that a little whi;le ago and was planning on doing just that. Im away from home next week so will get time to get this all going then.
By philip.beadle on
Tuesday, February 19, 2008 7:53 AM
|
To charlie
Can you tell us What IOC container you are using in DNN core?
By AliCommerce on
Tuesday, February 19, 2008 7:35 PM
|
|