Wednesday, August 26, 2009

QSI Grok Talk: PEX

Developers at Quick Solutions have a monthly meeting known as "Grok Talk". The meeting typically takes place during lunch. The goal of the meeting is to share information on the topic of choosing. The most recent Grok has been done by Mel Grubb on PEX.
Here is the recording of the session:

Friday, August 14, 2009

QSI Tech Night: Code Generation with T4 Templates

Recently, Mel Grubb has presented Code Generation with T4 Templates at Quick Solution's Tech Nigh meeting. While we still finalizing the details on how to share those presentations with the community you may watch Mel's presentation from here:


Monday, August 3, 2009

Follow up questions from KY SDLC

After the SDLC presentation we had several questions that we were going tofollow through:

Q: How can I see all created Alerts for the selected TFS Project?
The answer is Yes and No. There is no an easy UI that will tell someone of all project alerts, but this information can be easily discovered by two methods:
Option 1: Query the underlying database (not recommended), all subscriptions are stored in
[TfsIntegration].[dbo].[tbl_subscription]. If soemone chooses this path my recomendation would be: LOOK, BUT DON'T TOUCH.
There is a reson on why there is ae extensive set of API asvaialble to us, modifying data in the table may lead into path of unpredictable problems with TFS.

Option 2: use TFS API web services to aggregate the information.
you will start by calling ReadIdentityFromSource method of the http://localhost:8080/services/v1.0/GroupSecurityService.asmx service to find out the list of all users that have access to a project, assuming that you know names of the Application Groups (like Contributors, Project Administrators, etc) then you can set factor as: AccountName, and factorValue as: {Account Group Name, ex. [DCVR]\Contributors]}

Now that you have a list of users that have access to the project, you may get each person's subscription by calling EventSubscriptions method of http://localhost:8080/services/v1.0/eventservice.asmx service.

if you are not sure on what Application Groups you have, you may find them by either looking at the "Group Memebership" option of the Team Project Setting in the Team Explorer or you can use TFS APIs:

http://localhost:8080/services/v1.0/CommonStructureService.asmx?op=ListProjectsx to get the Project URI
http://localhost:8080/services/v1.0/GroupSecurityService.asmx?op=ListApplicationGroups to get the list of the groups for the selected Project URI.

More information of the TFS API can be found at Buck Hodges blog


Q: I am having a problem with check-in 50MB file, is there a setting to increase a max size of checked in file?
There are no switches in TFS that will limit a person on the size of the check-in file. Mike and I were able to check-in 100+MB file without any problems. My recomendation will be to check IIS and Application Event logs for logged messages as a strating point to troubleshoot the issue.

An interesting fact is: if you are checking large files (>16MB) then TFS deltas mechanism that is used to figure out the difference between file versions will not be used, which means that the entire file will be checked into source control. Not a big deal unless you are working with a lot of large files and have a database disk constrain. To ensure that TFS deltas mechanism is used to store file revisions you will need to update the default value of "deltaMaxFileSize" key located in {TFS Install Folder}\Web Services\VersionControl\:


Another interesting fact: by default workitem attachments are limited to 4MB sizes. To change that value one will need to call the GetMaxAttachmentSize method of http://localhost:8080/services/v1.0/ConfigurationSettingsService.asmx service.


Q: Can recorded Web Tests be hooked to the external data source to provide input values?
Yes, web test can be easily configured to support input of the values from the external sources like: database, csv, or xml. You may find additional details from my previous post: http://govorin.blogspot.com/2009/07/data-driven-web-tests-with-vsts2008.html

Thursday, July 30, 2009

Data Driven Web Tests with VSTS2008

Recently, I was asked if a recorded WebTest can be link to the external datasource for data feed. For example if we would like to pass different search parameters into a search page to test the logic and data of the search, we definitely do not want to have multiple tests that do the same thing. It totally make sense to have a single test that will feed different data and will aggregate/reports results back to us.

My second attempt at the webcasting runs through example on how to accomplish data bounding to the web test:


Visual Studio Team System Testers Edition has an option of recording a Web Test, once the test is created we can easily add a data source to it, by doing following steps:

1. Right Click on the web test, Select Add Data Source.
From here you will a Wizard with multiple choices:





I think that you may want to use CSV,XML types:


  • if you want BA or End Users to easily provide you with a test data

  • if the amount of data is small

  • you need a version history of data evolution (the file can be checked in into Source Control and deployed as part of the build process).


The Database choice is good:


  • large amount of data (thousand/million data points).

  • re-use the same data across multiple test/projects/teams/environments.


Once the data source is created, all is left is to replace hard coded values for the data from bound source.

2. Find a Post Parameter by expanding Request Form Post Parameter

3. Select Properties by Right Click on ContentPlaceHolder

4. Select created DataSource by Clicking on the drop down menu of the Value property.

5. Expand Datasource and Navigate to the needed column.





This is it, you know can run web test and feed the data from the external source.

But what if you want to add Validation and Extraction rules to your test and be able to run positive and negative tests, how do you do it with external data source?

You may take a similar approach and try to bind the value properties of the rules to data source, but you may run into a problem of setting the "Pass if Found" Boolean property.





In my opinion it would be better to convert the test to coded version and then you will have control over all aspects of the test.

6. Select Generate Code by right Clicking on the web test.





7. Make changes to the "PassIfFound" property of the rule.



Web Test Coded file from my demo can be downloaded from here

Tuesday, July 28, 2009

Missing Demo from SDLC KY: Branching and Merging with TFS Source Control

This webcast is a brief demo of how one may use TFS Source Control and its rich set of features like: Branching, Merging, and Shelving to manage production and development code.

I have collapsed the 90 minute demo into 35 minute webcast.
This is my first webcast, so any feedback is appriciated.
At some point I will re-record it at lower resolution.


Sunday, July 19, 2009

Columbus Give Camp on June 17th - 19th.

Working with great number of people at Columbus Give Camp, check out our live feed.

Friday, July 17, 2009

KY SDLC Day 2 Summary

It was a pretty full day, it is very unfortunate that Mike and I have run out of time and were not able to cover all the topics in needed details. In the upcoming days (weeks), I will a set of the recordings to capture testing and source control in greater details, meanwhile you may visit Team System Cafe for a great variety of information on VSTS/TFS.

On Day 2 we have covered following topics:

1. VSTS Architect
We talked about Physical, Logical, and Deployment diagrams. In the demo we have used VSTS as architects (infrastructure & software) and build master to generate/validate diagrams; model the application and to have generated code based on our models.

2. VSTS Database Professional, aka "DataDude"
Is probably one of the most under-used edition of VSTS, which by the way, is now became a part of the VSTS Developer Edition. As a DBA we have covered topics of Managing, Developing, and Deploying database. We reviewed schema compare/validation/refactoring/deployment, data compare, data generation with Data Generation Plans, visioning of database, and creation of database unit tests.

3. VSTS Developer
Since were short on the time we have skipped demoing some of the development tools and concentrated demos on how the developer can use Code Coverage, Code Analysis, and Code Profiling (Instrumentation and Profiling) to troubleshoot and improve the quality of created code.

4. Creating Unit Tests, Test Driven Development, and Data Driven Tests.
In this portion of the SDLC presentation we have talked about the importance of testing and various ways one may start doing it. It can be as easy as "right click" and "generate test" (as I heard at the PDC08: Even a VP Can Do It), to getting into xDD (where x is Test/Behavior/Domain/etc Driven Development). TDD is all about Red-Green-Refactor!

In this section we have also expanded on Code coverage and demonstrated that hooking the test to data source can significantly reduce amount of tests a developer needs to write, while still maintaining a reasonable code coverage.

5. TeamBuild
On all the projects that I have a privilege to be part of, we have also setup a Continuous Server (CI) to establish an environment for automated code build and verification. I try to have a CI setup and go on day one of the project. TeamBuild is an excellent tool for creating and maintaining solution builds, we have demonstrated build can be setup under 2 minutes and perform all kings of tasks including test execution, code analysis, build failure notifications. Since TeamBuild sits on top of the MSBuild one may use a variety of created MSBuild tasks to perform additional actions like: code promotion to QA/Testing environments (only if it passes all other validations), creation of website, registration of DLL, file updates. Using Community MSBuild Tasks from TIGRIS, we were able to change the keys of the web.config file to reflect the changes between development and QA database connection strings. There are many other good collections of MSBuild tasks, like MSBuild Extension Pack.

6. VSTS Tester
Since we had limited time we showed only only Web and Load Tests in details. VSTS Tester edition has a set of powerful tools to allow us to create and manage a variety of test types. One of the greater features is an ability to capture user interactions between the browser and the server on the TCP layer stack and being able to replay it back as a WebTest or convert it to the .NET code.

I will be putting an additional posting to cover Testing in greater details, to cover other type of tests like: manual and ordered.

7. First look into VSTS 2010
Mike has given us a teaser into what Microsoft will be releasing soon, VSTS 2010, TFS 2010, .NET 4.0 all of those tolls has many new and improved features. You may get Mike's presentation from here.

You may find a lot of material on 10-4 (VSTS2010 and .NET4.0) on:


8. Advance Source Control, for the 4 people that waited patiently for it :)
We have talked about Branching and Merging strategies. We have run through a real-life example on how one may work on the production V1.0 code performing hot fixes, at the same time continue development of the V2.0 application , and how merge can be completed between application branches.

Since mostly of the people missed this demo due to time constrains, I will be putting a recording of it in a very close future.

Here is a great white paper on Branching Strategy