WebCast MSDN: Introducción a Páginas Web con ASP.NET y Razor Syntax
Hope to have you with us in this event (next 20th March). Register here.
Sharing my daily work experience..
Hope to have you with us in this event (next 20th March). Register here.
Published By Javier Arguello at 12:35 AM 0 comments
This is an experiment to caché results from static classes in an ASP.NET MVC project.
Domain services (see DDD) are static classes for this project :(.
Caché usage is as following:
The MethodCache.Get uses the calling method name as caché Key (in the previous code fragment TiposMoneda), so you don’t need to specify a caché key if you don’t want to.
Here is my implementation:
Note the NoInlining method option. This is a very important flag to the CLR. We don’t want to inline the method as it would interfere with the StackTrace (thus with the evaluation of the caché key).
Published By Javier Arguello at 1:06 AM 0 comments
“Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior.” Martin Fowler
Using Code Metrics feature of Visual Studio (or Code Metrics Power Tools if you don’t have Premium or Ultimate edition) you can get some good information about which unit of code or components are candidates for refactoring.
Use this tool regularly in order to track refactoring opportunities. Check this MSDN article and this Post for usage.
Some metric hints you could use:
For valid ranges, check this Post.
PS: I will be working on how to get this metrics into a TFS Team Project Report.
Published By Javier Arguello at 1:07 AM 0 comments
Labels: ALM, Code Metrics, Team Foundation Server, Team System, Visual Studio
A good Agile practice that I’ve personally tested is registering our daily work evidence using images. Source code images, screen images of our application, database tables, etc. Anything that could give other people a quick hint about our work.
Using TFS we can update daily Task status using Work Items. Having images associated and displayed with them is not as straight forward as it should be (like pasting images in Word or in an Email).
One recommended approach is to upload a very simple and lightweight PPT or Word document containing images of evidence for all team members to a folder in the project’s SharePoint site. This could be done under a folder called “Daily Evidence” or something. The name of the PPT/Word file could be the current date (02/23/2012) or such.
At the end of the day, a simple report could detail the status of tasks for every team member and have a link (calculated automatically) to the Evidence file in the SharePoint site.
End of Day Progress Report Sample
Using Reporting Services Subscriptions feature, you could also have this report sent by email automatically.
Published By Javier Arguello at 11:52 PM 0 comments
Labels: ALM, Team Foundation Server, Team System, TFS, Visual Studio
Hope to see you there next Tuesday (28th). Register here https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032506180&culture=en-us.
Published By Javier Arguello at 11:24 PM 0 comments
UI automation could be a very very complex procedure. Several things could change between different executions, controls could be moved or renamed, etc.
Some simple things such as closing a dialog popup/window could be challenging..
Let’s try to recreate the problem. File/New Project in Visual Studio 2010, then select Windows Forms.
Add a button with the following handler on the click event:
Record a CodedUI test that opens our super simple WinForm App, click Button1 and then close the message box. Finally, add one last step to record that closes the Main Window.
Now run the previous CodeUI test and check how the test reports a successful execution. Note that your Message Box is still opened and your application is still waiting for input.
* I imagine that it should be a better way of working around this effect than the following. If you figure it out let me know :).
Let’s create a UIMapExtensions class (containing extensions methods of course)
I am using 3 techniques in the previous code fragment. In each one of them, we wait for the control to respond to the close action (for 3000 ms).
Now you can just replace some of generated test code in the Test Class (not in the UIMap):
My two cents..
Published By Javier Arguello at 12:05 AM 0 comments
Labels: ALM, Testing, Visual Studio
Automatic Builds for Application Release is a current practice in every major development factory nowadays.
Using Team Foundation Server Build 2010 to accomplish this offers many opportunities to improve quality of your releases.
The following approach allow us to generate build drop folders including the BuildNumber and the Changeset or Label provided. Using this procedure we can quickly identify the generated binaries in the Drop Server with the corresponding Version.
BuildDetail.DropLocationRoot + "\" + BuildDetail.BuildDefinition.Name + "\" + If(String.IsNullOrWhiteSpace(GetVersion), BuildDetail.SourceGetVersion, GetVersion) + "_" + BuildDetail.BuildNumber
The previous expression sets the DropLocation with the following format: (ChangesetNumber|LabelName)_BuildName_BuildNumber
The first part of the folder name will be the changeset number or the label name (if triggered using labels). Folder names will be generated as following:
Try launching a build from a Changeset and from a Label. You can specify a Label in the GetVersion parameter in the Queue new Build Wizard, going to the Parameters tab (for labels add the “L” prefix):
Published By Javier Arguello at 9:36 PM 0 comments
Labels: Build, Team Foundation Server, Team System, TFS, Visual Studio