Basic Testing Concepts.
This Document will help you to learn the main theme of testing
Covered the concepts of Performance testing with Load Runner and the JMeter
2. • Software testing is an activity to check whether the actual results are matches with the expected
results and to be ensure that the software testing is a bug free.
We need this to overcome the issues like below:
Field validation issues
Site responsiveness under specific load.
Confusing Navigation
Inadequate InSite search
Lack of device and browsing compatibility
• Lack of testing may lead to:
Loss of Money , Time and Business Reputation
• Testing includes activities that ensure the identification of bugs/errors/defects in a software.
• Software quality Assurance(SQA) is error preventive and verification activity. SQA role is to audit
that documented standards, processes and procedure are follow as enforced by development policy.
Needed material is checklist and performed by QA engineers.
• Software quality control(SQC) is defect detection and validation activity. SQA role (usually tests) is
to confirm the quality of a system and to check whether this application adheres the defined quality
standard or not. Needed material is application and performance by software testers.
3. Software Development Life
Cycle
Requirement
analisis
Project
Planning
Project Design
Developent
Testing
Implimentation
and maintance
Error which is a mistake of an human action
that produces an incorrect result.
Fault which is a bug or the defect which
flaw in a component or system that can
cause the component or the system fail to
perform its required function.
Failure is a deviation of the component or
system from its expected delivery or serivce
or result.
Test data planning essentially includes test procedure planning
5. White Box Testing
White box testing
Structural testing
Code Complexity
Cyclomatic complexity
Code coverage
Statement Coverage
Path Coverage
Condition coverage
Function Coverage
Unit/Code functionality
testing
Static Testing
Desk Checking
Code Walk through
Code inspection
A way of testing the external functionality of the code by
examining and testing the program code that realizes the external
functionality.
Advantages / Pros of White Box Testing
Code optimization by revealing hidden errors
Transparency of the internal coding structure which is helpful
in deriving the type of input data needed to test an application
effectively
Covers all possible paths of a code thereby, empowering a
software engineering team to conduct thorough application
testing
Enables programmer to introspect because developers can
carefully describe any new implementation
Test cases can be easily automated
Gives engineering-based rules to stop testing an application
Disadvantages / Cons of White Box Testing
o A complex and expensive procedure which requires the
adroitness of a seasoned professional, expertise in
programming and understanding of internal structure of a
code
o Updated test script required when the implementation is
changing too often
o Exhaustive testing becomes even more complex using the
white box testing method if the application is of large size
o Some conditions might be untested as it is not realistic to test
every single one
o Necessity to create full range of inputs to test each path and
condition make the white box testing method time-consuming
o Defects in the code may not be detected or may be introduced
considering the ground rule of analyzing each line by line or
path by path.
6. Black Box Testing
Functional testing types include:
Integration Testing
System Testing
Sanity Testing
Smoke Testing
Interface Testing
Regression Testing
Beta/Acceptance Testing
Refinement Testing
Blackbox testing is done without the knowledge of the internal of the system under
test.
Requirement based testing tests the products compliance to the requirement
specifications.
Advantages / Pros of Black Box Testing:
Unbiased tests because the designer and tester work independently
Tester is free from any pressure of knowledge of specific programming
languages to test the reliability and functionality of an application / software
Facilitates identification of contradictions and vagueness in functional
specifications
Test is performed from a user’s point-of-view and not of the designer’s
Test cases can be designed immediately after the completion of specifications
Disadvantages / Cons of Black Box Testing:
o Tests can be redundant if already run by the software designer
o Test cases are extremely difficult to be designed without clear and concise
specifications
o Testing every possible input stream is not possible because it is time-consuming
and this would eventually leave many program paths untested
o Results might be overestimated at times
o Cannot be used for testing complex segments of code
10. An industry-leading performance and load testing product by Hewlett-Packard (since it acquired Mercury
Interactive in November 2006).
LoadRunner reduces the personnel requirements by replacing human users with virtual users or Vusers.
These Vusers emulate the behavior of real users — operating real applications.
Because numerous Vusers can run on a single computer, LoadRunner reduces the hardware
requirements.
The LoadRunner Controller allows you to easily and effectively control all the Vusers — from a single point
of control.
LoadRunner monitors the application performance online, enabling you to fine-tune your system during
test execution.
LoadRunner automatically records the performance of the application during a test. You can choose from
a wide variety of graphs and reports to view the performance data.
LoadRunner checks where performance delays occur: network or client delays, CPU performance, I/O
delays, database locking, or other issues at the database server. LoadRunner monitors the network and
server resources to help you improve performance.
Because LoadRunner tests are fully automated, you can easily repeat them as often as you need.
Why HP LoadRunner?
12. LoadRunner TerminologyScenarios:
Using LoadRunner, application performance testing requirements are divided into scenarios.
A scenario defines the events that occur during each testing sessions.
For example, a scenario defines and controls the number of users to emulate, the actions that they perform, and the machines on which they run their
emulations.
Vusers
In a scenario, LoadRunner replaces human users with virtual users or Vusers.
In a scenario, Vusers emulate the actions of human users—submitting input to the server.
A scenario can contain tens, hundreds, or even thousands of Vusers.
Vuser Scripts
The actions that a Vuser performs during the scenario are described in a Vuser script
When a scenario is executed, each Vuser executes a Vuser script. Vuser scripts include functions that measure and record the performance of the
server during the scenario.
Transactions
To measure the performance of the server, transactions are defined.
Transactions measure the time that it takes for the server to respond to tasks submitted by Vusers.
Rendezvous Points
Rendezvous points are used into Vuser scripts to emulate heavy user load on the server.
Rendezvous points instruct multiple Vusers to perform tasks at exactly the same time.
For example, to emulate peak load on the bank server, we insert a rendezvous point to instruct 100 Vusers to simultaneously deposit cash into their
accounts.
Controller
LoadRunner Controller is used to manage and maintain scenarios.
Using the Controller, we can control all the Vusers in a scenario from a single workstation.
Hosts
When you execute a scenario, the LoadRunner Controller distributes each Vuser in the scenario to a host.
The host is the machine that executes the Vuser script, enabling the Vuser to emulate the actions of a human user.
Performance Analysis
Vuser scripts include functions that measure and record system performance during load-testing sessions.
During a scenario run, you can monitor the network and server resources.
Following a scenario run, you can view performance analysis data in reports and graphs.
13. How LoadRunner Works?
LoadRunner works by creating virtual users who take the place of real users operating client
software sending requests using the HTTP protocol to web servers.
Requests from many virtual user clients are generated by "Load Generators" in order to
create a load on various servers under test
The Controller controls load test runs based on "Scenarios" invoking compiled "Scripts" and
associated "Run-time Settings".
Scripts are crafted using "Virtual user script Generator" (named "VU Gen"), It generates C-
language script code to be executed by virtual users by capturing network traffic between
Internet application clients and servers.
During runs, the status of each machine is monitored by the Controller.
At the end of each run, the Controller combines its monitoring logs with logs obtained from
load generators, and makes them available to the "Analysis" program, which can then create
run result reports and graphs for Microsoft Word, Crystal Reports, or an HTML webpage
browser.
14. What is Jmeter?
• Apache JMeter is a 100% pure Java desktop application designed to performance/load test client/server software (such as a web application)
• Initially developed for web apps, but later extended to
FTP
LDAP
Databases
Java Objects
It is an Open source tool
Can be used on different protocols and server types : SOAP, REST, JDBC, Mail
User friendly GUI Design compare to other tools
Test results can be displayed in various formats such as Summary report, Aggregate report, View Results Tree and View Results in Table
Short learning curve (basic HTML knowledge should do it for a beginner)
Can be extended through plug-ins
Has excellent documentation
15. Main Components
• Test plan:
The main part of JMeter scripts
The “home” of thread groups, samplers, configuration elements and other specific components
• Workbench:
Used mainly for generating script components using “HTTP(S) Test Script Recorder” component
By default not saving components in scripts
• Samplers perform the actual work(requests)
• Logic Controllers determine the order in which samplers are processed
• Listeners provide means to view, save, and read saved test results
• Configuration elements can be used to set up defaults and variables for later use by samplers
• Assertions are used to perform additional checks on samplers
• Timers(waits) are applied before the sampler is executed
• Pre/Post Processors are used to modify the Samplers in their scope
• Misc: Thread Group(+setUp, +tearDown), HTTPS Test Script Recorder
17. Windows performance Monitoring
• Examine how programs you run affect your computer's performance, both in real time
and by collecting log data for later analysis
• Uses performance counters, event trace data, and configuration information, which can
be combined into Data Collector Sets
• Performance counters are measurements of system state or activity
• Event trace data is collected from trace providers
• Configuration information is collected from key values in the Windows registry
• Run => perfmon
• Create templates for later use