"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

July 26, 2009

SQL High Availability Links

Compiled Posts for HA



Happy Learning!!!!

July 20, 2009

Service Broker Basics

Service Broker
  • Reliable transactional ordered message queue
  • Lives inside the SQL Server databases, can talk to other SQL Server brokers
  • Exposes Inbuilt Queues, Contracts for Asynchronous message processing
  • Managed using DLL, with limited GUI
  • See http://msdn.microsoft.com/en-us/library/ms345108.aspx
Service
  • Logical source or destination of the message. The service itself.
Contracts
  • Rules of the conversation. Zero or more per service.
  • Define the parties involved: INITATOR, TARGET, ANY
Queue
  • Queue of messages a service needs to process
Internal Activation
  • When Messages are dropped in the queue, An Activation procedure can be assigned to pickup the message and process it
  • This helps for asynchronous message processing
  • The number of readers for activation queue can be increased on need basis
  • When messages are dropped in heavy numbers 1000 per min, We can have as much as 50 readers (MAX_QUEUE_READERS) enabled to pickup and process incoming messages in queue 
External Activation
  • External program reading from queue (Windows Service)
How it flows
  • Service (Initator) starts a conversation with another service (target), with a contract.
  • Each side gets a conversation handle.
  • Initiator sends a message, which is routed/placed to the target server queue, ends conversation.
  • Activation triggers a stored procedure in the Target.
  • Stored procedure receives the message, taking out of the queue.
  • Stored procedure processes the message, ends conversation.
Service Broker supports transactional messaging, which means that messages are sent and received as transactions. If a transaction fails, the message sends and receives are rolled back, and don't take effect until the transaction has processed the messages successfully and committed.
Service Broker solves multithreading issues by putting a lock on the conversation group when a message is read, so that no other thread can receive associated messages until the transaction commits. Service Broker makes multithreaded readers work simply and reliably. Because Service Broker runs in the context of the database instance, it can maintain an aggregate view of all messages that are ready to be transmitted from all databases in the instance.

Detailed Notes Here
SQL Server 2005 Service Broker References
Service Broker Example - Creation of a Simple Queue and Posting a Message
TSQL setup Script example here
ServiceBroker oneliners here
Service Broker Troubleshooting here

Architecting Service Broker Applications
Architecting Service Broker applications (part 2)
Service Broker – Bookmarker
Service Broker Solutions - Don't Forget the Basics
Service broker concepts and troubleshooting
SQL Bits - Service Broker: Message in a bottle
ssbdiagnose Utility

Got the below error today 'An exception occurred while enqueueing a message in the target queue. Error: 15404'
1. First step clear messages in transmission queue. Query here
2. Second step link provides rootcause and resolution. use EXEC sp_changedbowner 'AccountName'

Useful Queries
Tip1 . Query to Check Service Broker is Enabled for a Database

SELECT IS_BROKER_ENABLED, NAME FROM SYS.DATABASES WITH (NOLOCK)

Tip 2. Query to Check for Service Broker Queues and their Status

SELECT name as Queue,
CASE WHEN is_receive_enabled = 1 THEN 'Enabled'
ELSE 'Disabled' END AS [Queue Status]
FROM SYS.SERVICE_QUEUES WITH (NOLOCK)

Tip 3.Query to check for MessageTypes defined for ServiceBroker

SELECT * FROM SYS.SERVICE_MESSAGE_TYPES WITH (NOLOCK)

Tip 4. Query to check for configured Service Contracts

SELECT * FROM SYS.SERVICE_CONTRACTS WITH (NOLOCK)

Tip 5. Query to check for Activation Enabled for Queues

SELECT name as Queue,
CASE WHEN is_activation_enabled = 1 THEN 'Enabled'
ELSE 'Disabled' END AS [Activation Procedure Status]
FROM SYS.SERVICE_QUEUES WITH (NOLOCK)

Tip 6. Query to check for Messages in Transmission Queue

SELECT CONVERT(VARCHAR(1000),message_body),* FROM sys.transmission_queue WITH (NOLOCK)


Happy Reading!!

July 19, 2009

Deleting Huge Recordset from Table in batches

While deleting a Dataset < @consition from a huge table (ex-millions of records we would get transaction log full error). The best practice is to do a batch delete. A good example is provided here One Way is mentioned here recurring step

I would recommend the solution mentioned here

--CREATE Testt Table
create table testt
(id int identity primary key not null
,name char(10)
)

--Insert Entries
declare @i int
set @i=0
while (@i <10000)
  begin
      insert into testt (name)
      select 'name'+CONVERT(char,@i)
      set @i=@i+1 end

--Delete Entries
set rowcount 5000
while 1=1
  begin
      delete from testt where id > 1000
      if @@ROWCOUNT = 0
      break;
  end
set rowcount 0

select count(1) from testt (nolock)
--1000

Also additional benefit is when batches are committed log file portion which was used can be reused as data is committed already. Plus only a range lock would be placed for the portion of records (range lock), Possibilities of escalating to a table lock is less.

Lock escalaltion is triggered when A single Transact-SQL statement acquires at least 5,000 locks on a single nonpartitioned table or index. source here

Performing batched updates

While BCP for faster inserts the database recovery model of the target table must be either Simple or Bulk Logged. From Msdn link. Anothere Reference link

DELETE TOP x rows avoiding a table scan
Update Record in Batches - TSQL coding patterns I
Gradually Deleting Data in SQL Server

Happy Learning!!!

SQL Server 2005 Replication Learnings

Transaction replication notes from by Jose Barreto

#1.
Configuring Replication for Partitioned Tables Using T-SQL Here
MSDN link for Scripting Replication here
One more Replication Setup Script here

Which objects in the database are published?
<<Publish DB>>
SELECT * FROM sysarticles
SELECT * FROM syspublications

<<Distribution DB>>
Use Distribution
GO
SELECT * FROM distribution..mspublications

--Cleanup uncleaned subscriptions
delete from mspublications where publication_id=7
Note: You might have to delete from MSsubscriber_schedule as well. For me deleteting from mspublications fixed the issue.

<<SubscriberDB>>
USE <<SubscriptionDB>>
SELECT * FROM MSsubscriptions
SELECT * FROM MSsubscriber_info

#2.
While setting up transaction replication on a table that has millions of records. Initial snapshot would take time for the records to be delivered to subscriber. In SQL 2005 we have an option to create the tables on both transaction and publish server, populate dataset and setup replication on top of it. When you add subscription with command EXEC sp_addsubscription set The @sync_type = 'replication support only'. Example here

#3.
Replication - Difference between push and pull subscription
Distribution agent for push subscriptions typically runs on the Distributor. For pull subscriptions, the distribution agent typically runs on the Subscriber.

In a Pull Subscription
1. Distribution agent resides on subscriber instead of distributor because subscriber initiates replication request
2. Distributor sends data to distributor agent on subscriber
3. Replication by pull subscription has control at subscriber side instead of publisher

In a Push Subscription

1. Replication in push subscription has control in publisher, subscribers do not need to initiate replication request
2. Changes in publisher could be sent to distributor by demand, by schedule or continuously.

I found this link useful for highlighting above differences Thanks to the author.

Best Practice as suggested by msdn link here says pull subscriptions perform much better than push subscriptions in a WAN scenario.

Transaction Replication Deep Dive

Got the below error today "The row was not found at the Subscriber when applying the replicated command. (Source: MSSQLServer, Error number: 20598)".

Found workaround for this to be to skip this error at Distributor Agent. You can add the parameter to the distribution agent -SkipErrors 20598. Steps mentioned in Microsoft KB here

Replication Performance Tuning Guidelines

1. Performance counters to check for replication - SQLServer:Replication Dist.-Dist:Delivery Latency
2. Inserting Trace Tokens and check time taken to replicate data between publisher-distributor and subscriber

SQL 2008 R2 MSDN Replication Documentation

Merge Replication Step by Step
Troubleshooting SQL Server Transactional Replication
Log Reader Agent Fails with the Error “The Log Reader Agent failed to construct a replicated command from log sequence number (LSN)”
Customized Alerts for Transactional Replication
How to resolve when Distribution Database is growing huge (+25gig)
Using sp_repldone to mark all pending transactions as having been Replicated
Checking Replication Latency with T-SQL
Determine Transactional Replication workload to help resolve data latency
Troubleshooting LogReader Timeout executing sp_replcmds
How to cleanup Replication Bits
Distribution latency in transactional replication: Is a volume surge the culprit?
Troubleshooting Transactional Replication - PART 1
Troubleshooting Transactional Replication - PART 2
Troubleshooting Transactional Replication - PART 3
How to add an article to an existing Transactional Subscription initialized through backup
How to replicate some fields of two different tables?
Adding a column to Destination table
SQL 2005 Transaction Replication – Adding new article to an existing publication
Replication Agent has not logged a message in 10 minutes
SQL Server Replication Explorer
Divide and Conquer Transactional Replication using Tracer Tokens
All About Automatically Monitoring Replication Agent Failures
Replication features in various editions of SQL Server 2005/2008
Undocumented Gotchas of Transactional Replication

Happy Reading!!

July 06, 2009

Web Services and Web Testing using VSTS

[Previous Post in Series - Performance Testing Explained]

Web Testing using VSTS


Steps for VSTS performance testing is mentioned here



A Few guidelines for performance testing

Performance test plan should include test scenarios (At different loads, expected results), Signoff criteria defined, Performance counters to be analyzed, Details of Performance Test Bed (Hardware configuration). The tasks for performance testing would include - Environment Setup, Test Data Preparation, Test Execution Time, Bug Fix Time line, Targeted Signoff Date.

1. Identify the Performance Counters for IIS, DB
2. Benchmark the environment, Hardware configuration before starting test run
3. Conduct couple of Trial runs to verify Test Environment has no Setup, Hardware issues
4. For a typical web serices or Web App performance testing 80% of requests should pass through to consider test run successful
5. While Validating/Identifying Issues validate bottleneck is at SQL or IIS level. Server Side Trace could be enabled to capture SP:StmtCompleted Events
6. Provide a clear report on perf test results.

Example:
Test Scenario:
Test Data Mix:
Test Duration:
Key Findings:
Perf Counters:
Detailed Results:
Conclusion:



Happy Reading!!

July 05, 2009

Work Life Balance Tips

Couple of interesting posts and ideas to improve work-life balance. I have been trying to apply it :). Still Work in Progress.

Good links and useful practical tips....
http://blogs.msdn.com/jmeier/archive/2007/02/04/my-personal-approach-for-daily-results.aspx
http://blogs.msdn.com/jmeier/archive/2007/03/21/the-secret-of-time-management.aspx
http://blogs.msdn.com/jmeier/archive/2007/02/26/using-scannable-outcomes-with-my-daily-results-approach.aspx
Job Satisfaction : Working Effectively with Others

Another Good Read from link It is impossible to work between 9-5
  • Depends on Your Working Style (Working Independently, Working in Teams)
  • Identify Major Blockers (Interrupting Team members, Meetings, Mails, Chatting)
 I Like the Quote
“What matters is not the amount of time you’re present, but the amount of time that you’re working at full potential. An hour in flow really accomplishes something, but ten six-minute work periods sandwiched between eleven interruptions won’t accomplish anything.”
“People bring their brains with them every morning. They could put them to work for you at no additional cost if only there were a small measure of peace and quiet in the workplace”







July 04, 2009

Agile Development Models

SCRUM

SCRUM Introduction - http://scrummethodology.com/
SCRUM Introduction Video - http://video.google.com/videoplay?docid=-7230144396191025011&q=Google+Tech+Talks&hl=en

Extreme Programming

http://venturehacks.com/articles/extreme-programming-explained
http://www.scissor.com/resources/teamroom/

http://blogs.msdn.com/jmeier/archive/2008/08/18/software-methodologies-at-a-glance.aspx

http://blogs.msdn.com/jmeier/archive/2008/07/22/agile-guidance.aspx

MIT Opencourseware for Computer Science

Please find link for 
Happy Learning!!!

Orthogonal Defect Classification

ODC (Orthogonal Defect Classification) model originated from IBM. It tracks back defect to the stage where it was introduced ex: Analysis, Design, Coding. Below Links provide good materials.

http://twin-spin.cs.umn.edu/files/ODC_TwinSPIN_010605.ppt
http://www.research.ibm.com/softeng/ODC/ODC.HTM
http://www.nasa.gov/centers/ivv/ppt/172574main_Lutz_Adapting_ODC_SAS_03.ppt http://www.niit-tech.com/edocs/ODC_a_white_paper.pdf

This model provides a clear end-to-end visibility over which phase defect was introduced. We would also discuss about Orthogonal Array Testing technique soon.

Happy Reading...

Thanks,
Sivaram

SQL Server Training videos

Free SQL Server Training Vidoes

http://weblogs.asp.net/scottgu/archive/2007/03/01/free-sql-server-training-videos-and-other-good-data-tutorial-pointers.aspx

http://www.jumpstarttv.com/

http://www.asp.net/LEARN/webcasts/

How do I Vidoes
http://msdn.microsoft.com/en-us/bb629407.aspx

July 02, 2009

Powershell basics

Windows PowerShell includes new command-line tools that allow you to efficiently complete server administration tasks that are common across all Windows Server 2008 roles, such as services, processes, and storage

Scenarios using powershell
· Deploying and configuring Internet Information Services 7.0
· Terminal Server managementManaging command-line services, processes, registry, and WMI data (get-service, get-process)
Powershell Downloads
Windows PowerShell 1.0 Installation Package for Windows Vista (KB928439) - http://www.microsoft.com/downloads/details.aspx?FamilyId=C6EF4735-C7DE-46A2-997A-EA58FDFCBA63&displaylang=en

Powershell Provider for IIS7 - http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1664

PowerShell Scriptomatic - http://www.microsoft.com/technet/scriptcenter/tools/psomatic.mspx
PowerShell GUI Editor - http://powergui.org/index.jspa

Powershell Handson Examples
Example 1
1. Type "Hello " + "World"
2. Result will be Hello World. First Classic Example Over

Example 2
1. Type the below function
function sum ([int]$a,[int]$b) {
return $a + $b
}
sum 10 15

Example 3
We have cmdlets in powershell equivalent to cmd.exe built in commands.
· Get-Location
· Get-ChildItem
· Get-Date

Example 4
From Powershell cmd prompt type notepad. It will open notepad ( Not a gr8 example though :-))
1. Notepad
2. Type Get-Process
This will list processes that match name notepad
Enough of Examples...What are real world examples...

Example 5
Installing an MSI
2. Created a ps1 file with following commands
$box="TestPC002" #this is the name of your server
$product= [WMICLASS]"\\$box\ROOT\CIMV2:win32_Product"
Write-Host "Installing software on $box"
$product.Install("c:\Users\Desktop\Tools\abc.msi")
Do F5, MSI Installed. Easy isn't it..

Example 6
Event Monitoring
# Powershell script to find Error messages in the System eventlog.
get-EventLog system -newest 2000 where {$_.entryType -match "Error"}

Example 7
Writing to EventLog Using Power Shell
function Write-EventLog
{
param([string]$msg = "Default Message", [string]$type="Information")
$log = New-Object System.Diagnostics.EventLog
$log.set_log("Application")
$log.set_source("PSscript")
$log.WriteEntry($msg,$type)
}
write-eventlog "Testing as function" "Information"

Pipelines
Powershell allow you to combine two or more commands into a single custom command that creates an operation known as a pipeline. When commands are chained together in a pipeline, they pass data to each other as objects.

Example 1
Use the Get-Member Cmdlet to discover what types of objects the get-process Cmdlet returns
get-process get-member
Example 2
$a = Get-ChildItem *.txt
foreach ($file in $a)
{
if ($file.length -gt 10)
{
Write-Host $file.name
}
}

In this example, the results from the Get-ChildItem command are put into the $a variable, which is then used by the foreach loop to iterate through the file information.
PowerShell Scriptomatic
http://www.microsoft.com/technet/scriptcenter/tools/psomatic.mspx
Opened up the tool
1. On the WMI namespace select Root\CIM2. Classes select Win32_BIOS. We see the script populating below data

Below code got populated
$computer = "LocalHost"
$namespace = "root\CIMV2"
Get-WmiObject -class Win32_BIOS -computername $computer -namespace $namespace

Links and References
http://en.wikipedia.org/wiki/Windows_PowerShell
http://blogs.technet.com/eileen_brown/archive/2007/11/23/the-inventor-of-powershell.aspx
http://www.microsoft.com/latam/windowsserver2008/powershell.mspx
http://luke.breuer.com/time/item/PowerShell/168.aspx

Powershell
PowerShell for SQL Server - Basics
http://www.microsoft.com/latam/windowsserver2008/powershell.mspx
http://luke.breuer.com/time/item/PowerShell/168.aspxPowershell

FAQ - http://www.microsoft.com/windowsserver2008/en/us/powershell-faq.aspx
Powershell Script Center - http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx http://msdn.microsoft.com/en-us/library/system.management.automation.psobject(VS.85).aspx http://blogs.msdn.com/johan/archive/tags/PowerShell/default.aspx http://blogs.msdn.com/powershell/

Basics SQL Performance Tuning - Queries and Tips

Basics of Performance Tuning

1. Check for Cost of Joins, Seek, Scans (Join Types listed in previous blog entries)
2. Seek is always better than scan, Look for possibilities where covering index can convert scans into seeks
3. When there is Key lookup for large number of data sets create a index, This is avoid lookup costs

DBCC FREEPROCCACHE --clears entire plan cache
DBCC DROPCLEANBUFFERS --clears all clean data cache pages
SET STATISTICS IO ON –- To see physical/logical read counts

--Tip #1
--• Checking the reads and writes generated by the query using


SET STATISTICS IO ON
--• Checking the running time of the query using
SET STATISTICS TIME ON
select * from employees
sp_spaceused employees
--Tip #2
--Query Execution Time
DECLARE @start_time DATETIME
SELECT @start_time = GETDATE()
--<>
SELECT 'Elapsed Time, sec' = DATEDIFF( second, @start_time, GETDATE() )
GO

--Tip #3

SET SHOWPLAN_TEXT ON


SET SHOWPLAN_ALL ON
select * from employees

--Tip #4
/*
Seeks go directly, or at least very quickly, to the needed records while scans read the whole object (either table, clustered index, or non-clustered index). Thus, scans usually consume lots more resources than seeks.
*/

--Tip #5

SET NOCOUNT ON



/*
Reduces the amount of information passed from the server to the client. Therefore, it helps to lower network traffic and improves the overall response time of your transactions
*/


More Reads
Notes - Updated

Happy Reading!!

SQL Data Services. Your Database in the Cloud

SQL Data Services
  • First version of SQL Data Services will support: tables, indexes, views, stored procedures, triggers, constraints, table variables, session temp tables etc.
  • It will not support: distributed transactions or queries, CLR, Service Broker, Spatial, physical server or catalog DDL and views
  • Business Intelligence services, will be available sometimes in the future
  • limitations on database size, most likely it will be around 10 GB
http://www.azurejournal.com/2009/05/sql-data-services-your-database-in-the-cloud/
One more blog http://www.shanmcarthur.net/cloud-services/design-strategies-for-Azure-and-SDS -

Differences between using traditional SQL Server Vs Data in Cloud Explained Here
Azure Videos
SQL Azure
SQL Azure blog

 
Windows Azure Platform, Amazon Web Services and Google App Engine Explained
Overview of Amazon Web Services
Who Will Win The Cloud Computing Battle in India
Software Delivery Models in the Era of Cloud Computing
Application Lifecycle in the Cloud

 
SQL Azure starter articles
SQL Azure - some tips & tricks
SQL Azure Tools
Introduction to SQL Azure
SQL Azure Migration Wizard
The Future of SQL Data Services with Nigel Ellis
What The Heck Is Cloud Computing?
What The Heck Is Cloud Computing? – A Brief Re-Look
SQL Azure : Design Factors (part 1)
Limitations in SQL Azure
 
Happy Reading!!

10 rules for success in business

10 Rules of Success

The Top 12 Product Management Mistakes

Role of a Product Manager

Want to be a CEO? Try product management first

Architecture and Problem Solving

http://blogs.msdn.com/jmeier/archive/2007/04/09/7-habbits-of-effective-program-managers.aspx

For a developer as well the following habits are good to have

Habit 1, Frame problems and solutions.
Habit 2, Sell visions. - Develop 2 or 3 prototypes and work on pros and cons of it. Communicate it to stakeholders
Habit 3, Deliver incremental value. - Focus on solving the problem not on Data issues, Data cleanup
Habit 4, Manage communication.
Habit 5, Connect with customers.
Habit 6, Execute.
Habit 7, Leverage the system.
http://blogs.msdn.com/jmeier/archive/2008/11/06/agile-architecture-method.aspx
This is how we would typically build solutions in the current Agile world of Software Development

Another good set of collection of resources from architect perspective
http://geekswithblogs.net/Tags/architecture/default.aspx

Data Architecture Practices

Data Patterns

Lessons in Software from Alok Srivastava
More Reads

Great Post on Motivation & Development Tips

Two beautiful learnings from the post...
  • "If you miss the train, don’t chase it. Catch the next one. Missing a train is only painful if you run after it."
  • " Don’t keep missing the same trains. Set up your own train stations for results. For example, I set up a rhythm of daily, weekly, and monthly results. When I lose the day, I make the most of the next one. "
Handling Inconvenient Requests
Mange Your DBA Career, Don’t Let it Manage You
How to Hone Your DBA Skill Set
How to Identify Important Characteristics for a DBA Job Candidate
Some thoughts on interviewing….

Excerpts from great posts
Key Learnings
  • Present your game plan in a way that players get confident that your ideas are solid.
  • Instill in your team a belief in success
  • Don’t expect players to perform beyond their capability.
  • Be patient with players’ shortcomings
What do managers do and how big should my team be?
  • Know the code
  • Help you to know what you need to do
  • Determine the tasks to be completed by the team and balance the work across the team
  • Assist in skills development
  • Communication to/from the feature team about the feature team
  • Performance evaluation
  • Hiring the team
Tips to be a successful Test-DEV-PM
  1. Be passionate about software
  2. Know the concepts behind computers, and understand how those are reflected in a specific system
  3. Understand what drives you and where in the triad you think your personality and character puts you
Learning as an engineer -- rising from the ashes of failed projects
The 10 Questions Every Change Agent Must Answer
My Todo list – the most powerful weapon in my productivity arsenal
Cultivate Teams, Not Ideas
Sharpening Your Skills: Managing Teams
12 Practices to be a Better Developer
  • Source Control - If you don’t store your code in source control, you’re putting your company at risk.
  • Test-Driven Development produces higher-quality code. Behavior Driven Design - Behavior is documentation for other developers and users.
  • Build Systems - Building is more than just compiling code.
  • Continuous Integration - Check in early and often.
  • Real Time Code Review - Two heads are better than one.
  • Refactoring: Easy as red light green light.
  • Read Code - "You don’t become a better writer by just writing." Scott Hanselman
  • Code In Increments - Real programmers work for hours and hours straight, without a break, without even looking up. Don’t break your flow to stop and compile: just keep typing! :)
  • Sharpen your skills by learning a new language.
  • Learn SOLID
  • Single Responsibility Principle - There should never be more than one reason for a class to change.
  • Open Closed Principle - A class should be open
for extension but closed for modification.
  • Liscov Substitution Principle - Subtypes must be substitutable for their base types.
  • Interface Segregation Principle - Clients should not be forced to depend upon interfaces that they do not use.
  • Dependency Inversion Principle - High level modules should not depend upon low level modules. Both should depend upon abstractions. Abstractions should not depend upon details. Details should depend upon abstractions.
  • Know when to unlearn. The ways you learned when you first started are clearly the best ways. Not much has changed since then, really. :)
  • Be a Mentor
The Impact of Staffing Practices on Software Quality and Productivity
100 Helpful Tips for Great Managers
12 Things Good Bosses Believe
Scott Belsky: Creativity x Organization = Impact
Creativity x Organization = Impact
How to lose friends and alienate people: The joys of engineering leadership
Beyond design: Creating positive user experiences
 Institutionalized!
The unspoken truth about managing geeks
Fred Wilson: 10 Ways to Be Your Own Boss

Regression Test Automation Myths

When do we need to automate test cases ?

Large amount of test effort would be spent for Regression testing for any Change Request (CR#) received. The Amount of effort spent for Automating Regression Test Cases Vs Time saved per Regression Test Cycle is required before we automate.

Example: Effort Required for Regression Test Automation - 200 Hrs which includes Framework setup, Test Data creation, Test Execution layer and Reporting of test results. If the Features might change in next subsequent release the effort required to maintain the Automation suite also need to be considered.

Automation of test cases not necessarily result in savings of test effort. It also depends on maintainbility of the regression suite.
For Automating Regression Test cases couple of guidelines listed below.
1. Managing Input test data
  • Input can be stored from a table, Expected output can also be stored in a table.
  • Input can be obtained by running a SQL Query
2. Execution the test - Execute Function/Web Services/Method
3. Obtain the output
  • Parse the output fetch the result value
  • Query the Database to verify Data is present
  • Compare with result data set and verify expected result is obtained result
4. Consolidating and Reporting findings.
A robust test automation framework is expected to execute all the test cases report the results with all details like %% of Test cases passed, test cases failed, Errors Reported.

More Reads
Agile-Friendly Test Automation Tools/Frameworks

Another Good Read
State: published Open Source Automated Test Tools Written in Java


Testing Tool for webservice testing

Useful tool for Webservices testing - http://www.codeplex.com/wsstudioexpress

Testing Web Services :: Web Service Studio and WCF Test Client

WCF Screencst - Creating your first WCF service

VSTS Web Testing is Functional Testing of Web Services - Are Web Tests "Functional" tests?

Web tests work at the HTTP layer
Notes - The web test engine uses the .NET Framework System.Net http classes to send requests and receive responses.  The engine will open a request and send the request body if one exists.
Are Web Tests "Functional" tests?
Notes - Web tests do not actually instantiate IE when running, but only send and receive http requests. The main reason we chose to drive web tests at the HTTP layer is we wanted to be able to drive load efficiently in a load test
How to test WCF Web Service (.svc) using VSTS 2008 Test Edition
Resources for Test Tools in Visual Studio 2010
Content Index for Coded UI Test
Content Index for Web Tests and Load Tests
Unit Testing WCF Services
Integration Testing WCF Services
Unit Testing WCF Services

Performance Testing Challenges

http://www.perftestplus.com/resources/perf_challenges_ppt.pdf

Thanks,
Sivaram

Using open source tools for performance testing

A good must watch video on Performance Testing



HTTP performance testing with httperf, autobench and openload

More Reads
Jmeter - SQL query performance test with JMeter
Performance testing with JMeter
Performance Tests with Jmeter, Maven and Hudson

Happy Reading!!

SDET Interview Questions


This is one of Top posts in my blog. Please find compiled list of posts. Also you can refer to Programming Problem's link section which has several bookmarked sites.

Basic Interview Questions for SDET/QA Roles

1. How do you test online banking Application.
2. Different ways to find duplicate element in an array
3. I put two bullets in two adjacent chambers of a six shot revolver. I point it at your head and pull the trigger. Click. You are still alive. The chamber has advanced by one. I am prepared to try again. Is it better for you If I spin again ?
4. One number missing from sequence 1 to n. (Sorted Array). Use the formula n(n+1)/2 and subtract with acquired sum. The missing number would be found.
5. Program to Reverse words in a sentence

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
static class WordTools
{
/// <summary>
/// Receive string of words and return them in the reversed order.
/// </summary>
public static string ReverseWords(string sentence)
{
string[] words = sentence.Split(' ');
foreach (string str in words)
{
    Console.WriteLine("Word is: " + str);
}
Array.Reverse(words);
return string.Join(" ", words);
}
}
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
    const string s1 = "Bill Gates is the richest man on Earth";
    const string s2 = "Srinivasa Ramanujan was a brilliantwor mathematician";
    string rev1 = WordTools.ReverseWords(s1);
    Console.WriteLine(rev1);
   string rev2 = WordTools.ReverseWords(s2);
   Console.WriteLine(rev2);
   Console.ReadKey();
}
}
}
Reference - Link. I followed the code presented in the link. I added a for loop to publish word in ReverseWords function

6. Given a singly linked list that consists of 'R' and 'B' values only. Write a C function to find the maximum subsequence length of any color. What is the time complexity of your function ?
Input: R B R B B R R R R B B B R
Output: 4
Int FindMaxSeq (List I)
{
    List p, q, head, r;
    int count, max, cvalue;
    p = I; head = p; count = 0, cvalue = 0, max = 0;
    while(p)
    {
        q = p->value;
         r = q->next;
        if(q->value = r->value)
        {
            count++;
         }
         else
         {
           cvalue = count;
           if (cvalue > max)
           {
                max = cvalue;
           }
           count = 0;
         }
       p++;
     }
    return max;
}

7. What is a Priority Queue (Heaps) ?
Priority queue is a data structure which allows at least following two operations. Insert, DeleteMin - Finds, Returns minimum element in the priority queue. Insert - Enqueue, Deletemin - Dequeue.

8. Binary Tree - Tree in which no node can have more than two children

9. AVL Trees (Adelson-Velski and Landis) Tree. AVL tree is identical to a Binary Search Tree, except that for every node in the tree, the height of the left and right subtrees can differ by at most 1

10. Longest Palindrome sub-sequence. Dynamic Programming Problem
Longest palindrome in a string
Longest palindrome in a string





Few other Answers
Option#1
1. Original string is A
2. Reverse string is B
3. Find common strings are C, D, E ....
4. Find palindromic strings in step 3, suppose C, D.
5. Find the max length of strings in step 4. Return.

Solutions Explained
http://en.wikipedia.org/wiki/Longest_common_substring_problem
http://www.iarcs.org.in/inoi/contests/feb2005/Advanced-1-solution.php
http://dsalgo.blogspot.com/2006/08/longest-palindrome.html
http://www.solvemyproblem.net/Webed/contentfiles/attach/Dynam63_86182.pdf

11. Program for Binary Search in C.
O(log N)
int BinarySearch (int a[ ], int x, int N)
{
    int mid, low, high;
    low = 0; high = N-1;

    {
        mid = (low+high) / 2;
        if( a[mid] < x)
            low = mid+1;
        else
            if(a[mid] > x)
                high = mid-1;
            else
                return mid; /* Found */
    }
    return -1; /* Not Found*/
}

SQL Developer Interview Questions
  • Top 5 Code Review Checks
    • NOLOCK, Coding Standards, Seeks for Execution Plan, SET Based Operations, SET NOCOUNT ON, TRY-CATCH Error Handling
  • Troubleshoot slow running procedure
  • Database Design for School (Marks, Teachers, Subjects, Class)...Check candidate ability to identify tables, primary keys, Normalization of identified tables
  • Generating Primenumber using TSQL
Aptitude Test Problems
1. If a,b,c, d are four positive real numbers such that abcd = 1, what is the minimum value of (1+a)(1+b)(1+c)(1+d). Ans - 16
2. A change making machine contains 1 Rs, 2 Rs, 5 Rs coins. The total number of coins is 300. The amount is Rs.960. If the number of 1 Rs and 2 Rs coins are interchanged the value comes down by 40. The total number of 5 Rs coin is
      x + y + z = 300
      2x + y + 5Z = 920
      x + 2y + 5Z = 960
            z = 140
3. A red light flashes 3 times per minute and green light flashes 5 times per 2 minutes at regular intervals. If both start flashing at same time, how many times do they flash together each hour ?
          Red Light = 60/3 secs = Every 20 Secs
          Green Light = 120/5 Secs = 24 Secs
          LCM is 120, Every 2 Minutes
          Every Hour = 60/2 = 30 times flash together
 4. A takes 3 hours longer than B to walk for 30 kms. But if he doubles his speed he takes 2 hrs less than B. What is B's speed in kmph.
Let t be the time taken by B to travel 30 Kms
Speed of B = 30 / t
Speed of A = 30 / t+3
By data,
2(30/(t+3)) = 30/(t-2)
t = 7
Speed of B = 30/7 kmph

Good Resumes
Tips for Writing Good Resume - Great Resumes for Software Engineers
Very Good Read How to Get Your Dream Job

Books and References
  • Cracking The Coding Interview: 150 Programming Questions And Solutions by Gayle Laakmann McDowell
  • Data Structures And Algorithms Made Easy: Data Structure And Algorithmic Puzzles  by Narasimha Karumanchi
  • More References - Link1, Link2, Link3 and Link4
Good Read
Online GATE Coaching - Found this useful. Good If I had enrolled for it a decade ago :). Link

Another good read from link. Hacking a Google Interview, MIT Materials. Please check the link

Good Learning Projects

More Reads

Behavioral Questions - The Master List


Good Luck for Your Preparation. Please feel free to suggest additional links for the post.


Read Quote of Neel Hajare's answer to Programming Interviews: What types of technical questions are asked in developer interviews? on Quora

Read Quote of Manas J Saloi's answer to What's the best way to prepare for job interviews? on Quora

Read Quote of Rahul Kumar's answer to Job Interviews: What are the standard puzzles asked in programming interviews? on Quora

Read Quote of Nishant Neeraj's answer to Career Advice: What are the career oriented hobbies/interests a mechanical engineer should have? on Quora

Read Quote of Alon Amit's answer to How do you impress a technical interviewer? on Quora

Read Quote of Martin Michelsen's answer to Computer Programming: What are some programs every programmer should make at least once? on Quora

Read Quote of Matthew Mirman's answer to Computer Programming: What are some programs every programmer should make at least once? on Quora

Read Quote of Dima Korolev's answer to Learning to Program: How can I become a world-class coder in under three years? on Quora

Read Quote of Ambra Benjamin's answer to What reply does the interviewer expect when he asks "do you have any questions for us"? on Quora

Read Quote of Gayle Laakmann McDowell's answer to Gayle Laakmann McDowell (author): What are Gayle Laakmann McDowell's top resume evaluation answers? on Quora

C Resume
Great Resumes link1, link2, link3


Read Deepak Mehta's answer to What are some tips & tricks I should know before going to an Interview? on Quora

Happy Reading, Happy Coding and Learning!!!