Tag | Unit Testing Posts

NUnitAsp is a great tool for unit testing ASP.NET web pages. Although NUnitAsp tests are slow to run, they're especially useful for running “web smoke tests” on a nightly basis. (I mark every NUnitAsp class with [Category("Web Smoke Tests")] so that I can easily exclude them from my more frequent unit testing.) On many projects, authentication is required to view a webpage. When testing an application requiring Windows authentication, NUnitAsp can be easily configured to run as the current ...
One of things I've always been interested in was to try a bit of TDD, but never seemed to be on a project where it was possible, but I thought with my current project I could do a bit of organised unit testing making use of VS2005 to generate the initial skeleton test classes. Had started going through the test code, completing the test cases, and some bits quite useful. Normally I would create an exe, which called into my code to test it, but this time I could just select a test and run it. Which ...
ASP.NET has openned a poll to ask the developers about their usage (if any) on the Unit Testing. Amazingly 45.63% of the developers are not aware of the Unit Test. And 31.88% of the developers have not implemented the Unit Tests in their application. This all leads to the quality of the product. Since, most of the above mentioned developers have not implemented Unit Tests, the probablity of bugs in the application is pretty high. What are Unit Tests? Unit Tests are created before a single line of ...
I kind of touched on this issue in my last Tanks update. Thomas was nice enough to leave a comment and a follow up post that he made. I went to leave a comment on his blog in response to his post but "anonymous" comments aren't allowed and, frankly, I don't want to sign up for an iBlogger account simply so I can leave a comment. So, with that said, I'm just going to post my response here. ------ When writing unit tests, I no longer really think about methods. What I have started to think about is ...
Recently I had posted some reasons about why I use Repository as opposed to Active Record. This post was originally spawned by some comments by Sam Gentile in regard to peole refactorring from repository to active record. In my previous post I listed a few reasons but one of those reasons requires much closer analysis ... ActiveRecord seems to defeat the entire concept of DDD, ActiveRecord promotes a database centric model Every methodology has its foundation, for Domain Driven Design it is the Repository ...
[Crosspost from Managed World] Great. If it wasn't bad enough being sick still, my internet connection just had to be down all evening. Luckily, it _just_ came back up so I can actually post this update. So let's discuss the progress on Tanks, shall we? Most of my "free time" I've had lately (which hasn't been much with me being sick (since my body proclaimed several hours at a time to be "nappy time")) I've spent writing the unit tests around the last couple of classes I ported over from my previous ...

This article describes best practices for leveraging the benefits of NHibernate, ASP.NET, Generics, and unit testing together.

Read NHibernate Best Practices with ASP.NET, Generics, and Unit Tests

[Crosspost from Managed World] After using a homegrown logging solution at work, I forget just how nice and easy log4net is to use. It really makes me want to encourage other developers at work to use it. It took only a matter of minutes to hook it up into Tanks and get the major components logging. So, that's one thing to mark off the list.Although I wasn't originally planning on doing it this weekend, I had noticed that version 1.0 of Irrlicht was finally released. So I took the opportunity to ...
Warning this post is not well formulated but has some useful random information :) There has been alot of talk lately about people refactorring from the repository pattern to the Active Record pattern. For instance Sam Gentile brings it up here How prevalent is this movement? I personally prefer the repository pattern over ActiveRecord for quite a few reasons. My db objects and domain objects rarely match up. I often use polymorphism on my repositories (especially for testing). I can write a generic ...
This post describes the use of Inversion-of-Control, or Dependency Injection, to promote loose coupling and convenient unit testing.---- Introduction In designing an object-oriented application, a major tenant of design is "loose coupling." Loosely, no mean for the pun, "loose coupling" means that objects should only have as many dependencies as is needed to do their job - and the dependencies should be few. Furthermore, an object's dependencies should be on interfaces and not on "concrete" object ...
In a previous post I detailed some conditions existing on development teams that would suggest some changes need to be made in order to bring about better performance and ultimately higher quality software. In this post I will identify a couple more Team Smells and discuss how these issues can be remedied and why these conditions should be addressed in the first place. Smell: Developers Spent Way Too Much In The Debugger (AKA Debugger Junkies) A good feature-rich debugger like the one that comes ...
I finally got around to it... the whole shebang of NHibernate best practices with ASP.NET and Generics. The article, along with the related source, can be found at http://www.codeproject.com/... Your review, feedback and suggestions would be much appreciated! 3/3/06 UPDATE I've updated the article on Code Project to include a unit testing project to show how to simulate the web context and how to create “mock” DAO objects within your unit tests ...
Development machines here use a delayed signing for building binaries. Only during the build process on the build server does a public/private key pair get used for signing assemblies. When using the unit testing features of Visual Studio 2005 we are prompted to provide a key for re-signing an assembly after instrumentation has been applied. If we provide the public key it will fail. If we provide the public/private key pair it will work. Has anyone else managed to get this working? Here's what I'm ...
Please, help? Do I really need to buy VSTS to get integrated unit testing? I've got an MSDN subscription which I thought was kind of universal but it seems I dont get any of team system. Now, I wasn't particuarly bothered with a lot of the stuff but I dont get the integrated unit testing in the pro edition. I guess this means that I am going to be sticking with NUnit and as such recommending that my clients do exactly the same. I don't see why Microsoft should be putting this kind of an additional ...
When testing policies that use a lot of database facts in Rule Composer (or .NET components that access database) you may not want to hardcode connection strings into BRE as constants. There's a better place to keep them - the BRC config file. Since there's no such file we can make one. Go to the Biztalk installation folder and create file named Microsoft.RuleComposer.exe.... Simply put in any configuration settings you want as in regular .net config file, for example: <configuration> <connectionStrings> ...
Yesterday I stumbled across a totally invaluable tool to help with unit testing your code in Visual Studio: TestDriven.Net. (formerly known as NUnitAddIn) It's a Visual Studio addin that allows you to run your NUnit, MbUnit, Team System, and soon Zanebug unit tests by just right clicking on the test method, class or namspace and clicking the “Run Test(s)” menu item. You can run just one test, all the tests in a class or all the tests in the namespace. This is cool and all, but the best ...
I hope my weblog doesn't turn into the Visual Studio 2005 bug site. But, I've ran into some additional anomalous behavior. The problem occurred when I was unit testing some classes in Visual Studio. The project is a class library (Library A) that accesses another class library (Library B) that is not part of the solution. Now the crux of the problem is that Library B was recently converted for use under 2.0. I have this library (different Framework versions) in different project folders. And the ...
Another polished event from Microsoft to support the launch of SQL Server 2005, VS.NET 2005 and BizTalk Server 2006. I attended the second day (in Hammersmith, London) which according to the speakers appeared to have more technically orientated delegates than the first day. Although I was only registered for the main 'technical track' due to my late registration, I managed to switch three of the four slots to Chalk 'n' Talk (Deep Dive) sessions. These were in much smaller rooms, with a higher technical ...
I probably have not been clear in my previous posts about the overall methodology I'm following in our port to VS2005. I have split my porting process into several different steps to isolate the effort into manageable slices. These include: Porting the projects into VS2005 for ongoing development. While doing this, I have insured that everything still builds with VS2003 while my team makes the transition to the new IDE. I am avoiding the temptation to fix the thousands of warnings related to deprecated ...
I was just reading Marc Lehmann post on Code Coverage and I agree with him that a single pass through your code will give you 100% coverage but it doesn't mean you extensively tested the boundaries of your code. So with this in mind, I'll show you how to setup a link to a database where you can use a table to feed your unit test with all the test cases you need to fully test you code. The unit testing framework of Team System lets you connect to a table and run the same test once for each row in ...
One of the first places I went was unit testing. I really like what Microsoft has done by pushing the unit testing framework into the IDE and providing the tightly coupled code coverage tools along with it. This is probably my top “most-used” feature of the new Visual Studio 2005 product. First off the namespace of the UnitTesting framework has been changed in RC1 so any testing you’ve written in Beta 2 or earlier will not compile. They have also changed the stub and methods for ...
I am finally working exclusively in our QTP environment developing automated tests for our software. I also now know a lot more about what we use, and can comment on it. As it turns out, we are *not* using .Net yet, but instead the entire adaptation of QTP is done via VBScript. We have a large script Action (QTP users will know what I mean) that allows us to use Excel sheets (Yuck!) to write scripts using a very specific set of keywords to run our tests. I think the idea was orignially to have this ...

There’s a great article on Unit Testing over at O’Reilly.  Lots of stuff on all the current flavors.  They have really good things to say about MbUnit, which I admit, I’ve never tried.  Go to ONDotnet.com: Unit Testing in .NET Projects to find out more.

I started writting down a list of items I wish I had in the next version of Visual Studio. It started as a bullet list of 10 items and ended up as a 10 page doc ! Most of the ideas cited bellow are there to reduce repetive tasks; more productivity, less errors. Here's the link to the full document. Summary: Configurable Code View: view tailored for the role of the user Special handling of Debug Mode: action/code that is performed only in debug mode Code Templates: easily create/modify function code ...
Last Friday I met my old friend Hannes Pavelka. We had some beer in a really nice pub here in Dortmund (Limericks ) as he talked about unit testing in his current project. They use NUnit throughout the whole developing process. The biggest problem though is that they do not write their test before implementing, because it is to time consuming! There are different approaches to replace existing API for testing and avoid calling resource intensive objects. One is called "mocking", the other is known ...
Check out this Six Rules of Unit Testing by Charles : Write the test first Never write a test that succeeds the first time Start with the null case, or something that doesn't work Don't be afraid of doing something trivial to make the test work Loose coupling and testability go hand in hand Use mock objects http://radio.weblogs.com/01... ...
Extensive Examination of User Controls Extensive Examination of the Datagrid control Understanding Session State Modes Mastering Entity Classes Formatting DateTime in Microsoft Asp.net Code translator from C# to VB.NEt and Vb.net to C# Request Validation - Preventing Script Attacks Unit Testing the Data Access Layer Retrieving images from database Asp.net 2.0 Quickstarts Image Generation Service using Asp.net 1.x SQL Injections ...
I went this week to the VSNET 2005 ASCEND event at Microsoft Campus in Redmond, WA, after attending the introductory presentations I decided to go to the Tools & Integration track, this track was about the new Visual Studio Team System Beta 2 and I was greatly impressed for its unique features. These are the highlights : - This is a fully integrated suite of productivity tools to enforce the best practices of software development, it is integrated with Visual Basic .NET and also with Office 2003, ...
Currently, I am on one of those really standard tasks in a migration process: Software Intake. My role in this is writing application installation instructions for the helpdesk (or for packaging), whereafter these instructions are tested and then approved by the key-user. Now generally, I considder this rather boring an tedious work, however, you get to be exposed to a very large array of different software, which I do find usefull. I often learn a lot about what kind of software is out there during ...
I do not blame Microsoft for their pricing strategy on Team System. After all, you can't pay for a Pinto and get a new Cadillac. Why would you expect otherwise? Well, that is the problem. This was what we were expecting. We were not told that it was a five year development effort costing millions of dollars but we should have known. We were not told (well, Eric Sink DID warn us along with a few others) that VSTS was not a copetitor to Microsoft Project, Vault, and FogBugz but a competitor to Rational ...
Lately, I've been spending some private time learning Python. It is definitely a different beast than C#. For one, it has taken a little while to get used to the dynamicism of Python compared to C#. Now, don't get me wrong, I'm still in love with C#, I just am falling in love with certain aspects of the Python language. And, well, I'm going to blog about it here because I don't really have any one to share this with at the moment and I need to get it off my chest. I just had my first “OH SHIT!” ...
Source: http://weblogs.asp.net/rosh... This is a session from the recent Developer Testing Conference. The lecture was about Developer Testing in Google and this is only part of it: Sriram Sankar, who received his Ph.D. at Stanford. Sriram is now at Google in charge of Developer Testing. Here is the Sriram's Lecture on "Developer Testing in Google" Google is building very sophisticated products, with complex cutting edge technologies, never tried before algorithms, ...
Hey ... if you are in St. Louis, we have Jeff Julian and John Alexander tonight! September Meeting - Test-Driven Development and Unit Testing in Microsoft .NETMonday, September 26, 20045:30 - 6:30 pm Welcome6:30 - 8:30 pm ProgramJeff Julian, John Alexander One City Place DriveCreve Coeur, MO 63141[MAP] Unit Testing is a crucial piece of the development process. The problem is, most of us don't put the time in to properly construct this portion of the process. By skipping this portion, we cause issues ...
A SMTP server mock is basically a fake SMTP server which can be used for unit testing of applications which send email messages. It acts as a real smtp server, except that the incoming messages are locally stored and not actually delivered . This can be quite usefull if you are using real data for testing. ;-) .csharpcode { font-size: 10pt; color: black; font-family: Courier New , Courier, Monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0px; } .rem { color: ...
Ben Carey and I will be speaking at the .NET Developers Group in Central Ohio this Thursday (9/23) on Open Source Tools for .NET Developers. In the discussion, we'll go over several of the popular tools that assist in the development process: Nant - the infamous build tool. Nunit - test first, dawg. CruiseControl.NET - makes all the other tools smile. Nmock - because unit testing your web service is your job, not mine. Ndoc - comparing JavaDoc and MSDN output should tell you something. Ben's really ...
Testing Your Web Application A Quick 10-Step Guide by Krishen Kota Interested in a quick checklist for testing a web application? The following 10 steps cover the most critical items that I have found important in making sure a web application is ready to be deployed. Depending on size, complexity, and corporate policies, modify the following steps to meet your specific testing needs. Step 1 - Objectives Make sure to establish your testing objectives up front and make sure they are measurable. It ...
Curious to know what those TBA sessions are really about? With registration going live in Hall F at the San Diego Convention Center at 9:00 AM, you will be able to pick up your mini-guide and see the new titles in print, or go to CommNet and see the new titles have been posted. They include: Breakout Sessions: DEV200, DEV300, DEV301, DEV302, DEV303 all have updated titles! Cabana Sessions: DEVC05, DEVC08, DEVC20, DEVC22, DEVC32, DEVC33, DEVC34, DEVC39, DEVC42 DEV200 General Session: Managing the ...
The ServerSide.NET has a recent article by Justin Gehtland entitled “Unit Testing in .NET”. If you aren't familiar with Unit Testing (and even if you are), this is a good intro article on the subject...