DCSIMG
May 2009 - Posts - Shai Raiten's Blog

Shai Raiten's Blog

It's all about code...

May 2009 - Posts

VSTS2010 – Code Analysis

VSTS2010 – Code Analysis

The VSTS beta is out with many many great changes and new features.

The post today is about Code Analysis new features to help us writing more clear and safe code.

The “Code Analysis” window has been change to work with “Rule Set”.

image

A “Rule Set” is a collection of Rules categories and rules.

For Example:

“Microsoft Security Rules” is a Rule Set, it contains two Rules Categories:

  1. Microsoft.Design
  2. Microsoft.Security

Each Rules Categories contains specific rules.

For example “Microsoft.Design” contains “CA2210 – Assemblies should have valid strong names”.

image

Team System comes with couple of default “Rule Sets”, If you don’t familiar with Analysis rules or you don’t have enough to investigate you can select your by “Rule Set”.

Each “Rule Set” comes with description to help you decide which rules are fit for you.

image

You also can open the “Rule Set” and customize it.

The new window allows you to search specific rule, filter by rule action, change rules action and  of course create you own “Rule Set”.

image

Add\Remove Rules Set and Set new “Rule Set”

image

My Article in “Testing Experience” Magazine

My Article in “Testing Experience” Magazinecover02_09

In the past months I worked on an article about “Load Testing In 10 Steps” for “Testing Experience” magazine.

Testing Experience - testing experience is the challenge of producing a high-quality magazine for professional test-ers made by and issued for people involved in testing, the magazine have 350,000 readers around the world.

In this article, I’m not going to talk about load testing tools or advanced testing techniques, but rather, I would like to talk about 10 basic steps that are the foundation for creating a good, precise and powerful load test suite.

 

Load Testing in 10 Steps - Download Now

Bye “Camano” And Welcome To “Microsoft Test and Lab Manager”

Bye “Camano” And Welcome To “Microsoft Test and Lab Manager”

Official Names for the 2010 Test Products now announced.

Martin Hinshelwood's Blog published a great post on DEV10 -  Visual Studio Team System 2010 Beta 1 Ships

That

VS2010

You can see the announcement here by Jason Zander.

image_thumb_6

 

The VSTS Lab Management team blog also posts the Lab Management High Level Architecture

 

 image_thumb 

image_6

VS2010 – Validation\Extraction Rules Extensions

VS2010 – Validation\Extraction Rules Extensions

Validation Rules

Here is 3 new validation rules that are coming with Visual Studio 2010 Team system

Selected Option – Find a select tag inside the the html response and perform validation on the selected option value.

Tag Inner Text - Validates that the specified expected inner text exists within the specified HTML tag.

Response Time Goal – Visual Studio 2008 already had this option right? no exactly, In Visual Studio Response Time Goal was not a validation rule but propertie inside the request parameters.
In Visual Studio 2010 this feature becomes a validation rule additional to the request parameter.

Response Time Tolerance Value – The percentage that a response time may be over its goal still have the validation succeed. For example: a tolerance value of 15 means that a response time 15 present above its goal still be classified as valid.

image

Extraction Rules

Here is 2 new extraction rules add in Visual Studio 2010.

Selected Option – Extract the value of the selected option from a specific select tag.

Tag Inner Text – Extracts the inner text from the specified HTML tag.

image

VS2010 – New Web\Load Test Feature – Request Details

VS2010 – New Web\Load Test Feature – Request Details

In Visual Studio Team System 2010 Microsoft adds new window to help us setting Think Time, Response Goal Time and new parameter called Reporting Name.

For Example: I’ve recorded a web test with 2 requests, I want to give those request a string name instead the full url.

Before Report Name

Open the Web Test editor and click on “Set Request Details…”

Set  Request Details

New window will open called – Request Details
You can set more easily Think Time, Response time goal values and new parameter called Reporting Name.

Reporting Name – This is will be used in web and load test reports instead of the request URL.

  Request Details

After setting the reporting name you can see that instead of the url you will see in the results the name you entered.

After Set Request Details

We also can change Reporting Name from the properties window after clicking on a specific request.

image

Visual Studio 2010 - Looking Good! Screenshots

Visual Studio 2010 - Looking Good! Screenshots

New Project”

image

WPF Properties panel

image 

Connect to TFS

image

Work Item

image

Visual Studio 2010 – WitAdmin Command-Line Utility Commands

Visual Studio 2010 – WitAdmin Command-Line Utility Commands

We can say Bye Bye to - witimport, witexport, witfields, glexport, glimport, tfpt because

WitAdmin is Here!!!

Microsoft combine all TFS utilities and power tools to one utility called WITADMIN.

Also couple of exciting new features available: changefield we can change field name… Yes!

Here is the full list of features and details on each one.

  • changefield

      Changes properties of the field.

      Usage: witadmin changefield /s server /n typename [/name newname]
      [/syncnamechanges true|false] [/noprompt]

      /s                               Specifies the Team Foundation application-tier server. Either use the application-tier server name, or a fully 
                                         specified URL such as http://tfs:8080.
      /n                              The reference name of the field.
      /name                        The new name of the field.
      /syncnamechanges    Indicates whether or not the field's values should be
                                        updated in response to identity name changes.
      /noprompt                Turns off the confirmation message.

  • deactivatelinktype

      Deactivates the specified link type.  Users will no longer be able to create
      new links with this type. Existing links of this type will continue to function
      correctly.

      Usage: witadmin deactivatelinktype /s server /n typename

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /n    Specifies the link type to deactivate using either the link type name
             or reference name.

  • deletefield

      Deletes the specified field using the reference name.

      Usage: witadmin deletefield /s server /n typename [/noprompt]

      /s           Specifies the Team Foundation application-tier server. Either
                    use the application-tier server name, or a fully specified URL
                    such as http://tfs:8080.
      /n           Specifies the reference name of the field to be deleted.
      /noprompt    Turns off the confirmation message.

  • deletelinktype

      Deletes the specified link type from the specified server.

      Usage: witadmin deletelinktype /s server /n typename [/noprompt]

      /s           Specifies the Team Foundation application-tier server. Either
                    use the application-tier server name, or a fully specified URL
                    such as http://tfs:8080.
      /n           Specifies the link type to delete. The link type name or
                    reference name can be used.
      /noprompt    Turns off the confirmation message.

  • destroygloballist

      Destroys a global list.

      Usage: witadmin destroygloballist /s server /n typename [/noprompt] [/force]

      /s           Specifies the Team Foundation application-tier server. Either
                    use the application-tier server name, or a fully specified URL
                    such as http://tfs:8080.
      /n           Specifies the name of the global list to destroy.
      /noprompt    Turns off the confirmation message.
      /force       Turns off validation that the an item is not in use before being
                    destroyed.

  • destroywi

      Destroys a work item or work items.  Currently, work items can only be
      destroyed.  Destroying a work item means the work item is physically deleted
      and cannot be restored.  The system does not support logical (and thus
      recoverable) deletion of work items.

      Usage: witadmin destroywi /s server /id id [/noprompt]

      /s           Specifies the Team Foundation application-tier server. Either
                    use the application-tier server name, or a fully specified URL
                    such as http://tfs:8080.
      /id          Specifies the ID of the work item to destroy.  Supports multiple
                    IDs delimited by commas such as 12,15,23 (with no whitespace).
      /noprompt    Turns off the confirmation message.

  • destroywitd

      Destroys a work item type.  Currently, work item types can only be destroyed.
      Destroying a work item type means that work items of that type are physically
      deleted and cannot be restored.  It does not support logical (and thus
      recoverable) delete of work item types.

      Usage: witadmin destroywitd /s server /p project /n typename [/noprompt]

      /s           Specifies the Team Foundation application-tier server. Either
                    use the application-tier server name, or a fully specified URL
                    such as http://tfs:8080.
      /p           Specifies the name of the team project.
      /n           Specifies the name of the work item type to destroy.
      /noprompt    Turns off the confirmation message.

  • exportcategories

      Exports the XML definition of a project's work item type categories.

      Usage: witadmin exportcategories /s server /p project [/f filename] [/e
      encoding]

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /p    Specifies the name of the team project.
      /f    Specifies the destination file for exporting the work item type
             category XML. If not specified, the XML is output to the display.
      /e    Specifies the name of the .NET Framework 2.0 encoding used to import
             the XML.  For example, /e utf-7 will use Unicode (UTF-7) encoding.  By
             default, encoding is automatically detected when it is possible.  If the
             encoding can not be detected automatically, UTF-8 is used.

  • exportgloballist

      Exports the XML definition of global lists defined on a Team Foundation
      Server.

      Usage: witadmin exportgloballist /s server [/f filename] [/e encoding]

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /f    Specifies the destination file for exporting the global list XML. When
             it is not specified, the XML is output to the display.
      /e    Specifies the name of the .NET Framework 2.0 encoding used to import
             the XML.  For example, /e utf-7 will use Unicode (UTF-7) encoding.  By
             default, encoding is automatically detected when it is possible.  If the
             encoding can not be detected automatically, UTF-8 is used.

  • exportlinktype

      Exports the XML definition of a link type.

      Usage: witadmin exportlinktype /s server [/n typename] [/f filename] [/e
      encoding]

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /n    Specifies the name of the work item link type that is to be exported.
      /f    Specifies the destination file for exporting the link type XML. When it
             is not specified, the XML is output to the display.
      /e    Specifies the name of the .NET Framework 2.0 encoding used to import
             the XML.  For example, /e utf-7 will use Unicode (UTF-7) encoding.  By
             default, encoding is automatically detected when it is possible.  If the
             encoding can not be detected automatically, UTF-8 is used.

  • exportwitd

      Exports the XML definition of a work item type.

      Usage: witadmin exportwitd /s server /p project /n typename [/f filename] [/e
      encoding] [/exportgloballists]

      /s                    Specifies the Team Foundation application-tier server.
                             Either use the application-tier server name, or a fully
                             specified URL such as http://tfs:8080.
      /p                    Specifies the name of the team project.
      /n                    Specifies the name of the work item type to export.
      /f                    Specifies the destination file for exporting the work
                             item type XML. If not specified, the XML is output to
                             the display.
      /e                    Specifies the name of the .NET Framework 2.0 encoding
                             used to import the XML.  For example, /e utf-7 will use
                             Unicode (UTF-7) encoding.  By default, encoding is
                             automatically detected when it is possible.  If the
                             encoding can not be detected automatically, UTF-8 is
                             used.
      /exportgloballists    Exports the definitions of referenced global lists.  If
                             not specified, global list definitions are omitted.

  • importcategories

      This command imports a work item type category XML file into a team project on
      a Team Foundation Server.  If a category with the same name already exists, the
      new category definition will overwrite the existing definition.  If the work
      item type does not already exist, a new category will be created.

      Usage: witadmin importcategories /s server /p project /f filename [/e
      encoding]

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /p    Specifies the team project in which the categories are imported.  
      /f    Specifies the work item type category XML file to import.
      /e    Specifies the name of the .NET Framework 2.0 encoding used to import
             the XML.  For example, /e utf-7 will use Unicode (UTF-7) encoding.  By
             default, encoding is automatically detected when it is possible.  If the
             encoding can not be detected automatically, UTF-8 is used.

  • importgloballist

      Imports global lists from an XML definition file onto a Team Foundation
      Server. If a global list that has the same name already exists, the imported
      definition will overwrite the existing definition.  If a global list does not
      already exist, a new one will be created.

      Usage: witadmin importgloballist /s server /f filename [/e encoding]

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /f    Specifies the global list XML definition file to be imported.
      /e    Specifies the name of the .NET Framework 2.0 encoding used to import
             the XML.  For example, /e utf-7 will use Unicode (UTF-7) encoding.  By
             default, encoding is automatically detected when it is possible.  If the
             encoding can not be detected automatically, UTF-8 is used.

  • importlinktype

      Imports a link type XML definition file into Team Foundation Server. If a link
      type with the same reference name already exists, it will be updated to match
      the imported link type. If the link type does not already exist, a new link
      type will be created.

      Usage: witadmin importlinktype /s server /f filename [/e encoding] [/v]

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /f    Specifies the file that contains the link type XML to import.
      /e    Specifies the name of the .NET Framework 2.0 encoding used to import
             the XML.  For example, /e utf-7 will use Unicode (UTF-7) encoding.  By
             default, encoding is automatically detected when it is possible.  If the
             encoding can not be detected automatically, UTF-8 is used.
      /v    Validates the work item type or link type XML without importing it.

  • importwitd

      This command imports a work item type XML definition file into a team project
      on a Team Foundation Server.  If a work item type with the same name already
      exists, the new work item type definition will overwrite the existing
      definition. If the work item type does not already exist, a new work item type
      will be created.

      Usage: witadmin importwitd /s server [/p project] /f filename [/e encoding]
      [/v]

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /p    Specifies the team project in which the new work item type is imported.
             This is required, except when the validation-only option is used.
      /f    Specifies the work item type XML definition file to import.
      /e    Specifies the name of the .NET Framework 2.0 encoding used to import
             the XML.  For example, /e utf-7 will use Unicode (UTF-7) encoding.  By
             default, encoding is automatically detected when it is possible.  If the
             encoding can not be detected automatically, UTF-8 is used.
      /v    Validates the work item type or link type XML without importing it.

  • indexfield

      This command turns indexing for a field on or off.

      Usage: witadmin indexfield /s server /n name /index on|off

      /s        Specifies the Team Foundation application-tier server. Either use
                 the application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /n        The reference name of the field whose indexing information will be
                 updated.
      /index    Specifies whether the field should be indexed.

  • listfields

      Shows field information. By default, this lists all fields on the Team
      Foundation Server. Optional parameters can be used to list only specific
      fields.

      Usage: witadmin listfields /s server [/n typename] [/unused]

      /s         Specifies the Team Foundation application-tier server. Either use
                  the application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /n         The reference name of the field to display.
      /unused    Shows all fields that are not being used on the Team Foundation
                  Server.

  • listgloballist

      Lists the names of the global lists on a server.

      Usage: witadmin listgloballist /s server

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
             http://tfs:8080.

  • listlinktypes

      Lists the available set of link types on a server.

      Usage: witadmin listlinktypes /s server

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
             http://tfs:8080.

  • listwitd

      Lists the names of the work item types in the given project.

      Usage: witadmin listwitd /s server /p project

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /p    Specifies the name of the team project.

  • reactivatelinktype

      Activates the specified link type.  Users will be able to create new links
      with this type.

      Usage: witadmin reactivatelinktype /s server /n typename

      /s    Specifies the Team Foundation application-tier server. Either use the
             application-tier server name, or a fully specified URL such as
      http://tfs:8080.
      /n    Specifies the link type to activate using either the name or reference
             name.

  • rebuildcache

      This command invalidates cached data about work item types on all clients.
      Each client will refresh its cache the next time that it connects to the
      server. To avoid server performance issues, you should not run this command
      during typical operating hours.

      Usage: witadmin rebuildcache /s server [/noprompt]

      /s           Specifies the Team Foundation application-tier server. Either
                    use the application-tier server name, or a fully specified URL
                    such as http://tfs:8080.
      /noprompt    Turns off the confirmation message.

  • renamewitd

      Renames an existing work item type.  Changes the display name of a work item
      type within a specific project.  Also, the work items of that type are updated
      to reflect the new work item type name.

      Usage: witadmin renamewitd /s server /p project /n typename /new newname
      [/noprompt]

      /s           Specifies the Team Foundation application-tier server. Either
                    use the application-tier server name, or a fully specified URL
                    such as http://tfs:8080.
      /p           Specifies the name of the team project.
      /n           Specifies the name of the work item type to rename.
      /new         Specifies the new name for the work item type.
      /noprompt    Turns off the confirmation message.

  • reportfield

      Specifies whether and how the field is included in the data warehouse for
      reporting. For more information about how to use fields for reporting, see
      http://go.microsoft.com/fwlink/?LinkId=78060.

      Usage: witadmin reportfield /s server /n typename /t type [/formula formula]
      [/noprompt]

      /s           Specifies the Team Foundation application-tier server. Either
                    use the application-tier server name, or a fully specified URL
                    such as http://tfs:8080.
      /n           Reference name of the field.
      /t           Specifies how the field is used in the warehouse for reporting
                    (dimension, detail, measure, disable).
      /formula     Specifies a formula when the field is reported as a measure. The
                    only supported formula is sum.
      /noprompt    Turns off the confirmation message.

Visual Studio 2010 – TF Command – Rollback,Proxy

Visual Studio 2010 – TF Command – Rollback,Proxy

It’s so fun to find more and more new stuff Microsoft add to Visual Studio 2010, while visiting couple of old friends I've found couple of new option inside TF command.

Those features were available in TFPT command –line utility.

rollback - Rolls back the changes in a single or a range of changesets.

tf rollback /changeset:changesetfrom~changesetto [itemspec] [/recursive]
[/lock:none|checkin|checkout] [/version:versionspec]
[/keepmergehistory] [/noprompt] [/login:username,[password]]

tf rollback /toversion:versionspec itemspec [/recursive]
[/lock:none|checkin|checkout] [/version:versionspec]
[/keepmergehistory] [/noprompt] [/login:username,[password]]

Version Spec:
Date/Time               D "any .Net Framework-supported format" or any of the date formats of the local machine
Changeset number  Cnnnnnn
Label                        Labelname
Latest version         T
Workspace             Workspacename;workspaceowner

 

proxy - Configures the proxy setting automatically or manually. You can also use the proxy command to add, delete, and list proxy server records.


Run the proxy command with the configure option and no url value to
automatically detect and configure a proxy.

tf proxy ([/configure [url]) [/server:servername]
         [/login:username,[password]]

tf proxy /add url [/name:name] [/site:sitename]
         [/description:description] [/default:(global|site|all)]
         [/server:servername] [/login:username,[password]]

tf proxy /delete url [/server:servername] [/login:username,[password]]

tf proxy /list [url1 url2 ...]
         [/server:servername] [/login:username,[password]]

tf proxy /enabled:(true|false)

VS2010 – Coded UI Test

VS2010 – Coded UI Test

One of the most exciting features in Visual Studio 2010 is CodedUITest.

CodedUITest allows you to record screen actions to perform UI Testing.

Open visual studio 2010 and create new test project, add new CodedUITest.

image

CodedUITest appears and you can pick how do you want to record your test, in this post I'll demonstrate how to record CodedUITest using the Recorder.

Coded-1

CodedUITest recorder window appears.

Click "Record Actions" to start recording the test.

 Coded-2

In my demo I open calc and perform couple of simple actions.

After you finish recording give your CoedeUITest name and click "Generate Method" .

 Coded-3

 

Before you run the test you want to add validation rules for your CodedUITest.

Enter the "Add Assertions" tab click "Add UI Control".

Coded-5

 

Now drag the crosshair over the control you wish to create validation.

 

Coded-6

And click show properties , to view the selected control properties.

 Coded-7

Now you can see all values related to the select control, mark the values you want to validation and set the right comparator and value.

 Coded-8

After clicking ok you will see the validation inside the "Add Assertions" tab.

 Coded-9

Now close the CodedUITest window and from Test View window run your CodedUITest.

Enjoy.

Visual Studio 2010 – Historical Debugging

Visual Studio 2010 – Historical Debugging

One of the great features arriving with Visual Studio 2010 are “Historical Debugging”.

What is Historical Debugging?

If you’ve been in the development world for any length of time you’ve probably ended up in a situation like one of the following more than a few times.

  • You’ve received reports of a crash from a tester, but on your local box you can’t get the bug to reproduce.
  • You’ve received a crash dump from the tester along with the bug. But the callstack that actually caused the crash was just a cascading effect and you can’t trace the bug back to the root issue.
  • The bug that you are currently working at resolving has an extremely long set of reproduction steps and you just accidentally stepped over the function that is returning bad data.
  • You know that some part of your program is hitting the registry way too often, but while stepping through all that you see are .Net framework calls and you are unable to isolate which of them is doing all the extra registry work.

For more information about “Historical Debugging” read Historical Debugging with Visual Studio

Settings Panel

Event only – diagnose only event with minimal impact on application performance.

Using this option you are able to see “Diagnostic Event” view.

image

Events, Methods and Parameters – Method level tracing and have impact on application performance.

Using this option you are able to see “Debug Tree” view.

image

image

Limit Trace Recording and set if to see navigation while debug mode.

image

This area is very important, choose which modules you are tracking with running the application under Debug mode.

image

TFS 2010 Project Management

TFS 2010 Project Management

Brian Harry just post about TFS 2010 Project Management.

There are big improvements in TFS project management experience in TFS 2010, I recommend you to take a look!

Enjoy

image_thumb_18

Visual Studio 2010 Beta Only 1.22GB???

Visual Studio 2010 Beta Only 1.22GB???

If you noticed that Visual Studio 2010 Beta weight only 1.22GB it’s because MSDN documentation are not available from the DVD.

You can assist MSDN documentation from the Web.

image

VS2010 – Profiler

VS2010 – Profiler

Profiler 2010 comes with couple of new features for developers:

  • CPU Sampling
    Measures CPU-bound applications with low overhead.
  • Instrumentation
    Measures function call counts and timing.
  • .NET Memory Allocation (Sampling)
    Track managed memory allocation.
  • Concurrency
    Detect threads memory for other threads.
    • Collect resource contention data
    • Collect thread execution data

image

VS2010 – Extract Text – Random Match

VS2010 – Extract Text – Random Match

In Visual Studio 2008 we had Extract Text rule that can extract text from the response html using start index and end index.

In Visual Studio 2010(Visual Studio 2008 SP1) we have a new property for this rule called :

Extract Random Match – If true, all matches are found one of the matches is randomly returned.

Demo:

image

For each run I want to pick a random value from the Most popular image searches.

Inside the response html we can see that all top searches are looking like that:

</tr><tr><td align=center valign=top height=22 class=mf>

Avril Lavigne

</td></tr></table>

Using Extract Text rule to get the specific name, and set “Extract Random Match” to true, so during the test if this run is true team system will collect all the matches and pick a random one.

New Random Feature

VS2010 – Visualize Code Relationships (Architecture)

VS2010 – Visualize Code Relationships (Architecture)

Here is another new feature for Visual Studio 2010 - Visualize Code Relationships

There is 3 types of graphs:

  • By Assembly
  • By Namespace
  • By Class

image

By Assembly - This graph is all about showing you the dependencies between the various assemblies that make up all the projects in your solution.

 image

By Namespace

 image

By Class – This is one of the most complicated graphs because what you are seeing is dependencies at the class level, with no grouping by assembly or namespace

 

 

image

More Posts Next page »