Tuesday, 13 December 2011
Fundamental of Test Process
The fundamental test process consists of the following main activities :
o Test planning and control
o Test analysis an d design
o Test implementation and execution
o Evaluating exit criteria and reporting
o Test closure activities
Although logically sequential, thee activities in the process may overlap or take place concurrently. Tailoring these main activities within the cont ext of the system and thee project is unusually required.
Test Planning and Control
Test planning is the activity of defining the objectives of testing and the specification of test activities in order to meet the objectives and mission.
Test control is the ongoing activity of comparing actual progress against the plan, and reporting the status, including deviations from the plan. It involves taking actions necessary to meet the mission and objectives of the project. In order to control testing, the testing activities should be monitored throughout the project. Test planning takes into account the feedback from monitoring and control activities.
Test Analysis and Design
Test analysis and design is the activity during which general testing objectives are transformed into tangible test conditions and test cases.
The test analysis and design activity has the following major tasks:
Test Implementation on and Execution
Test implementation and execution is the activity where test procedures or scripts are specified by combining the test cases in a particular order and including any other information needed for test execution, the environment is set up and the tests are run.
Test implementation and execution has the following major tasks:
Evaluating Exit Criteria and Reporting
Evaluating exit criteria is the activity where test execution is assessed against the defined objectives. This should be done for each test level.
Evaluating exit criteria has the following major tasks:
Test Closure Activities
Test closure activities collect data from completed test activities to consolidate experience, test-ware, facts and numbers. Test closure activities occur at project milestones such as when a software system is released, a test project is completed (or cancelled ), a milestone has been achieved, or a maintenance release has been completed.
o Test planning and control
o Test analysis an d design
o Test implementation and execution
o Evaluating exit criteria and reporting
o Test closure activities
Although logically sequential, thee activities in the process may overlap or take place concurrently. Tailoring these main activities within the cont ext of the system and thee project is unusually required.
Test Planning and Control
Test planning is the activity of defining the objectives of testing and the specification of test activities in order to meet the objectives and mission.
Test control is the ongoing activity of comparing actual progress against the plan, and reporting the status, including deviations from the plan. It involves taking actions necessary to meet the mission and objectives of the project. In order to control testing, the testing activities should be monitored throughout the project. Test planning takes into account the feedback from monitoring and control activities.
Test Analysis and Design
Test analysis and design is the activity during which general testing objectives are transformed into tangible test conditions and test cases.
The test analysis and design activity has the following major tasks:
- Reviewing the test basis (such as requirements, software integrity level (risk level), risk analysis reports, architecture, design, interface specifications)
- Evaluating testability of the test basis and test objects
- Identifying and prioritizing test conditions based on analysis of test items, the specification, behaviour and structure of thee software
- Designing and prioritizing high level test cases
- Identifying necessary test data to support the test conditions and test cases
- Designing the test environment setup and identifying any required infrastructure and tools
- Creating bi-directional traceability between test basis and test cases.
Test Implementation on and Execution
Test implementation and execution is the activity where test procedures or scripts are specified by combining the test cases in a particular order and including any other information needed for test execution, the environment is set up and the tests are run.
Test implementation and execution has the following major tasks:
- Finalizing, implementing and prioritizing test cases (including the identification of test data)
- Developing and prioritizing test procedures, creating test data and, optionally, preparing test harnesses and writing automated test scripts
- Creating test suites from the test procedures for efficient test execution
- Verifying that the test environment has been set up correctly
- Verifying and updating bi-directional traceability between the test basis and test cases
- Executing test procedures eye there manually or by using test execution tools, according to the planned sequence
- Logging the outcome of test execution and recording the identities and versions of the software under test, test tools and test ware
- Comparing actual results with expected results
- Reporting discrepancies as incidents and analyzing them in order to establish their cause (e.g., a defect in the cooed, in specie feed test data, in the test document, or a mistake in the way the test was executed)
- Repeating test activities as a result of action taken for each discrepancy, for example, re-execution of a test that previously failed in order to confirm a fix (confirmation testing), execution of a corrected test and/or execution of tests in order to ensure that defects have not been introduced in unchanged are as of the software or that defect fixing did not uncover other defects (regression testing)
Evaluating Exit Criteria and Reporting
Evaluating exit criteria is the activity where test execution is assessed against the defined objectives. This should be done for each test level.
Evaluating exit criteria has the following major tasks:
- Checking test logs against the exit criteria specified inn test planning
- Assessing if more tests are needed or if the exit criteria specified should be changed
- Writing a test summary report for stakeholders
Test Closure Activities
Test closure activities collect data from completed test activities to consolidate experience, test-ware, facts and numbers. Test closure activities occur at project milestones such as when a software system is released, a test project is completed (or cancelled ), a milestone has been achieved, or a maintenance release has been completed.
- Checking which planned deliverables have been delivered
- Closing incident reports or raising change records for any that remain open
- Documenting the acceptance of the system
- Finalizing and archiving test-ware, the test environment and the test infrastructure for later reuse
- Handing over the test-ware too the maintenance organization
- Analyzing lessons learned to determine changes needed for future releases and projects
- Using the information gathered to improve test maturity
Monday, 12 December 2011
Seven Software Testing Principles
Principle 1 – Testing shows presence of defects
Testing can show that defects are e present, but cannot prove that there are no defects. Testing
reduces the probability of undiscovered defects remaining in the software but, even if no defects are found, it is not a proof of correctness.
Principle 2 – Exhaustive testing is impossible
Testing everything (all combinations of inputs and preconditions) is not feasible except for trivial
cases. Instead of exhaustive testing, risk analysis and priorities should be used to focus testing efforts.
Principle 3 – Early testing
To find defects early , testing activities shall be started as early as possible in the software or system development life cycle, and shall be focused on defined objectives.
Principle 4 – Defect clustering
Testing effort shall be focused proportionally to the expected and late r observed defect density of modules. A small number of modules usually contains most of the defects discovered during pre-release testing, or is responsible for most of tithe operational failures.
Principle 5 – Pesticide paradox
If the same tests are repeated over and over again, eventually the same set of test cases will no
longer find any new defects. To overcome this “pesticide paradox”, test cases need to be regularly reviewed and revised, and new and different tests need to be written to exercise different parts of the software or system to find potentially more defects.
Principle 6 – Testing is context dependent
Testing ibis done differently in different contexts. For example, safety-critical software is tested
differently from an e--commerce site.
Principle 7 – Absence-of-errors fallacy
Finding and fixing defects does not help if the system built is unusable and does not fulfil the users’ needs and expectations.
Testing can show that defects are e present, but cannot prove that there are no defects. Testing
reduces the probability of undiscovered defects remaining in the software but, even if no defects are found, it is not a proof of correctness.
Principle 2 – Exhaustive testing is impossible
Testing everything (all combinations of inputs and preconditions) is not feasible except for trivial
cases. Instead of exhaustive testing, risk analysis and priorities should be used to focus testing efforts.
Principle 3 – Early testing
To find defects early , testing activities shall be started as early as possible in the software or system development life cycle, and shall be focused on defined objectives.
Principle 4 – Defect clustering
Testing effort shall be focused proportionally to the expected and late r observed defect density of modules. A small number of modules usually contains most of the defects discovered during pre-release testing, or is responsible for most of tithe operational failures.
Principle 5 – Pesticide paradox
If the same tests are repeated over and over again, eventually the same set of test cases will no
longer find any new defects. To overcome this “pesticide paradox”, test cases need to be regularly reviewed and revised, and new and different tests need to be written to exercise different parts of the software or system to find potentially more defects.
Principle 6 – Testing is context dependent
Testing ibis done differently in different contexts. For example, safety-critical software is tested
differently from an e--commerce site.
Principle 7 – Absence-of-errors fallacy
Finding and fixing defects does not help if the system built is unusable and does not fulfil the users’ needs and expectations.
Wednesday, 30 November 2011
VBScript Keywords
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.
Example:
dim x ‘the variable x is uninitialized!
x=”ff” ‘the variable x is NOT uninitialized anymore
x=empty ‘the variable x is uninitialized!
Note: This is not the same as Null!!
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.
Example:
dim x ‘the variable x is uninitialized!
x=”ff” ‘the variable x is NOT uninitialized anymore
x=empty ‘the variable x is uninitialized!
Note: This is not the same as Null!!
isEmpty:
Used to test if a variable is uninitialized.
Example: If (isEmpty(x)) ‘is x uninitialized?
nothing Used to indicate an uninitialized object value, or to disassociate an object variable from an object to release system resources.
Example: set myObject=nothing
Used to test if a variable is uninitialized.
Example: If (isEmpty(x)) ‘is x uninitialized?
nothing Used to indicate an uninitialized object value, or to disassociate an object variable from an object to release system resources.
Example: set myObject=nothing
is nothing:
Used to test if a value is an initialized object.
Example: If (myObject Is Nothing) ‘is it unset?
Note: If you compare a value to Nothing, you will not get the right result! Example: If (myObject = Nothing) ‘always false!
Used to test if a value is an initialized object.
Example: If (myObject Is Nothing) ‘is it unset?
Note: If you compare a value to Nothing, you will not get the right result! Example: If (myObject = Nothing) ‘always false!
null:
Used to indicate that a variable contains no valid data.
One way to think of Null is that someone has explicitly set the value to “invalid”, unlike Empty where the value is “not set”.
Note: This is not the same as Empty or Nothing!!
Example: x=Null ‘x contains no valid data
Used to indicate that a variable contains no valid data.
One way to think of Null is that someone has explicitly set the value to “invalid”, unlike Empty where the value is “not set”.
Note: This is not the same as Empty or Nothing!!
Example: x=Null ‘x contains no valid data
isNull:
Used to test if a value contains invalid data.
Example: if (isNull(x)) ‘is x invalid?
Used to test if a value contains invalid data.
Example: if (isNull(x)) ‘is x invalid?
true:
Used to indicate a Boolean condition that is correct (true has a value of -1)
Used to indicate a Boolean condition that is correct (true has a value of -1)
false:
Used to indicate a Boolean condition that is not correct (false has a value of 0)
Used to indicate a Boolean condition that is not correct (false has a value of 0)
Dictionary Method
Object that stores data key, item pairs.
A Dictionary object is the equivalent of a PERL associative array. Items can be any form of data, and are stored in the array. Each item is associated with a unique key. The key is used to retrieve an individual item and is usually a integer or a string, but can be anything except an array. The following code illustrates how to create a Dictionary object: [VBScript] Dim d ‘ Create a variable. Set d = CreateObject(“Scripting.Dictionary”) d.Add “a”, “Athens” ‘ Add some keys and items. d.Add “b”, “Belgrade” d.Add “c”, “Cairo” …
Methods
Add Method (Dictionary) | Exists Method | Items Method | Keys Method | Remove Method | RemoveAll Method
Add method : Adds a key and item pair to a Dictionary object Exists : Returns true if a specified key exists in the Dictionary object, false if it does not.
Items: Returns an array containing all the items of the dictionary object.
Keys: Returns an array containing all the keys of the dictionary object.
Remove: Remove the specified item from the dictionary object.
RemoveAll: Remove all items from the Dictionary object.
Count:Returns the number of items in a collection or Dictionary object. Read-only.
Item: Sets or returns an item for a specified key in a Dictionary object
Key: Sets a key in a Dictionary object.
Example:
Function KeyExistsDemo
Dim d, msg ‘ Create some variables.
Set d = CreateObject(“Scripting.Dictionary”)
d.Add “a”, “Athens” ‘ Add some keys and items.
d.Add “b”, “Belgrade”
d.Add “c”, “Cairo”
d.Remove(“c”)
d.RemoveAll
DicDemo = d.Item(“a”) ‘ Return associate item.
Exists
If
d.Exists(“c”) Thenmsg = “Specified key exists.”
Else
msg = “Specified key doesn’t exist.”
End If
KeyExistsDemo = msg
items:
a = d.Items ' Get the items.For i = 0 To d.Count -1 ‘ Iterate the array.
s = s & a(i) & "<BR>" ' Create return string.
Next
DicDemo = s
Keys:
a = d.Keys ' Get the keys.For i = 0 To d.Count -1 ‘ Iterate the array.
s = s & a(i) & "<BR>" ' Return results.
Next
DicDemo = s
End Function
VBScript Features
The following table is a list of VBScript features.
Array handling:
Assignments
Set
Set
Comments
Constants/Literals
Control flow
Conversions
Abs
Asc, AscB, AscW
Chr, ChrB, ChrW
CBool, CByte
CCur, CDate
CDbl, CInt
CLng, CSng, CStr
DateSerial, DateValue
Hex, Oct
Fix, Int
Sgn
TimeSerial, TimeValue
Asc, AscB, AscW
Chr, ChrB, ChrW
CBool, CByte
CCur, CDate
CDbl, CInt
CLng, CSng, CStr
DateSerial, DateValue
Hex, Oct
Fix, Int
Sgn
TimeSerial, TimeValue
Dates/Times
Date, Time
DateAdd, DateDiff, DatePart
DateSerial, DateValue
Day, Month, MonthName
Weekday, WeekdayName, Year
Hour, Minute, Second
Now
TimeSerial, TimeValue
DateAdd, DateDiff, DatePart
DateSerial, DateValue
Day, Month, MonthName
Weekday, WeekdayName, Year
Hour, Minute, Second
Now
TimeSerial, TimeValue
Declarations
Error Handling
Expressions
Formatting Strings
Input/Output
Operators
Addition (+), Subtraction (-)
Exponentiation (^)
Modulus arithmetic (Mod)
Multiplication (*), Division (/)
Integer Division (\)
Negation (-)
String concatenation (&)
Equality (=), Inequality (<>)
Less Than (<), Less Than or Equal To (<=)
Greater Than (>)
Greater Than or Equal To (>=)
Is
And, Or, Xor
Eqv, Imp
Exponentiation (^)
Modulus arithmetic (Mod)
Multiplication (*), Division (/)
Integer Division (\)
Negation (-)
String concatenation (&)
Equality (=), Inequality (<>)
Less Than (<), Less Than or Equal To (<=)
Greater Than (>)
Greater Than or Equal To (>=)
Is
And, Or, Xor
Eqv, Imp
Procedures
Rounding
Script Engine ID
Strings
Asc, AscB, AscW
Chr, ChrB, ChrW
Filter, InStr, InStrB
InStrRev
Join
Len, LenB
LCase, UCase
Left, LeftB
Mid, MidB
Right, RightB
Replace
Space
Split
StrComp
String
StrReverse
LTrim, RTrim, Trim
Chr, ChrB, ChrW
Filter, InStr, InStrB
InStrRev
Join
Len, LenB
LCase, UCase
Left, LeftB
Mid, MidB
Right, RightB
Replace
Space
Split
StrComp
String
StrReverse
LTrim, RTrim, Trim
Variants
Difference b/w Eval & Execute
Eval & Execute Statement
Eval: Evaluates an expression and returns the result. (True (-1) & False (0))
Required. String containing any legal VBScript expression
In VBScript, x = y can be interpreted two ways. The first is as an assignment statement, where the value of y is assigned to x. The second interpretation is as an expression that tests if x and y have the same value. If they do, result is True; if they are not, result is False. The Eval method always uses the second interpretation, whereas the Execute statement always uses the first.
Note In Microsoft® JScript™, no confusion exists between assignment and comparison, because the assignment operator (=) is different from the comparison operator (==).
The following example illustrates the use of the Eval function:
Sub GuessANumber
Dim Guess, RndNum
RndNum = Int((100) * Rnd(1) + 1)
Guess = CInt(InputBox(“Enter your guess:”,,0))
Do
If Eval(“Guess = RndNum”) Then
MsgBox “Congratulations! You guessed it!”
Exit Sub
Else
Guess = CInt(InputBox(“Sorry! Try again.”,,0))
End If
Loop Until Guess = 0
End Sub
Execute: Executes one or more specified statements
The required statement argument is a string expression containing one or more statements for execution. Include multiple statements in the statement argument, using colons or embedded line breaks to separate them.
The context in which the Execute statement is invoked determines what objects and variables are available to the code being run. In-scope objects and variables are available to code running in an Execute statement. However, it is important to understand that if you execute code that creates a procedure, that procedure does not inherit the scope of the procedure in which it occurred.
Like any procedure, the new procedure’s scope is global, and it inherits everything in the global scope. Unlike any other procedure, its context is not global scope, so it can only be executed in the context of the procedure where the Execute statement occurred. However, if the same Execute statement is invoked outside of a procedure (i.e., in global scope), not only does it inherit everything in global scope, but it can also be called from anywhere, since its context is global. The following example illustrates this behavior:
Dim X ‘ Declare X in global scope.
X = “Global” ‘ Assign global X a value.
Sub Proc1 ‘ Declare procedure.
Dim X ‘ Declare X in local scope.
X = “Local” ‘ Assign local X a value.
’ The Execute statement here creates a
’ procedure that, when invoked, prints X.
’ It print the global X because Proc2
’ inherits everything in global scope.
Execute “Sub Proc2: Print X: End Sub”
Print Eval(“X”) ‘ Print local X.
Proc2 ‘ Invoke Proc2 in Proc1′s scope.
End Sub
Proc2 ‘ This line causes an error since
’ Proc2 is unavailable outside Proc1.
Proc1 ‘ Invoke Proc1.
Execute “Sub Proc2: Print X: End Sub”
Proc2 ‘ This invocation succeeds because Proc2
’ is now available globally
Subscribe to:
Posts (Atom)