Tips to speed up your slow PC

To speed up your slow PC first step should be restart. In fact you should restart the computer before performing any of the below mentioned steps. Its just like the human brain. You need restart when you are tired.

  1. Stop all unused applications
  2. Turn off unneeded Desktop Features that try to make things look better.
  3. Do a shut down/reboot also known as a cold reboot.
  4. Empty the Recycle Bin.
  5. Uninstall all applications that are no longer needed.
  6. Run “Error Checking” on all hard drives.
  7. Run “De-fragment” on all hard drives
  8. Install anti-virus software and keep it current.
  9. Find and Delete Temporary Files.
  10. Set your computer’s energy settings to High Performance.
  11. Clean Up Primary Partition.

Need detail information of any of the step. Do let me know?

 

Daily price updates for your favorite products via email

The prices of products listed on online shopping site like Amazon or Flipkart may vary every single day and here’s a simple Google Docs based solution to help you keep track of these price fluctuations via email.

The tool can track prices of all products listed on various Amazon websites (all Amazon.* country domains are supported) and Flipkart.com (if you are shopping in India).

For details on how to achieve this go to Digital Inspiration(http://www.labnol.org/internet/amazon-price-tracker/28156/)

Difference between __CSVRead and __Stringfromfile function

__CSVRead() function

The CSVRead function returns a string from a CSV file.
When a filename is first encountered, the file is opened and read into an internal array. If a blank line is detected, this is treated as end of file – this allows trailing comments to be used.
All subsequent references to the same file name use the same internal array.

Each thread has its own internal pointer to its current row in the file array. When a thread first refers to the file it will be allocated the next free row in the array, so each thread will access a different row from all other threads.

eg: You need to test login to an app with different user login credentials for different threads.

__Stringfromfile()

The StringFromFile function can be used to read strings from a text file. Each time it is called it reads the next line from the file. All threads share the same instance, so different threads will get data from different lines. When the end of the file is reached, it will start reading again from the beginning, unless the maximum loop count has been reached.

Note: If there are multiple references to the function in a test script, each will open the file independently, even if the file names are the same.  So it is advisable to use different file name across same scripts otherwise the output will be unpredictable.
Eg: You need to add different products to a shopping cart for the same user. In this case you will be using CSVRead to read user credentials and Stringfromfile to read product info that need to be added to each user.
So in a nutshell, Difference between __CSVRead and __Stringfromfile function is that Stringfromfile should be used when different data are required in a loop for same thread and CSVRead should be used when different data are required for different threads(users).

How to uses SYSMON to Monitor Performance counter?

Monitor performance counter using SYSMON

The following example uses VBScript to add counters whose values are retrieved from the local computer, modifies some of the SYSMON properties that control how the monitor is displayed, and processes the OnCounterAdd event. The example uses the wildcard character (*) to add all instances of the process counter.

Save the bleow code in a HTML page and open in browser.

<HTML> <BODY BGCOLOR=#C0C0C0> <SCRIPT LANGUAGE="VBScript">
Sub Monitor_OnCounterAdded(index) Monitor.Counters.Item(1).Width = 8 End Sub </Script> 
<OBJECT CLASSID="clsid:C4D2D8E0-D1DD-11CE-940F-008029004347" ID="Monitor" HEIGHT=80% WIDTH=100%> 
</OBJECT>
<SCRIPT LANGUAGE="VBScript">
Sub Window_OnLoad On Error Resume Next Monitor.ShowValueBar = False Monitor.ShowHorizontalGrid = True Monitor.Counters.Add("\Process(*)\% Processor Time") Monitor.DisplayType=sysmonLineGraph Monitor.GraphTitle="System Performance Overview" End Sub 
</SCRIPT> 
</BODY> 
</HTML>

Note: You need to enable ActiveX in your browser, to run the html file.

What is Scrum?

Scrum is an Agile framework for completing complex projects. Scrum originally was formalized for software development projects, but it works well for any complex, innovative scope of work. The possibilities are endless. The Scrum framework is deceptively simple.

Scrum Principles

The framework and terminology are simple in concept yet difficult to implement. Successful Scrum teams embrace the values upon which Scrum is based :

We value

  • Individuals and interactions over processes and tools
  • Completed functionality over comprehensive documentation
  • Customer collaboration over contract negotiation
  • Responding to change over following a plan

That is, while there is value in the items on the right, the items on the left matter more.

True success with the Scrum framework comes from teams and organizations who understand these values and the principles that form the foundation of all agile processes.

Scrum Terminology

We’ve introduced some new terms in describing the Scrum framework. Let’s look at them in more detail. Scrum is made up of three roles, four ceremonies, and three artifacts.

Three roles

  • Product owner: responsible for the business value of the project
  • ScrumMaster: ensures that the team is functional and productive
  • Team: self-organizes to get the work done

Four ceremonies

  • Sprint planning: the team meets with the product owner to choose a set of work to deliver during a sprint
  • Daily scrum: the team meets each day to share struggles and progress
  • Sprint reviews: the team demonstrates to the product owner what it has completed during the sprint
  • Sprint retrospectives: the team looks for ways to improve the product and the process.

Three artifacts

  • Product backlog: ordered list of ideas for the product
  • Sprint backlog: set of work from the product backlog that the team agrees to complete in a sprint, broken into tasks
  • Product Increment: required result of every sprint.  It is an integrated version of the product, kept at high enough quality to be shippable.

 

How to Automate UI Testing using Instruments for iOS app

Automate UI Testing using Instruments

An instrument is a powerful tool that can be used to automate UI testing. Instruments can also be used to collect data about the performance and behavior of one or more processes on the system and track that data over time. Although most instruments are geared toward gathering trace data, the User Interface instrument helps automate data collection. With it you can record user events while you gather your trace data. You can use this recording to reliably reproduce the same sequence of events over and over again.

Launching Instruments

Instruments is contained within the Xcode 4 toolset. Download Xcode from the App Store and install it onto your computer. After you have installed Xcode, you are ready to run Instruments. Instruments can be launched in one of three ways.

To run Instruments from Xcode

  1. Open Xcode.
  2. Choose Xcode > Open Developer Tool > Instruments.

Instruments_1

Even though each instrument is different, there is one general workflow when collecting information from your app. This workflow is a four-step process.

  1. Choose a trace template
  2. Direct Instruments to your app
  3. Collect information from about your app
  4. Examine the collected information

For UI automation we will be using  Automation template in Instruments to execute scripts. An important benefit of the Automation instrument is that you can use it with other instruments to perform sophisticated tests such as tracking down memory leaks and isolating causes of performance problems.

Note: The Automation instrument only works with apps that have been code signed with a development provisioning profile. Apps signed with a distribution provisioning profile cannot be automated with the UI Automation programming interface.

Writing an automation test script

In instruments we use JavaScript for writing test scripts. To create a script

  1. Select the Automation trace template.
  2. Click Add > Create.
  3. Double-click New Script to change the name of the script.
  4. In the Detail pane, select Console to enter the code for your script.
  5. Choose a target for your script.
  6. Click the Play button at the bottom of the Console.

tracetemplate

Selecting trace template

Instruments_3

After you create the script, it can be used throughout the development of your app. You can do this by importing your saved script and running it with the Automation instrument.

To import a previously saved script

  1. Select the Automation trace template.
  2. Click Add > Import.
  3. Navigate to your saved script file and click Open

Accessing and Manipulating UI Elements

To perform an action on an element in your app, you explicitly identify that element in terms of the app’s element hierarchy. Each accessible element is inherited from the base element, UIAElement. Every element can contain zero or more other elements. Script can access individual elements by their position within the element hierarchy. However, you can assign a unique name to each element by setting the label attribute and making sure Accessibility is selected in Interface Builder for the control represented by that element.

 

The four properties used in the scripts to access elements are

  • name. Derived from the accessibility label
  • value. The current value of the control, for example, the text in a text field
  • elements. Any child elements contained within the current element, for example, the cells in a table view
  • parent. The element that contains the current element

 

Exploratory testing tips

Exploratory testing can be a challenge.  How to know that you have covered entire application? What all areas need to be covered?

I have listed down some exploratory testing tips. This checklist will help you in performing exploratory testing in a more structured way.

1. Test for data types

Path Files
Long Name (>255 chars)
pecial Characters in Name (space * ? / \ | < > , . ( ) [ ] { } ; : ‘ “ ! @ # $ % ^ &)
Non-Existent, Already Exists
No Space, Unavailable
Time and DateTimeouts
Time Difference between Machines
Crossing Time Zones
Leap Days
Always Invalid Days (Feb 30, Sept 31)Feb 29 in Non-Leap Years
Different Formats (June 5, 2001; 06/05/2001; 06/05/01; 06-05-01; 6/5/2001 12:34)
Daylight Savings Changeover
Reset Clock Backward or Forward
Number0
32768 (215)
32769 (215 + 1)
65536 (216)
65537 (216 +1)
2147483648 (231)
2147483649 (231 + 1)
4294967296 (232)
4294967297 (232 + 1)
Scientific Notation(1E-16)
Negative
Floating Point/Decimal (0.0001)
With Commas (1,234,567)
European Style (1.234.567,89)
All the Above in Calculations
StringLong (255, 256, 257, 1000, 1024, 2000, 2048 or more characters) ƒ Accented Chars (àáâãäåçèéêëìíîðñòôõöö, etc.)
Asian Chars
Common Delimiters and Special
Characters ( “ ‘ ` | / \ , ; : & < > ^ * ? Tab )
Leave Blank ƒ Single Space ƒ Multiple Spaces
Leading Spaces
End-of-Line Characters
SQL Injection ( ‘select * from customer ) With All Actions (Entering, Searching, Updating, etc.)
GeneralViolates Domain-Specific Rules (an ip address of 999.999.999.999, an email address with no “@”, an age of -1)
Violates Uniqueness Constraint

2. Browser dependent tests

Navigation testsBack (look for ‘Expired’ messages and double-posted transactions)
Refresh
Bookmark the URL and then select Bookmark when Logged Out
Hack the URL (change/remove parameters; see also Data Type Attacks)
Multiple Browser Instances Open
Input testsHTML/JavaScript Injection (allowing the user to enter arbitrary HTML tags and JavaScript commands can lead to security vulnerabilities) Check Max Length Defined on Text Inputs
> 5000 Chars in TextAreas
Syntax Use HTML Syntax Checker (http://validator.w3.org/) and
CSS Syntax Checker (http://jigsaw.w3.org/css-validator/)
Browser preferencesJavascript Off
Cookies Off
Security High
Resize
Change Font Size

3. Miscellenous

Variable analysisIdentify anything whose value can change.
InterfaceIdentify any public or private interface that provides visibility or control. Provides places to provoke, monitor, and verify the system.
BoundariesNear the boundaries (too big, too small) and at boundaries. Exact values
CURDCreate, update, read and delete
Sequence/WorkflowPerform a sequence of actions involving data, verifying the data integrity at each step.
Default ValuesChanging the default configurations
InterruptionsLog Off, Shut Down, Reboot, Kill Process, Disconnect, Hibernate, Timeout, Cancel
StressCPU, Memory, Network, or Disk at maximum capacity
SelectionsSome, none, all for example Some permissions, No permissions, All permissions
Multiuser/concurrent usersSimultaneous create, update, delete from two accounts or same account logged in twice
DependenciesIdentify dependencies across different data/fields, workflow steps etc.
Input methodTyping, copy/paste, drag and drop, import etc.
SortingAlpha/Numeric/alphanumeric/across pages
Third part integrationIdentify third party issues. 3rd party css/js/API ‘s etc.

How to install Cucumber on Mac?

You want to install Cucumber on your mac machine. Or if you are having trouble installing Cucumber and waitr or selenium-webdriver then you are at the right place.

Following are the steps you need to follow in order to install cucumber with waitr/selenium-webdriver.

Step 1 – Install RVM and Ruby

curl -L get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm 
$ rvm list known 
$rvm install 1.9.3 
# This installs Ruby 1.9.3

Step 2 – Install the required gems

Execute:

gem update --system 
gem install rspec --no-ri --no-rdoc 
gem install watir-webdriver --no-ri --no-rdoc 
gem install cucumber --no-ri --no-rdoc

Note:

watir-webdriver requires selenium webdriver, so that one will be installed always. If you only want selenium-webdriver, just do gem install selenium-webdriver instead.

When creating an install_gems.sh file inlcuding these commands, e.g: gem update –system

Note: You need to have Xcode and Git already installed.

For details on using Cucumber refer the following url: https://github.com/cucumber/cucumber/wiki

Cucumber

Test Effort Estimation

Challenges

Successful test effort estimation is a challenge because

  • No standard Formulae/Methods for Test Estimation
  • Test Effort Estimates also includes the Debugging Effort
  • Difficult to attempt testing estimates without first having detailed information about a project
  • Software Testing Myth that Testing can be performed at the End
  • Difficult to attempt testing estimates without an understanding of what should be included in a ‘testing’ estimation for a project (functional testing? unit testing? reviews? inspections? load testing? security testing?)

Traditional Practices

Current Test Planning Methods include using Percentage of Development Effort. It has a number of drawbacks like
it depends on the accuracy of the Development Effort and does not account revisit of Development Effort. Using Tester Developer Ratio may not be same for all types of Projects. Where as using KLOC does not consider Complexity, Critical & Priority of the Project.

What is the best approach to test effort estimation ?

There is no simple answer for this. The ‘best approach‘ is highly dependent on the particular organization and project and the experience of the personnel involved.

Different approaches to test estimation are as follows:

  1. Implicit Risk Context Approach
  2. Metrics-Based Approach
  3. Test Work Breakdown Approach
  4. Iterative Approach
  5. Percentage-of-Development Approach

 Elements of Test Estimation Process

  • Breaking and sizing into smaller, easier to estimate tasks
    1. Decompose the test project into phases viz. Unit testing, Integration testing, System Testing, Acceptance testing etc.
    2. Decompose each phase into constituent activities – System test planing, test case writing, test case execution etc.
    3. Decompose each activity into tasks and sub-tasks until each task or sub-task at the lowest level of composition. Like executing a test scenario, defect reporting etc.
  • Taking Risk priority into account
  • Taking dependencies into account
    1. Dependencies internal to the test sub-project between tasks.
    2. Document dependencies, resources, and tasks external to the test sub-project. Third party dependencies.
  • Miscellaneous
    1. Consider type of code (complex, reused, etc.)
    2. Augment professional judgment and gut instinct with previous project data, industry metrics, and so forth. 
    3. Revisit the Estimation continuously in order to reflect any change in the Project Requirements or Schedule.

 

What is Cross-Site Scripting?

What is Cross-Site Scripting (XSS)?

Cross-Site Scripting (XSS) attacks are a type of injection problem, in which malicious scripts are injected into the otherwise trusted web sites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user.
XSS attacks can generally be categorized into two categories:
  • Stored XSS Attacks -

Injected script is permanently stored on the target servers, such as in a database, in a message forum, visitor log or comment field. The victim then retrieves the malicious script from the server when it requests the stored information. Stored XSS is also sometimes referred to as Persistent or Type-I XSS.

This vulnerability can be used to conduct a number of browser-based attacks including:

  1. Hijacking another user’s browser
  2. Capturing sensitive information viewed by application users
  3. Pseudo defacement of the application
  4. Port scanning of internal hosts (“internal” in relation to the users of the web application)
  5. Directed delivery of browser-based exploits
  6. Other malicious activities

Stored XSS does not need a malicious link to be exploited. A successful exploitation occurs when a user visits a page with a
stored XSS.

  • Reflected XSS Attacks -

Injected script is reflected off the web server, such as in an error message, search result, or any other response that includes some or all of the input sent to the server as part of the request. Reflected attacks are delivered to victims via another route, such as in an e-mail message, or on some other web site. When a user is tricked into clicking on a malicious link, submitting a specially crafted form, or even just browsing to a malicious site, the injected code travels to the vulnerable web site, which reflects the attack back to the user’s browser. The browser then executes the code because it came from a “trusted” server. Reflected XSS is also sometimes referred to as Non-Persistent or Type-II XSS.

Testing for XSS Vulnerability

XSS flaws can be difficult to identify and remove from a web application. The best way to find flaws is to perform a security review of the code and search for all places where input from an HTTP request could possibly make its way into the HTML output. Every data entry point can result in an XSS attack.
Enter following  script
 <IMG SRC=javascript:alert('XSS')>

A browser pop-up titled “XSS” might come up if not dealing with XSS correctly.

<body onload=alert('test1')> 
<b onmouseover=alert('Wufff!')>click me!</b> 
<img src="http://url.to.file.which/not.exist" onerror=alert(document.cookie);>

Tools for testing XSS vulnerability

  • Burp Suite
  • XSS-Me

We will cover the details of the tools in future posts.

 

Tips and tricks of getting things done in the IT world.