Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

Tuesday, May 20, 2008

Web Testing, Load Testing, Unit Testing...

I understand that unit testing should cover most of scenarios if an application is nicely designed with some pro-unit testing framework, namely MVC pattern. In .Net world, those unit testing friendly frameworks include Asp.Net MVC, and Castle Project. But a lot of times, an application has already been designed and put into the production, you don't have time, money, and energy to re-write those anti-unit testing applications based on unit-testing friendly framework.  Mostly importantly, business users don't understand why you want to rewrite an application just because you want to be able to unit testing it, they just need a workable application, and don't care too much about the back end unit testing which is an essential part of the whole project.

I am working on an application which is heavily depend on CSLA.Net framework, which is a very impressive framework. However, the framework is not very TDD friendly, and check out some discussions in this post. I started to look for some other alternatives which can automate the testing process, and the visual studio team system had an edition for software testers starting from Visual studio 2005. But honestly, I won't recommend using it unless you have the VS2008 version. The biggest limitation of VS2005 test version is that it doesn't support Ajax testing natively, and you have to rely on fiddler tool to record the testing. VS 2005 test version cannot detect dynamic parameter very well, and I have big trouble to get those viewstate related variables work. VS 2008 version definitely did a lot of improvements in those areas, although it's not free of bugs either. Check out an excellent post on web test in visual studio 2008 here.

A couple of roadblocks I have in working on the automating tests are:

1. You have to turn page validation off and view state check off. You probably want to turn it back in production environment.

<pages theme="Main" enableEventValidation="false" enableViewStateMac="false" >

2. You may need to hard code a machine key if you want to port the test to different sites. In our cases, we recorded the tests on a test website, but we also want to run it on stage site too.

   1: <machineKey


   2:     validationKey="9A1F64F585E06F97562808D96860AC9E3DA5F231EA34B42E8C98AE02B52EAF33CF7EF24C618F7F391756974090458C9740BE1007E6F898161C39B863A7E46C3D"


   3:     decryptionKey="376909E1031E5AA520AAE33B554ACACCE0CAEA2BA0B142FB3050D814059398CB"


   4:     validation="SHA1" decryption="AES"/>  




3. Some post parameters are promoted as dynamic parameters incorrectly, watch out those if you need manually correct those.



4. Check out this web test plug in if you want to use some .Net functions in your test.



Sometimes, you want to create set up some specific pre-testing condition, and tear down those values added to your database in your testing, you can create a plug in to do this work.



WebTestPlugIn



In our projects, in PreWebTest, we create an object in the database which we need run our test on, and in PostWebTest, we delete this object. It works very well for our situation. We run those tests every day , and those green pass icons definitely make our life much easier.



 



TestResults

Friday, May 16, 2008

Install the source server for TFS Building.

In the book "Advanced windows debugging", a detailed process on how to set up source server for the visual sourcesafe building. But most people today are now using the Team system to mange the code and build system, and here is an excellent link about "Setting up the Source Server for TFS builds".

Good stuff.

Monday, April 07, 2008

Clear workspace in TFS

We have a couple of contractors who worked on our project before left. When they left, they didn't check in all the codes on their machine. I work on deleting some of the projects which have files checked out by them and are not used by anybody else now. I cannot do that because the TFS complains that some files were checked out by those contractors.

I googled around and found a simple solution in MSDN, the easiest way is to delete the workspace altogether:

Here is the exact command: tf worksapce /delete /server:servername workspacename[;workspaceowner].

The workspacename is normally the machine name.

MSDN link is here.

Thursday, May 17, 2007

Integrate Visual Studio 2003 with the Team Foundation Server Process


The Team foundation server is release by Microsoft after Visual studio 2003, so the visual studio 2003 has to go through a couple of manual configuration process to be able to work with Team Foundation Server.


  1. Download “Visual Studio 2005 Team Foundation Server MSSCCI Provider” from Microsoft Website. (The download link could change in the future, it’s best to download a copy and store it on some place on the server).

  2. The prerequisite to this installation is that you must already have:

    1. Visual Studio 2005 Team Foundation Server

    2. Visual Studio 2005 Team Explorer

    3. .NET Framework 2.0


If you already work with Team Foundation Server with the Visual Studio 2005, you should already have those program installed.


  1. To add an existing project to the Team Foundation Server, Right Click the Solution you want to add to the Team Foundation Server, and click “Add solution to source control”.


  1. Select the Tfs server you want to connect to: (If it’s the first time you connect to the Tfs server, you have to type in the Tfs server name you want to connect to.)


  1. Add the project to the Tfs Server.


  1. After adding the project, you can see all the icons turned to “checked in” status.

  1. You can also go to File -> Source Control to add an existing project to the solution.