"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" ;

November 27, 2010

How Website testing is different from Database testing

How Website Testing is different from Database Testing
Website testingDatabase testing
Event Driven - Actions Depend on Options Choosen by the UserData Driven, Fixed Set of Steps Executed by a Procedure
Website Testing is Black Box Testing, Focus is on end-to-end FunctionalityDatabase Testing is more driven towards white box Testing, Need to verify TSQL Code, Logic, Datatypes, Constraints at Table Level, Refer Database Testing
Page Load time is very critical for better user experienceFor OLTP Applications Ex-online ticket booking procedures need to be optimal to ensure maximum level of concurrency
Performance Points - User Response Time, Response Time with Concurrent UsersPerformance Points - Blocking, Locking, Deadlocking during Performance Testing. Detailed notes are provided in blog for each of the listed items
Black Box Testing PredominantlyIt is possible to trasition from a DB tester to DB Developer Since you work the code, You understand the code/logic
Checking SQL Jobs, Database Migrations Ex- SQL 2000 to SQL 2005, SQL 2005 to SQL 2008
OLTP Vs OLAP Systems. Both are very different and has its own learning. I have mainly worked on OLTP

Website would multi-tier app. Client-Business Layer-Database Layer. Database would also be covered at certain point.

Happy Reading!!

Best Practices for Website Testing

For Testing a website below are guidelines I found useful from my learning's till date

1. Functionality Testing - Verify the features/functionality of the site
2. Acceptance Testing - This is event driven, User can interact the site in several different ways. It is very important to cover maximum user scenarios to ensure no defects at integration layer
3. Localization Testing - Check the website if it is available in several languages. Useful tip - Google Chrome suggests translation to english when you open Non-English Locale Sites. You can use this to read/understand by translating the content to English.
4. Layout Testing - Verify the look and feel of the UI. No overlapping sections in the page. Refer the Tool
Layout detection tool, Layout Detection Tool Intro Video
5. Cross Browser Testing - Verify the UI of the website in multiple browsers. Useful Read Top 10 Free Web Apps to Test Cross-Browser Compatibility
6. Cross Platform Testing - Testing across browsers in different platforms Windows/Linux/Mac. Good Read Useful Tools for Testing Cross Browser Compatibility
7. Broken Links - Verifying Links in the page are not broken - Useful Tools. Tool1, Tool2
8. Spell Check the contents of the page. Good Read Top 10 Free Online Spell Checkers
9. Verify the page load time across different browsers. Good Read Top 10 Tools to Test Website Speed
10. Security Testing - Verify Security of the website is not broken or can be compromised with special attacks. Check for XSS. Tools to check  both at code level/site level are available. 10+ Free Web Application Security Testing Tools
11. Slow Network Traffic - Check for the Page Load time, Look and Feel in Case of Slow Network Traffic. Useful Tool BrowserMob Proxy - Free Tool to simulate slow network traffic
12. Usability Testing - How much does it Actually meets End User Requirements. Is it user friendly. Usability Testing Guidelines
13. Web Test Automation - For Website Test Automation you can check Open Source Tools Selenium, Webdriver
14. More Reads - Guidelines and Checklist for Website Testing
15. Open Source Test Automation Framework Using Selenium. This underlying framework can be leveraged and developed to support automation for existing website - Tracking Selenium Commands Using C# and SQL Server 2008. Framework Code Available in Selenium Tracking
16. Very Good Ebook on Selenium for Web Test Automation. Link
17. 7 useful tools for web development testing
18. Selenium Online Training
19. Next thing to look is Automating Regression & Functional Test Cases. You can automate functional test cases based on priority. Based on production defects / changing features this can be updated
20. Capture production events of customer acitivty on the website. Top 10 worflows can serve as input to performance test scenarios. Based on distribution of it, performance test scenarios can be developed from it to simulate production work load.
21. Twenty essential firefox addons for testing
22. Traffic Squeezer - Open-Source WAN/Network Optimization and Acceleration Solution
23. Few tips for quality web page testing
24. Cross browser testing – The truth is in the numbers


Happy Reading!!

November 17, 2010

Installing Turbo C++ in Win7 64 bit

I spent good amount of time looking for a Free IDE for trying out C/C++ programs. Below link
How to install Turbo C++ on Windows 7 64bit explains setup step by step

Few things I found useful to be added are
1. After mounting to D Drive, You need to run install.exe under dosbox to get all files unzipped
2. I downloaded DOSBox 0.74 version. The config file is located in
{system drive}:\Users\{username}\AppData\Local\DOSBox\dosbox-{version}.conf
3. Added the below content
mount d c:\turboc
d:
cd tc
cd bin
tc

Now on click of DOSBox shortcut C++ IDE is ready!!
Time to learn/code some more Programming Problems.....

Found yet another simple solution. Use http://codepad.org/ :) :)

Happy Coding!!

November 16, 2010

Software Testing - Learning Articles - Posts - Compiled

Below is summary of Software testing related posts in my blog till date plus interesting testing related article bookmarks
  1. Guidelines for Web Site Testing
  2. Database Testing Overview
  3. Performance Testing Overview
  4. Web Service Testing
  5. Test Estimates
  6. Testing best Practices
  7. Value Realization of Test Function
  8. Web Services Testing, Testing Tool for webservice testing
  9. UI Test Automation using Selenium
  10. Test Automation - Regression Test Automation Myths, Software Testing Interesting Reads - Sara Ford
  11. Test Case Management Tools Analysis
  12. Test Automation patterns
  13. Test Automation Tools - Good Summary
  14. Functional Testing Tools List
  15. Test Heuristics Cheat Sheet
  16. Tester 2.0 - Definition of an Agile Tester
  17. Manual Testing Notes
  18. Testing Mobile Apps
  19. Google Testing Blog good read - Approach on Categorizing test sizes - Good Read
  20. Google Testing Blog good read - Web Testing at Google
  21. Using Mind Maps for Test Planning
  22. An effective test strategy to grow applications - Good Read
  23. Testing Mobile Apps
  24. Test Case “Rules” - Good Compiled List on Rules for Writing / Auditing Test Cases
  25. Mobile Application Testing - Part I
  26. Mobile Application Testing - Part II
  27. Mobile Application Testing - Part III
  28. [Good Session] - Mobile WebDriver Testing at TheLadders
  29. Test Mobile applications with COP (who) FLUNG GUN
  30. The Pragmatic Tester - Mindmap
  31. Testing In The Automation Age - Mindmap
  32. The Art of Writing Effective and Transparent Test Cases
  33. Misconceptions about testing (and what we should do about them)
Hope it helps!!


Happy Reading!!

November 15, 2010

Notes for SQL Server Developer

Below post is summary of SQL Server related posts.
  1. Basics – Isolation Levels
  2. Triggers, Procedures, Views - SQL Server Views Revisited
  3. Table Partitioning - Basics, Partition Elimination in SQL Server 2005
  4.  Understand Query Execution process 
  5.  Locking, Blocking, Deadlocking - Blocking Vs Deadlocking, Deadlock Troubleshooting
  6.  SSIS, SSRS, CDC 
  7.  JOINS - Operators - Revisited, SQL Server Indexes and Join Analysis
  8.  DB Replication - SQL Server 2005 Replication Learning’s, SQL High Availability Links
  9.  SQL Upgrade 2005-2008 - SQL Server 2008 Migration Guidelines
  10.  Query Performance Tuning
  11.  Coding Best Practices - SQL Server Coding Guidelines, TSQL XML Parsing
  12.  Read Subject Matter Expert Blogs (Loads of them bookmarked in SQL Links in the blog)
  13.  Road to become Database Architect
  14.  SQL Server 2008 Notes
  15.  SQL Blog – SQL SME’s Blog
  16.  SQL Tips
  17. Started a BI blog to practice SSIS, SSRS
Hope it Helps!!
Happy Reading!!

November 12, 2010

SQL Server 2008 Basics - Isolation Levels

Couple of years back I was not exactly sure of difference between Isolation levels in SQL Server. I learnt it from Roji & Balmukund. Posting my notes and examples I had to understand it better.

“Pessimistic locking” (where data collisions are assumed and locks taken to prevent conflicting updates) and the four standard isolation levels:
1. Read Uncommitted (also known as “Dirty Read”)
2. Read Committed (the default SQL Server transaction isolation level)
3. Repeatable Read
4. Serializable
STEP 1
USE TestDB
CREATE TABLE Employees(EID int primary key identity,EmpName nvarchar(50),Salary money);
GO
INSERT INTO Employees(EmpName, Salary) VALUES ('Raja', 5500);
INSERT INTO Employees(EmpName, Salary) VALUES ('Raman', 44500);
INSERT INTO Employees(EmpName, Salary) VALUES ('Kanna', 12000);

STEP 2
--Isolation Level - READ UNCOMMITTED
--Dirty reads - Uncommitted/Transaction inprogress would be considered part of transaction
--SESSION 1
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
BEGIN TRAN
SELECT  * FROM Employees
WAITFOR DELAY '00:00:10'
SELECT * FROM Employees
ROLLBACK

STEP 3
--SESSION 2
USE TestDB
GO
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
GO
BEGIN TRAN
UPDATE Employees SET Salary = Salary * 1.2
WAITFOR DELAY '00:00:10'
ROLLBACK

STEP 4
--Execute SESSION 2 and then SESSION 1. Below is the output of SESSION 1


Isolation Level - Lost Updates
Nonrepeatable Read: If somebody performed UPDATE or DELETE of any of the rows you read earlier.
Read Committed - When SQL Server executes a statement at the read committed isolation level, it acquires short lived share locks on a row by row basis.
STEP 1
--SESSION 1
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
BEGIN TRAN
SELECT * FROM Employees
WAITFOR DELAY '00:00:10'
SELECT * FROM Employees
ROLLBACK

STEP 2
--SESSION 2
BEGIN TRAN
UPDATE Employees
SET Salary = Salary * 1.2
COMMIT
STEP 3
Execute SESSION 1 and then SESSION 2. Output of SESSION 1


Phantom Reads
Repeatable read - a repeatable read scan retains locks on every row it touches until the end of the transaction.
Phantom: If anybody INSERTed a row within the range you had for an earlier query (i.e., you see new rows).

STEP 1
--SESSION 1
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
BEGIN TRAN
SELECT * FROM Employees
WAITFOR DELAY '00:00:10'
SELECT * FROM Employees
ROLLBACK

STEP 2
--SESSION 2
BEGIN TRAN
INSERT INTO Employees(EmpName, Salary)
VALUES ('New Employee', 500);
COMMIT

STEP 3
Execute SESSION 1 and then SESSION 2. Output of SESSION 1


SERIALIZABLE Isolation Level
--Locks all data in the Range, They remain locked until transaction is Complete
SERIALIZABLE - instead of the simple shared lock that was there with the REPEATABLE READ level, you now have RANGE shared locks (looks like 'RangeS-S, which means a range shared lock for a range scan). You will only see these type of locks when you are using a serialized transaction...these differ from the REPEATABLE READ level locks in that not only do they protect the exact key values returned from the statement, but they also protect the entire range of values the query scans and won't allow the phantom inserts within the queried range like the REPEATABLE READ level did.
STEP 1
--SESSION 1
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
BEGIN TRAN
SELECT * FROM Employees
WAITFOR DELAY '00:00:10'
SELECT * FROM Employees
ROLLBACK

STEP 2
--SESSION 2
BEGIN TRAN
UPDATE Employees
SET Salary = Salary * 1.2
INSERT INTO Employees(EmpName, Salary)
VALUES ('New Employee Again', 800);
COMMIT

STEP 3
Execute SESSION 1 and then SESSION 2. Output of SESSION 1


Snapshot Isolation and Read Committed with Snapshot Isolation (RCSI).
These impacts are:
  • Increased I/O to manage row versions
  • Increased tempdb usage
  • Changes to default behavior affecting applications that rely on pessimistic locking to implement ordered queues.
STEP 1
ALTER DATABASE TestDB SET ALLOW_SNAPSHOT_ISOLATION ON;
GO

STEP 2
--SESSION 1
SET TRANSACTION ISOLATION LEVEL SNAPSHOT
BEGIN TRAN
SELECT * FROM Employees
WAITFOR DELAY '00:00:10'
SELECT * FROM Employees
COMMIT TRAN
--Results #1 and #2 will be same, Before starting transaction the latest available data copy would be used as Reference

STEP 3
--SESSION 2
BEGIN TRAN
UPDATE Employees
SET Salary = Salary * 1.2
INSERT INTO Employees(EmpName, Salary)
VALUES ('New Employee Again', 800);
COMMIT

STEP 4
--Execute SESSION 1 and then SESSION 2. Output of SESSION 1


Read Committed Snapshot Isolation
  • Statement Level Row Versioning Results for #1 and #2 will differ
  • Before executing each statement it takes a copy
STEP 1
ALTER DATABASE TestDB SET READ_COMMITTED_SNAPSHOT ON
GO

STEP 2
--SESSION 1
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
GO
BEGIN TRAN
SELECT * FROM Employees
WAITFOR DELAY '00:00:10'
SELECT * FROM Employees
COMMIT TRAN

STEP 3
--SESSION 2
BEGIN TRAN
UPDATE Employees
SET Salary = Salary * 1.2
INSERT INTO Employees(EmpName, Salary)
VALUES ('New Employee Again', 800);
COMMIT
STEP 4
Execute SESSION 1 and SESSION 2. Output of SESSION 1
STEP 5
Query to check for Database Status

SELECT snapshot_isolation_state,name
FROM sys.databases

SELECT is_read_committed_snapshot_on ,name
FROM sys.databases


More Reads
Concurrency Series: Basics of Transaction Isolation Levels
Visualising Isolation Levels

Happy Reading!!

TSQL Interesting Questions

Listed below are few TSQL Interesting code snippets and output also provided below the examples. Output I observed in SQL 2008 R2 version.

Example #1
declare @i int
select @i = -5
select +@i
Output: -5

Example #2
declare @i varchar
select @i = 'This is a test'
select @i
Output: T

Example #3
declare @val char(30)
set @val = 'SSc is cool'
select len(@val)
Output: 11

Example #4
declare @val as float, @val1 as float
set @val = 2.0
set @val1 = 1.4
select @val1+@val as sum
Output: 3.4 

Example #5. Minimum of each coulmn

create table #i ( i int, j int, k int)
insert #i values(1, 2, 3)
insert #i values(1, 3, 2)
insert #i values(2, 1, 3)
insert #i values(2, 3, 1)
insert #i values(3, 1, 2)
insert #i values(3, 2, 1)
insert #i values(1, 2, 1)
insert #i values(1, 1, 1)
insert #i values(1, 0, 1)

select (case when (i <= j and i <= k) then i when j <= k then j else k end)
from #i

Example #6. Greatest value of 3 columns. Here's an example of what you want using a derived table

declare @t table(id int, val1 int,val2 int,val3 int)
insert into @t(id,val1,val2,val3) values(1,100,200,300)
insert into @t(id,val1,val2,val3) values(2,300,400,500)
insert into @t(id,val1,val2,val3) values(3,600,700,800)

select id,max(vals)
from
(
   select id,val1
   from @t
union all
   select id,val2
   from @t
union all
   select id,val3
   from @t
) X(id,vals)
group by id

Example #7. Maxof All 3 columns

select max(vals)
from
(
   select A
   from #min
union all
   select B
   from #min
union all
   select C
   from #min
) X(vals)

Thanks to authors of this problems. I am not sure where I read this 'C' Programming Style Problems. I found it interesting.

November 05, 2010

SQL Server Views Revisited

It's been a long time I refreshed on my SQL Skills. Below post is on views.

Why view ?
  • Join Several Tables and Fetch Information
  • Hide the Query from End-users,Ex-Expose only aggregated results, Read-Only Information presented to users
  • Expose only required/relevant information to users
  • View with schemabinging -  When SCHEMABINDING is specified, the base table or tables cannot be modified in a way that would affect the view definition 
  • View can update underlying tables if it satisfies below conditions
    • View is created based on only one table
    • No Aggregate function in view definition (Reference)
  • List all view in DB
    • select * from sysobjects where xtype = 'v'
How a View Works -
  • Every time a query references a view, SQL Server substitutes the definition of the view into the query internally until a modified query is formed that only references base tables. Thus, Indexes on underlying tables are critical for performance of views
  • When a view is executed for the first time, only its query tree is stored in the procedure cache
  • Each time a view is accessed, its execution plan is recompiled.   
Partitioned view is a view defined by a UNION ALL of member tables structured in the same way, but stored separately as multiple tables
Indexed Views - SQL Server allows creation of index on view. Steps required for creating indexed views provided in link, link1. Best for OLAP systems where data is updated infrequently.



Happy Learning!!!