Tuesday, July 30, 2013

JMeter


JMeter is a desktop application, designed to test and measure the performance and functional behavior of client/server applications. JMeter works by acting as the "client side" of a "client/server" application.


It measures response time and all other server resources such as CPU loads, memory usage, and resource usage. JMeter is used to load-test FTP servers, database servers, and Java Servlets and objects. Today, it has been widely accepted as a performance testing tool for web applications.




The Features—What JMeter Can Do for You


  • Performance testing of HTTP and FTP servers, and database queries
  • 100% Java-based
  • Efficient GUI (Java Swing) design
  • Caching of test results

The basic elements of a JMeter include: Thread Group, Listeners, and Samplers. 
The Thread Group element simulates a group of users, which contains at least one user. As a Sampler element makes requests to the target server, a Listener element captures the response data or page following each request.



The Look-How-Easy-to-Use GUI
  • Thread Group—each thread simulates a single user. All elements of a test plan must be under a thread group.
  • Listeners—Provide access to the information gathered by JMeter about the test cases while JMeter runs.
  • Controllers—Samplers tell JMeter to send requests to a server, while Logical Controllers let you customize its logic.
  • Timers—Allow JMeter to delay between each request that a thread makes.
  • Assertions—Allow you to "test" that your application is returning the results you expect it to.
  • Configuration Elements—Working closely with a Sampler, these can add to or modify requests.

Once JMeter runs, you will see two elements, Test Plan and WorkBench,
A Test Plan describes a series of steps JMeter will execute once the Test Plan runs, while a WorkBench functions as a temporary workspace to store test elements.






Monday, July 29, 2013

Automated Testing


Test automation is the use of software to control the execution of tests, the comparison of actual outcomes to predicted outcomes, the setting up of test preconditions, and other test control, and test reporting functions.

Why Automate Testing?

Manual Testing costs too much, takes too much time, does not help them build the product.
Can we do without automation? Yes, of course—if time is abundant and your client (or boss) is NOT on your tail for the application's next release.
Automated testing IS NOT a total replacement for manual testing.

To Automate or Not to Automate.

  • Pick a good time to start automating.
  • Not all testing approaches are suitable to automate.
    1. Suitable: Acceptance, Compatibility, Load, Volume or Capacity, Performance and Reliability, Structural testing, Regression, Exception or Negative testing.
    2. Not suitable: Installation and setup, Configuration and Compatibility, Documentation and help, Error handling and Recovery, Localization, Usability, and any other that relies heavily on human judgment.
  • Make automation only a supplement to a testing project.
  • Do some comparison of Automated vs. Manual Testing.

How Much Does it Cost?

The total cost needs to consider the costs of numerous resources undertaking a testing project.
Person hours to test

Bugs found by the customers are much more expensive than if the same bugs are found during development.
Rex Black's cost of testing—no testing, manual testing and automated testing. 
Automation gives the client higher return on investment (ROI) than manual testing, while no testing at all brings no benefit in the long haul.









Sunday, July 28, 2013

Capacity Planning in Performance Testing


Capacity Planning is divided as - Server side and Network side.

Server Capacity Planning means to determine server hardware resources required to provide the desired levels of service for a given workload mix for the least cost.

Types Capacity Planning:
  • Capacity benchmarking.
  • Capacity trending.
  • Capacity modeling.

Benchmarking, or load testing, is perhaps the most common, but also the most expensive. The idea is, you set up a configuration and then throw traffic at it to see how it performs. To do this right, you need access to a fully-configured version of the target system.


Linear trend analysis and statistical approaches to trending can provide quick and dirty ways to predict when you will need to do something about performance, but they don’t tell you what you should do to optimally respond.


That leaves modeling, which comes in a couple flavors: simulation and analytic modeling. Simulation modeling can be very versatile and accurate, but requires a great deal of set up effort and time. Analytic modeling is fast and is potentially very accurate as well. The beauty of modeling is that you can “test” various proposed solutions to a problem without actually implementing them. This can save a lot of time and money.

Saturday, July 27, 2013

QPST - Qualcomm Product Support Tools


QPST is software package used for phones based on Qualcomm chips:
UMTS-based phones EF81, SXG75, SFG75, E81 and other (EF82, SL91, etc.).

QPST software includes:
QPST Configuration - COM-port selection to work with phone.
EFS Explorer - file manager for phone file system.
Display Capture - screen capture utility for Java-games and video playing.
FTM Application - front end testing.
RF Calibration - front end calibration.
RF NV Item Manager - NV-memory manager (EEPROM).
RL Editor - roaming list settings.
Service Programming - different phone settings.
Software Download - phone flasher.
QCNView - .QCN files viewer, generated by Software Download (Backup menu).
DMProxyWin - QPST ports translation server. Allows to connect to the current phone from another device, which connected to Internet using QPST and DMProxyWin.
Gang Flash Image Application - creates firmware and file system image to use in programmer such as Data I/O ProLINE RoadRunner or Data I/O FlashPAK.

Friday, July 26, 2013

Mobile Application Testing

Testing is regarded as last priority while developing an App. Not for all Apps. Testing takes time. Comprehensive testing takes more time if we use conventional methods. Many orgs use Testing Matrix for Mobile Apps. However, testing methods for mobile apps is still the same. Traditional testing methods are outdated, inefficient and  ineffective for mobile apps. So what we do? We test less and hope for the best.

The challenges of Mobile App Testing: Of course,Users, Bugs, and Money.
Users does download Apps from Stores, but if they come out buggy, then they throw it away and never use it. Only non-buggy Apps stay on their Handsets. So developers need to test their App on Handset, OS, Browser, Carrier, Location, etc. So what companies do: They do following:

  • In-House Testing.
  • Outsource Testing.
  • Simulators / Emulators.
  • Beta Testers.
Testing is very important for Mobile Apps. 


Friday, July 19, 2013

Linux SSH Tricks

To see debug lines of ssh session login, use below command:
#ssh -v <IP>


SSH session toggle between remotehost and localhost:
Localhost$ ssh remotehost
Remotehost$ ~^Z [suspend ssh]
[1]+ Stopped ssh <IP>
Localhost$ fg %1
Remotehost$

Thursday, July 4, 2013

Linux Commands

Create directory and give permisson in a go.
# mkdir /tmp/test1 -v -m 1777

Environment variable $CDPATH
It lets you define some path to look for when moving with cd command.
# export CDPATH = . : / : ~/
# cd usr
/usr
# cd Desktop
/home/viku/Desktop

Hardware info:
# dmidecode --type memory
# dmidecode --type bios
# dmidecode --type cache
# dmidecode --type processor
so on....

Find all files with extension .txt or .jpg
#find . -type f -inode "*.txt." -or -inode "*.jpg"

Find all files except hidden files
#find . -type f -inode "*.txt." ! ".*"


Append text at end of file, use >> operator.
Append text at beginning of file.
#echo "text" |cat - file.txt > /tmp/out && mv /tmp/out file.txt

Check whether an alias is assigned to a command
#type ls

Revert alias to original
#unalias ls

Restrict alias effect and see the native command.
# command ls
# \ls
# "ls"

Diff and Patch
#diff -c oldfile newfile  > temp.patch
#patch < temp.patch


Wednesday, July 3, 2013

Using screen program in Linux

On terminal1, enter:
#screen

To detach the terminal, press CTRL + A + D

Open another session, login and issue the command:
#screen -x

And you are done. You can see things done in terminal_one at the other terminal.

ICMP

Internet Control Message Protocol

IP relies on several protocols to performs control and routing functions:
- Control functions (ICMP)
- Multicast Signalling (IGMP)
- Setup routing tables (RIP, OSPF, BGP, PIM...)

ICMP is a helper protocol, that supports IP with facilities for:
==Error Reporting
==Simple Queries

ICMP messages are encapsulated as IP datagrams.
----------------------------------------
|  IP Header  |  ICMP payload message  |
----------------------------------------


4-byte header:
*Type (1 byte).
*Code (1 byte).
*Checksum (2 bytes).
If there is no additional data, 4-bytes are set as zero.
So Each ICMP is at least 8 bytes long.


ICMP query:
Request sent by host to a router or host.
Reply sent back to querying host.

Type/Code: 8/0: Echo Request
Type/Code: 0/0: Echo Reply

The ping command uses Echo Request / Echo Reply.

Ping's are handled directly by the kernel.
Each Ping is translated into an ICMP Echo Request.
The Ping'ed host responds with an ICMP Echo Reply.


Tuesday, July 2, 2013

Putty - Auto login a machine

How do I auto-login to putty on MS Windows?

1. Create shortcut to putty.
2.    Right-click -> Properties.
3. Modify target : “D:/vikas/software/putty.exe” user@server.com -pw password

Linux Interview Questions

1. How to find out the execution details of a cronjob ?
#crontab –l –u <usename>

2. How to modify the kernel parameters on the fly ?
Usually its done by sysctl and also by echo <value> redirect to /proc/some-files.

3. How to make the modification of the kernel parameters permanent across reboot ?
I think you can add your parameters and values into sysctl.conf. after reboot, it will be read by the run level scripts. Need to check again yar. Another way to do is to write a shell script and add that to init run level scripts.

4. How does a server resolve DNS queries? What are the configuration files which assist in resolving a DNS query of a server ?
Don’t know how does the server resolves DNS query. But this is the concept:
When a client host requests information from a nameserver, it usually connects to port 53. The nameserver then attempts to resolve the name requested. If it does not have an authoritative answer, or does not already have the answer cached from an earlier query, it queries other nameservers, called root nameservers, to determine which nameservers are authoritative for the name in question, and then queries them to get the requested name.
In RHEL, you edit the named.conf, add FQDN of a host into it. This FQDN is called resource record. And is stored in tree structure e.g. in. is top level domain (root), then hcl is sub-domain, like that.

On server, named.conf resolves DNS queries. On client side, resolv.conf is used to find the nameserver.

5 What is the port by which default traffic of NFS is allowed to pass ?
Port 2049 I guess. I tried this:
#grep nfs /etc/services

6. How does the NFS communication between NFS server and client happen ?
#Make entries of dir into /etc/exports
#service nfsd start
On client, mount the nfs share of the server.
#mount -t nfs -o options host:/remote/export /local/directory

The communication happens over TCP/UDP. Client connects to mountd on server via RPC. RPC connects to nfsd on server.

There is also autofs, using which you do not need to mount the server FS every time.do it in /etc/auto.master

7. How can a NFS exported filesystem be mounted manually on a NFS client ?
Described above

8. How can a file system be exported at boot time ?
Make an entry into /etc/fstab like this
server:/remote/export /local/directory nfs options 0 0

Monday, July 1, 2013

Test Data and Performance Testing

Performance Testing finds scalability issues. It simulates production workload.
Sets of input data is important. Need real set of test data.
Right type of data and volume.

Performance Test Data:
1.       Transactional data
2.       Volume data

Test Data maintenance:
-          Ensure data setup, and proper version control,
-          access restriction and backup mechanism.

Test Data Mgmt process helps:
-          better time to market
-          minimize risk

Formulate the test strategy, decide test approach, and make TDM part of it.
Identify the nature and volume of test data. Make Traceability of test data with transactions.

Collaborate with dev, DBA, functional QA teams and procure test data.
Use automated tools, shell scripts, SQL for data mining and creation.
Take a lead time for test setup.

Ensure data conflict with other teams.
Check for test data exhaustion during test cycle and play proactively.

Data profiling exercise helps to purge and clean-up the redundant and unused test data during test execution.
Use automated clean-up scripts or rollback jobs after test execution and restore the previous state.

Probability - Bday Problem

What is the probability of two persons, amongst N people in a room, of sharing same birthday.
There are 365 days in a year.

No of People: 1, 2, 3 .... N
bi = birthday of person i.
bj = birthday of person j.

Probability of a person to have birthday = 1/365
Birthday of two people is independent event.
So P(bi and bj) = 1/365 x 1/365
Probability of bday of i and j on same day = P(bi == bj) = SUM (1/365 x 1/365 over all days.
P (bi == bj) = 1/365.

This is not the solution, but rather than finding the event where two people have same bday is cumbersome.

=========================
Another Solution:
=========================
Sample space of this problem = Event (people sharing bdays) + Event (people not sharing bdays).
Lets take E = no one shares bday.
So, 1 - E = shares bday.

E(1) = 365
E(2) = 364 //bcoz person2 cannot have same bday as first.
E(3) = 363 //bcoz person3 cannot have same bday as first.and second
E(4) = 362
.
.
E(n) = 365 - (n-1)

No of ways = 365 x 364 x 363 x .. x (365 - (n-1))
This is a factorial.
No of ways = 365! / (365 - n)!
This is Permutation of 365 with n.
No of ways = 365-P-n

Total Events = 365 x 365 x 365 x .... n times
Total Events = 365^n

P(no one shares bday) = ( 365-P-n ) / ( 365^n )