Documente Academic
Documente Profesional
Documente Cultură
Agenda
VB Scripting Quality Center Overview & Important Features Database Basics Tool Support for Testing
VB Scripting
VB Scripting
Topics Covered in this lesson are:
Syntax Constants Errors Functions Keywords Methods Operators Statements
Overview of VB Script
VBScript is a Microsoft scripting language. VBScript is the default scripting language in ASP. A scripting language is a lightweight programming language VBScript is a light version of Microsoft's programming language Visual Basic VBScript is only supported by Microsoft's browsers (Internet Explorer) VBScript uses the Component Object Model to access elements of the environment
VB Script - Constants
A constant is a meaningful name that takes the place of a number or string and never changes. There are number of useful constants built-in Vbscript. The various categories of constants in VBScript Color Constants Date and Time Constants Date Format Constants Miscellaneous Constants MsgBox Constants String Constants
Tristate Constants
VarType Constants
7
2010 Wipro Ltd - Confidential
Constant Value Explanation vbGeneralDate 0 Display a date and/or time. Date and time display is determined by system settings. vbLongDate 1 Display a date using the long date format as per computer settings. vbShortDate 2 Display a date using the short date format as per computer's regional settings. vbLongTime 3 Display a time using the long time format as per computer settings. vbShortTime 4 Display a time using the short time format as per computer's regional settings.
10
Constant vbObjectError
Value Description -2.147E+09 User-defined error numbers should be greater than this value, for example, Err.Raise Number = vbObjectError + 1000
11
Value Explanation Chr(13) Carriage return. Chr(13) & Chr(10) Carriage returnlinefeed combination. Chr(12) Form feed; not useful in Microsoft Windows. Chr(10) Line feed. Chr(13) & Chr(10) Platform-specific newline character; whatever is or Chr(10) appropriate for the platform. vbNullChar Chr(0) Character having the value 0. vbNullString String having value Not the same as a zero-length string (""); used 0 for calling external procedures. vbTab Chr(9) Horizontal tab. vbVerticalTab Chr(11) Vertical tab; not useful in Microsoft Windows.
12
Value
-2
-1 0
13
Constant vbEmpty vbNull vbInteger vbCurrency vbDate vbString vbObject vbError vbBoolean vbVariant
vbDataObject vbDecimal vbByte vbArray
14
Value 0 1 2 6 7 8 9 10 11 12
13
Description Uninitialized (default) Contains no valid data Integer subtype Currency subtype Date subtype String subtype Object Error subtype Boolean subtype Variant (used only for arrays of variants) Data access object
VB Script - Errors
The Error that occur during the execution are classified into : VB Script runtime errors VB Script syntax errors
15
16
17
VB Script - Functions
VB Script supports some well/pre defined functions for easy manipulations. Below pointers are some of the important functions.
18
VB Script - Keywords
Function
Value Return
Example
Empty
Used to indicate an uninitialized variable value. A variable value is uninitialized when it is first created and no value is assigned to it, or when a variable value is explicitly set to empty.
Nothing Null
Set Used to indicate an uninitialized object value, ExcelOb=CreateObject(Excel.Application) or to disassociate an object variable from an object , to release the system resources Set ExcelOb=Nothing.
19
VB Script - Methods
Function
Value Return
Example Object.clear, On error resume next ; err.raise=6 ; err.clear ; msgbox err.number will return 0.
Clear
Replace Method
Execute
object.Execute(Str) -, Example : Var1 = 1,Var2 = 2;Execute("Var1 = Var2 + 3") Response.Write (Var1) will print 5.
20
VB Script - Operators
VBScript's operators can be separated into four semi-distinct categories Math Operators
Operator + * / ^ mod
Result 2 1 16 2 8 1
21
22
The Is operator has specific comparison functionality that differs from the operators in the following table. The following table contains a list of the comparison operators and the conditions that determine whether result is True, False, or Null:
Operator < Description Less than True if expression1 < expression2 expression1 <= expression2 expression1 > expression2 False if expression1 >= expression2 expression1 > expression2 expression1 <= expression2 expression1 < expression2 expression1 <> expression2 expression1 = expression2 Null if expression1 or expression2 = Null expression1 or expression2 = Null expression1 or expression2 = Null expression1 or expression2 = Null expression1 or expression2 = Null expression1 or expression2 = Null
<=
>
Greater than
>=
Greater than or equal expression1 >= to expression2 Equal to expression1 = expression2 expression1 <> expression2
2010 Wipro Ltd - Confidential
<>
23
Not equal to
One expression is Empty and the other is a string Both expressions are Empty
24
English
Connected to
Example
Wipro&Technolo gies
Result
Wipro Technologies
Logical Operators
Operator AND OR NOT English Both must be true Either on must be true Inverse of Truth Example True and True True and False Not False Result True True True
25
A For Each...Next loop repeats a block of code for each item in a collection, or for each element of an array.
Do While i>5 The Do...Loop statement repeats a block of code 'some code Do...Loop statement while a condition is true, Loop If i=4 , it will never get executed , if or until a condition becomes true. i=7 it will get executed until the some code part return a value less than 5 i=4 ,While i<5 msgbox "printed" i=6 Wend will print printed once in a message box.
While...Wend statement
26
If statement
If...Then...Else statement
If...Then...ElseIf statement
Dim MonthInt, MonthInt=2 Select Case(MonthInt) Case 1 msgbox January Case 2 msgbox February Case else msgbox Enter either 1 or 2 End Select
27
28
29
30
31
Database Basics
32
Database Basics
Topics Covered in this lesson are: RDBMS Concepts Introduction to Basic SQL statements Ordering of Rows SQL Functions Joins Data Definition Language DML statements
33
RDBMS Concepts
Please refer to the following Websites:http://en.wikipedia.org/wiki/Relational_database http://www.tutorialspoint.com/sql/sql-rdbms-concepts.htm
34
SQL Basics
Please refer to the following training material: (attached file)-
SQL-Bascis.doc
35
36
37
38
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
39
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
40
41
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
42
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
43
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
44
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
45
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
46
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
47
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
48
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
49
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
50
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
51
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
52
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
53
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
54
55
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
56
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
57
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
58
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
59
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
60
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
61
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
62
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
63
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
64
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
65
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
66
2009 2010 Wipro Ltd - Confidential 2010 Wipro Ltd Internal & Restricted
STLC
67
STLC
Software Testing is not a just a single activity. It consists of series of activities carried out methodologically to help certify your software product. These activities (stages) constitute the Software Testing Life Cycle (STLC). Software Testing Life Cycle process is an integral part of the Software Development Life Cycle. The overall aspect of STLC phase deals with testing and rectifying any error code generating within the program under various test conditions. Each of these stages have a definite Entry & Exit criteria , Activities & Deliverables associated with it. In an Ideal world you will not enter the next stage until the exit criteria for the previous stage is met. But practically this is not always possible. We will focus on activities and deliverables for the different stages in STLC. Lets look into them in detail:-
68
Phases in STLC
Project Initiation & Requirement Analysis Test Planning Test Case Preparation Environment Setup Test Execution
Test Closure
69
Project Initiation
During this phase, Requirement Specification Document is reviewed for consistency & Testability. Software Project Plan (SPP) Testing with scope, schedule & estimation will be prepared. This will also include risks analysis, test strategy etc. This document is inspected and signed-off. Activities Identify test requirements Assess Risks Identify Resources Estimation & Schedule Project Plan
70
Requirement Analysis
During this phase, test team studies the requirements from a testing point of view to identify the testable requirements. The QA team may interact with various stakeholders (Client, Business Analyst, Technical Leads, System Architects etc) to understand the requirements in detail. Requirements could be either Functional (defining what the software must do) or Non Functional (defining system performance /security availability ). Automation feasibility for the given testing project is also done in this stage.
71
Requirement Analysis
Activities Identify types of tests to be performed. Gather details about testing priorities and focus. Prepare Requirement Traceability Matrix (RTM). Identify test environment details where testing is supposed to be carried out. Automation feasibility analysis (if required). Deliverables RTM Automation feasibility report (if applicable)
72
Test Planning
This phase is also called Test Strategy phase. Typically, in this stage, a Test Lead/QA manager will determine effort and cost estimates for the project and would prepare and finalize the Test Plan. Activities
Preparation of test plan/strategy document for various types of testing Test tool selection Test effort estimation Resource planning and determining roles and responsibilities. Training requirement
73
Deliverables
2010 Wipro Ltd - Confidential
Activities
Create test cases, automation scripts (if applicable) Review and baseline test cases and scripts Create test data (If Test Environment is available)
Deliverables
75
76
Test Execution
During this phase test team will carry out the testing based on the test plans and the test cases prepared. Bugs will be reported back to the development team for correction and retesting will be performed. Activities Execute tests as per plan Document test results, and log defects for failed cases Map defects to test cases in RTM Investigate unexceptional results Defect Tracking Metrics Analysis Retest the defect fixes Track the defects to closure Deliverables Completed RTM with execution status Test cases updated with results Defect reports
2010 Wipro Ltd - Confidential
77
Test Closure
Testing team will meet , discuss and analyze testing artifacts to identify strategies that have to be implemented in future, taking lessons from the current test cycle. The idea is to remove the process bottlenecks for future test cycles and share best practices for any similar projects in future.
78
Test Closure
Activities Retrospection Meeting Document the learning out of the project Identifying the improvement opportunities Prepare Test closure report Qualitative and quantitative reporting of quality of the work product to the customer. Test result analysis to find out the defect distribution by type and severity. Deliverables Test Closure report Handover to client/production Test metrics
79
Summary of STLC
Finally, Summary of STLC along with Entry & Exit Criteria
STLC Stages Requirement Analysis Entry Criteria Requirements Document available (both functional and non functional) Acceptance criteria defined. Application architectural document available. Activities Analyze business functionality to know the business modules and module specific functionalities. Identify all transactions in the modules. Identify all the user profiles. Gather user interface/authentication, geographic spread requirements. Identify types of tests to be performed. Gather details about testing priorities and focus. Prepare Requirement Traceability Matrix (RTM). Identify test environment details where testing is supposed to be carried out. Automation feasibility analysis (if required). Exit Criteria Signed off RTM Test automation feasibility report signed off by the client Deliverables RTM Automation feasibility report (if applicable)
80
Exit Criteria Approved test plan/strategy document. Effort estimation document signed off.
Activities Create test cases, automation scripts (where applicable) Review and baseline test cases and scripts Create test data
Exit Criteria Reviewed and signed test cases/scripts Reviewed and signed test data
82
Defect reports
83
84
85
86
87
89
Deadlines (release deadlines, testing deadlines, etc.) Test cases completed with certain percentage passed Test budget depleted Coverage of code/functionality/requirements reaches a specified point All defects are fixed or closed Closure reports are signed off All the test cases have been executed and passed Beta or alpha testing period ends Budget allocated for testing is exhausted The risk in the project is under acceptable limit.
90
Measuring Test Coverage Number of test cycles Number of high priority bugs
One of the most important mechanisms is the use of exit criteria to set specific goals for an activity. Exit criteria can be used to define success at the end of any activity, test level or project, so this concept has multiple uses within software testing projects.
Entry criteria can also be used where it is necessary to decide entry to an activity based on factors other than the success of a previous activity.
91
92
Unit Testing
Test Objectives:-
Ensure proper target of test functionality, including navigation, data entry, processing & retrieval.
Entry Criteria:
Business Requirement or Functional specification document should be completed and approved. Technical specification document or technical design document should be completed and approved. Development of component should be completed. Development environment should be stable. Unit test cases document should be completed.
93
2010 Wipro Ltd - Confidential
94
Integration Testing
Test Objectives:-
Ensure that all the components being integrated works together correctly.
Entry Criteria:
Modules needed for integration testing should be ready. System testing should be completed. All the issues document during system testing should fixed and closed. Test script needed for integration testing should be ready. Environment needed to perform integration testing should be ready.
95
2010 Wipro Ltd - Confidential
96
System Testing
Test Objectives: To validate an application accuracy and completeness in performing the function as designed. It represents testing after a complete system is assembled & is performed after all integration and unit testing has been successfully applied. Entry Criteria: Unit testing of all the modules should be completed System testing environment should be ready. Specifications for the product have been completed and approved. System test cases should be documented. UI and functionalities to be tested should be frozen. Priority bugs have been fixed.
97
2010 Wipro Ltd - Confidential
98
Entry Criteria: Integration testing signed off should be received. Business requirements and functional requirements have been met. UAT test cases are ready for execution. UAT testing environment should be ready. Necessary access for testing should be obtained. No critical bugs should be present. All the modules committed for testing should be tested and test report should be handed over to client.
99
2010 Wipro Ltd - Confidential
100
Regression Testing
Test Objectives: Ensure earlier functionalities are not affected. Entry Criteria: Defect has been repeatable and properly document. Defect has been fixed by developers. A regression test specific to the defect has been created, reviewed, and accepted.
101
102
103
SERVER
CLIENT
Client Server
104
Initiates requests Waits for and receives replies Can connect to several servers at the same time Typically interacts directly with end-users using a Graphical User Interface (GUI) Waits for requests from clients Upon receipt of requests, processes them and then serves replies Usually accepts connections from a large number of clients Typically does not interact directly with end-users
2010 Wipro Ltd - Confidential
105
Client Server
Advantages
Sharing of Processing Load: Distribution or sharing of processing load among several independent computers Security for Data Access: Centralized data storage on server, hence easy to implement security of data access Easy to Administer: Clients with the appropriate permissions may be permitted to access and change centralized data. Hence easy to administer. Concurrent tasks at a time: Is capable of functioning with multiple different clients each with different capabilities
Disadvantages
Traffic congestion on the network: Number of simultaneous client requests to a server can cause a server to become overloaded and unable to service clients requests
Lack of robustness: Under client-server, should a critical server fail, clients requests cannot be fulfilled. Hence, lack of robustness is a cause for concern.
106
107
Types of Servers
File Server Database Server Application Server Web Server Object Server Others Chat Server, Fax Server, Mail server, News Server
108
Database Server
A computer in a LAN dedicated to database storage and retrieval The database server holds the Database Management System (DBMS) and the databases Upon requests from the client machines, it searches the database for selected records and passes them back over the network
File Server
To promote sharing of files (computer programs and/or data) To encourage indirect or implicit (via programs) use of remote computers To shield a user from variations in file storage systems among hosts To transfer data reliably and efficiently
Web Server
Web Server delivers web pages to browsers
109
110
On the Web
World Wide Web (WWW) or Web revolves around the client/server architecture Client computer system uses Browsers (like Internet Explorer, Mozilla etc. ) to interact with Internet servers using Protocols Protocols help in the accurate transfer of data - requests from browser & responses from server Commonly used protocols :
HTTP (Hyper Text Transfer Protocol) FTP (File Transfer Protocol) SMTP (Simple Mail Transfer Protocol)
111
Middleware
Software which allows an application to interoperate with other software, without requiring the user to understand and code the lowlevel operations required to achieve interoperability With Synchronous systems, the requesting system waits for a response to the request in real time Asynchronous systems send a request but do not wait for a response in real time the response is accepted whenever it is received . " Middleware " - holds client/server applications together
112
5. Object Request Broker (ORB) - object-oriented management of communications between clients and servers. ORB tracks the location of each object and routes requests to each object.
6. SQL-oriented Data Access - middleware between applications and database servers. Has the capability to translate generic SQL into the SQL specific to the database
113
3-Tier Architecture
A three way interaction in a client/server environment.
The user is stored in the client. The bulk of the business application logic is stored in one or more servers. The data is stored in a database server.
114
Layers
Presentation Tier The top-most level of the application is the user interface. The main function of the interface is to translate tasks and results to something the user can understand. Application Tier This layer coordinates the application, processes commands, makes logical decisions and evaluations and performs calculations. It also moves and processes data between the two surrounding layers. Data Tier Here information is stored and retrieved from a database or file system. The information is then passed Back to the logic tier for processing, and then eventually back to the user.
115
116
117
DB Server
118
Request
Request
Internet
Response Response Web Server
Client
119
3-Tier Architecture
Client
Business Logic
Service A Service B Service C
RDBMS Server
120
Request
Request
Request
Internet
Response
Response Response
Client
Web Server
App Server
121
3 2
Server
1. Browser requests for a HTML File 2. Server locates the file and send to the browser 3. Browser displays the file
122
5 2 3 4 Server 1. 2. 3. 4. 5.
123
Browser sends request to server Server locates the CGI program and passes the request information CGI program process the request and send the data to server Server send the data to the browser Browser displays the data
2010 Wipro Ltd - Confidential
4 2 3 Server 1. 2. 3. 4. Browser sends request to server Server checks the file and executes the embedded scripts Final formatted document Browser displays the document
124
Differences
Desktop Application
Desktop application runs on personal computers and work stations, so when you test the desktop application you are focusing on a specific environment. You will test complete application broadly in categories like GUI, functionality, Load, and backend i.e DB. Desktop application: 1. Application runs in single memory (Front end and Back end in one place) 2. Single user only
Web Application
Web application is a bit different and complex to test as tester dont have that much control over the application. Application is loaded on the server whose location may or may not be known and no exe is installed on the client machine, you have to test it on different web browsers. Web applications are supposed to be tested on different browsers and OS platforms so broadly Web application is tested mainly for browser compatibility and operating system compatibility, error handling, static pages, backend testing and load testing. Web application: 1. Application runs in two or more machines 2. URL-driven 3. Disconnected mode (state less) 4. Unlimited number of users 5. Many issues like hardware compatibility, browser compatibility, version compatibility, security issues, performance issues etc.
125
Reference
ISTQB Glossary of terms used in Software Testing Version 1.0 Foundations of Software Testing by Dorothy Graham, Erik Veenendaal, Isabel Evans, Rex Black Software Testing in Real World By Edward Kit Introducing Software Testing By Louise Tamres Software Engineering By Roger Pressmen Software Testing By Ron Patton Effective Methods of Software Testing By William Perry Lessons Learned in Software Testing By Cem Kaner, James Bach, Bret Pettichord Wikipedia
126
References
http://en.wikipedia.org www.velociq.wipro.com Some information from common testing web sites.
127
Thank You
128