July 2006 - Posts
The news that user content sites such as MySpace face a US act that could see them banned from the US is a blow for all user content sites. The act is designed to protect children from online abuse but if other countries follow then the death of user content sites will surely follow. User content sites are one of the key movements of Web 2.0 and the sheer ability to define and create your own online space with your own content and share it with others is what the internet was created for in the first place. Rather than a ban prehaps it's time to start to thinking about what else can be done to help the internet to foster such sites but also to protect the people that use it from the vile scum.
First and foremost parental controls, user content sites can not only moderate the content with ratings system to protect children from wandering into adult content but also allow parents to moderate what their children are looking at. It's hard for parents to look over their kids all the time but open and honest converstation between parents and kids about their use of the internet along with parental controls, ratings system and a close watch and organisation of content by user content sites (to prevent adult content from being exposed to kids) will go a long way to preventing online threats to kids. This some degree might feel like it's going to limit the freedom of user content but with cateorisation and moderated systems it can work.
Secondly for user content sites and prehaps the wider Internet prehaps it's time to stop allowing scum to hide behind their computers and start thinking about systems that are a digital ID of who you are exactly, being careful of human rights laws such a system cannot allow a persons ID to be misused or abused but will mean that a person cannot pretend to be someone they are not (and for scum that means a 40yr man pretending to be 15). To obtain such a ID would be the same process as a passport and prehaps if need be the same biometric information as recent passports in the US and across Europe, I could see an ID taking the same form the InfoCard system. When issued it contains all the data to identify who you are and to use that same ID prehaps biometric entry devices are needed. The key here is that such an ID cannot be forged or stolen and cannot be used to hide a persons age or identity, you are who you are.
Sandcastle has only just touched down and already folks are busy creating GUI's and scripts.
Aram has a post on how to build a help file using Sandcastle. The MSBuild extension is not in this CTP so you will have to manually recreate this in your msbuild file.
Sandcastle CTP is go ! Scott has some great stuff here and the offical news is here. Going to be interesting to give this a run.
Via Jesse, developed by the Xamlon folks this is an Eclipse based IDE for Ajax. Not tried it yet but I would love to see Atlas support. Congrats to Robin and the team for the beta release.
While we wait with baited breath a new presentation on Sandcastle is available here.
Phil Haacked also has news that the NDoc is now dead. The events that have lead to this is shocking, I cannot believe that someone who dedicates his free time away from his family and friends to develop us the tools that help us every day is subjected to such abuse.
My last post looked at MbUnit and NUnit so out of interest I thought I would take a look at the VSTS unit test asserts and how they stacked against MbUnit.
VSTS Assert
AreEqual - MbUnit
AreNotEqual - Not supported
AreNotSame - MbUnit
AreSame - MbUnit
Equals - Not supported
Fail - MbUnit
Inconclusive - MbUnit Warning is closest
IsFalse - MbUnit
IsInstanceOfType - Not supported
IsNotInstanceOfType - Not supported
IsNotNull - MbUnit
IsNull MbUnit
IsTrue - MbUnit
ReferanceEquals - MbUnit
VSTS StringAssert
Contains - Not supported
DoesNotMatch - MbUnit DoesNotContain is closest
EndsWith - MbUnit
Matches - MbUnit fullmatchh is closest
StartsWith - MbUnit
VSTS CollectionAssert
AllItemsAreInstancesOfType - Not supported, MbUnit Equals could be used
AllItemsAreNotNull - Not supported, MbUnit Equals could be used
AllItemsAreUnique - Not supported, MbUnit Equals could be used
AreEqual - MbUnit
AreEquivalent - Not supported, MbUnit IsSyncronised could be used
AreNotEqual - Not supported, MbUnit IsSyncronised could be used
AreNotEquivalent - Not supported, MbUnit IsNotSyncronised could be used
Contains - Not supported, MbUnit Equals could be used
DoesNotContain - Not supported, MbUnit IsNotSyncronised could be used
IsNotSubsetOf - Not supported
IsSubsetOf - Not Supported
As per my last post MbUnit has a greater degree of Asserts in it's toolbox ready for you to use.
MbUnit has a lot of asserts that you can use in your testing toolbox. To help you see the difference between unit test frameworks I have compared the asserts from the current NUnit release to the current MbUnit release as follows.
AreEqual - NUnit
AreNotSame - NUnit
AreSame - NUnit
AreValueEqual
Between
Fail - NUnit
GreaterEqualThan
GreaterThan - Same as NUnit Greater
Ignore - NUnit
In - Same as NUnit Contains
IncrementAssertCount
IsFalse - NUnit
IsTrue - NUnit
IsNotNull
IsNull
LowerEqualThan
LowerThan - Same as the NUnit 2.4 Less Assert
NotBetween
NotIn
ReferanceEquals
ResetAssertCount
Warning
The following NUnit asserts are currently not supported, AreNotEqual,IsEmpty, IsNotEmpty, IsNaN.
The NUnit type asserts are currently not supported, IsInstanceofType, IsNotInstanceOfType, IsAssignableFrom, IsNotAssignableFrom, IsInstanceOf
MbUnit also has StringAsserts as follows
AreEqualIgnoreCase
DoesNotContain
EndsWith - NUnit
Equals - - NUnit StringAssert.Contains is closest
FullMatch
IsEmpty - NUnit 2.4
IsNonEmpty - NUnit 2.4
Like
NotLike
ReferanceEquals
StartsWith - NUnit
The NUnit 2.4 Collection assert is supported in MbUnit as follows
AreCountEqual
AreElementsEqual - NUnit AllItemsAreNotNull and AllItemsAreInstancesOf would be closest
AreEqual - NUnit
AreIsSyncronisedEqual
AreSyncRootEqual
Equals - NUnit AllItemsAreInstancesOf, Contains, DoesNotContain would be closest
IsCountCorrect
IsNotyncronised (actully a typo should be IsNotSyncronised)
IsSyncronised
ReferanceEquals
The following NUnit collection asserts are not supported directly AllItemsAreInstancesof, AllItemsAreUnique, AreNotEqual, AreEquivalent, AreNotEquivalent, Contains, DoesNotContain, IsSubSetOf and IsNotSubSetOf.
MbUnit supports FileAssert as follows
AreQual
AreStreamContentEqual
Equals
Exists
NotExists
ReferanceEquals
This was added to NUnit 2.4 but no details are available.
It's interesting to see how we compare and some of things that NUnit has already and has coming in 2.4. MbUnit has a lot of functionality built right in (no need to start reinventing the spanner, look inside the toolbox for what you need). Heres what MbUnit has in addition.
XmlAssert
SecruityAssert
ArrayAssert
CompilerAssert
DataAssert
PerfAssert
ReflectionAssert
Lost in translation some place was the credit that Roy fully deserves for being the man to come up with the concept for the database testing attributes and fixtures in MbUnit. Roy emailed me last week to voice some concerns for credit and in return I have edited the MbUnit wiki. If your not sure what I mean by the database testing features then here's a syndicated copy of Peli's post on it.
MbUnit now supports the new attributes for Roy Osherove (ISerializable) to solve the database Rollback problem:
- SqlRestoreInfoAttribute contains the information necessary to perform database restore (connection string, etc...),
- RollBackAttribute uses EnterpriseServices to roll back the transactions done in the test case, (Note that this attribute does not rely on SqlRestoreInfo and can live on its own)
- RestoreDatabaseFirstAttribute, restores the database before starting the test (using DbAdministrator from TestFu).
I will assume that you have read the article from Roy so I can skip explanation and show an example. Consider the following test fixture:
[TestFixture]
[SqlRestoreInfo("connectionstring","databasename",@"c:\backups\nw.mbk")]
public class NorthWindTest
{
[Test, RollBack]
public void TestWithRollBack()
{...}
[Test, RestoreDatabaseFirst]
public void TestWithRestoreFirst()
{...}
}This example, which runs in MbUnit, is similar to what Roy has proposed: SqlRestoreInfo gives information that can be used to restore the db. TestWithRollBack is rolled back using Enterprise services, the database is restored before TestWithRestoreFirst is executed.
What about data abstraction ?
We would like to create a fixture and apply it to different Db provider (Oracle, MySql,etc..). Is this possible ? This is (will**) possible in a minimum of work, it is just a matter of changing SqlRestoreInfo to OracleRestoreInfo:
[TestFixture]
public abstract class DbNorthwindTest
{
[Test, RollBack]
public void TestWithRollBack()
{...}
[Test, RestoreDatabaseFirst]
public void TestWithRestoreFirst()
{...}
}
[SqlRestoreInfo("connectionstring","databasename",@"c:\backups\nw.mbk")]
public class SqlNorthwindTest : DbNorthwindTest
{}
[OracleRestoreInfo("connectionstring","databasename",@"c:\backups\nwporacle.mbk")]
public class OracleNorthwindTest : DbNorthwindTest
{}This example is quite neat and self-explenatory: SqlNorthwindTest will apply the fixture against a MsSql server using System.Data.SqlClient classes, while OracleNorthwindTest will test against Oracle.
More Posts
Next page »