20,53 €
A bad response time on a website can drive away visitors and prospective customers. To measure what a website can handle, there should be a way to simulate and analyze different load scenarios, this is where a load-testing tool like JMeter comes in. JMeter is a powerful desktop performance tool from the Apache Jakarta project, written in Java, for load-testing web pages, web applications, and other static and dynamic resources including databases, files, Servlets, Perl scripts, Java Objects, FTP Servers, and more.
JMeter works by acting as the "client side" of an application, and measures response time. As such, it's one half of the testing arsenal; the other half consists of a tool to watch metrics on the server side, such as thread counts, CPU loads, resource usage, and memory usage. Although it can't behave like a browser to measure rich client-side logic such as JavaScripts or Applets, JMeter certainly measures the performance of the target server from the client's point of view. JMeter is able to capture test results that help you make informed decisions and benchmark your application.
This book introduces you to JMeter (version 2.3) and test automation, providing a step-by-step guide to testing with JMeter. You will learn how to measure the performance of a website using JMeter.
While it discusses test automation generally, the bulk of this book gives specific, vivid, and easy-to-understand walkthroughs of JMeter's testing tools showing what they can do, and when and how to use them.
Learn to load-test your website, test its functional behaviour, and measure its performance by implementing the features of JMeter.
This book is focussed on learning and understanding JMeter. It starts with a basic introduction and installation, followed by using JMeter to test web applications. It proceeds to show how to use JMeter to perform load testing and also to test the functional behavior of the target web application. The discussion continues to include testing servers other than web application servers, and demonstrates the use of some of JMeter's built-in functions. This book aims to give readers an introductory view of JMeter, and gives a brief and realistic overview to those researching for an ideal testing tool to use in testing projects.
The book is written in a straightforward, clear way, with plenty of step-by-step instructions and illustrative screenshots.
The ideal readers or users of this book are experienced or novice testers who have been testing manually and now would like to automate their tests. Those testers who are already automating their testing using other tools or testing software may also want to use this book as they look for alternatives. This book would also be a good point for test Managers/Leaders to start doing research on the test automation tool that may best suit their testing needs and of course, their budget
JMeter's target audience is the testing community, which is generally not the hangout of developers or technical people. Almost anything one would like to do in HTTP testing will be supported by JMeter without requiring any programming.
The user need not have much technical knowledge to work with JMeter. It has a simple-to-use and intuitive drag-and-drop style GUI that helps any non-technical user to get started.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 151
Veröffentlichungsjahr: 2008
Copyright © 2008 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: June 2008
Production Reference: 1200608
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847192-95-0
www.packtpub.com
Cover Image by Vinayak Chittar ([email protected])
Author
Emily H. Halili
Reviewer
Charitha.Kankanamge
Acquisition Editor
Viraj Joshi
Development Editor
Ved Prakash Jha
Technical Editor
Darshana D.Shinde
Editorial Team Leader
Mithil Kulkarni
Project Manager
Abhijeet Deobhakta
Project Coordinator
Patricia Weir
Indexer
Rekha Nair
Proofreader
Chris Smith
Production Coordinators
Aparna Bhagat
Shantanu Zagade
Cover Work
Aparna Bhagat
Emily H. Halili Since graduating in 1998, from California State University in Computer Science, Emily H. Halili has taken numerous roles in the IT/Software industry—namely as Software Engineer, Network Engineer, Lecturer, and Trainer. Currently a QA Engineer in CEO Consultancy-Malaysia with great passion for testing, she has two years of experience in software testing and managing QA activities. She is an experienced manual tester and has practical knowledge of various open-source automation tools and frameworks, including JMeter, Selenium, JProfiler, Badboy, Sahi, Watij, and many more.
My heartfelt thanks to my husband, Duraid Fatouhi, whom without his faith in me, this book may never see the light. To John VanZandt, president of CEO Consultancy, Malaysia – who inspires creativity and comradeship at work. To my colleagues at CEO Consultancy and ex-colleagues, for constantly challenging me with testing tasks and much more. Lastly, but the least, my daughter, Zahraa for inspiring.
JMeter is a powerful, easy-to-use, and FREE load-testing tool. Those are my first impressions of JMeter, a testing tool I've recently fallen in love with—not blindly. With this book, I share with you my experience with JMeter.
When I was first assigned to use JMeter to perform testing on a particular web application, I went all out looking for anything on JMeter. Despite plenty of online manuals, article and newsgroup posts, printed or e-books were nowhere to be found. So, when one of the editors of Packtpub approached me with this idea of writing a book on JMeter, I could hear myself saying: "Had there been a book on JMeter, I would have bought one at any cost. Since no one has written any, why not I write one?" After much contemplation and work, here is the result—what you are reading right now.
This book is about using basic testing tools in JMeter that support software load and regression test automation. JMeter can be used to test static and dynamic resources over a wide range of client/server software (e.g. web applications). For simplicity, this book will focus on a narrowed aspect of JMeter while demonstrating practical tests on both static and dynamic resources of a web application. As this small book is an introductory reference, it is ideally designed to pave the path for the reader to get more detailed insight on JMeter, and what more it can do beyond this reference.
Chapter 1: Automated Testing
The reader who is already automating their tests may want to skip this chapter. It takes a quick look at the need to automate testing and whether automation suits all needs of testing. It provides a quick look at and evaluation of test automation.
Chapter 2: Introduction to JMeter
This chapter is an overview of JMeter, as it takes a glance at its young history, the general look-and-feel of its GUI design, requirements, and its features.
Chapter 3: Getting Started
This chapter serves as a guide to the first-time user on installing and customizing the system environment as they run JMeter for the first time. The installation process will match the purpose of this book. Hence it will skip the more complex setup of the environment. A more complex setup guide is available from the home site of JMeter.
Chapter 4: The Test Plan
This chapter sets out to prepare the reader with the basic knowledge of tools required to successfully create and run tests. It prepares the reader for the next two chapters.
Chapter 5: Load/Performance Testing of Website
This chapter demonstrates the use of the tools in JMeter that support Load or Performance Testing. The walkthroughs are facilitated by illustrations, giving a more descriptive guide to both new and seasoned testers.
Chapter 6: Functional Testing
This chapter demonstrates the use of the tools in JMeter that support Functional or Regression Testing. Little is known of JMeter being used to support this testing approach. As in Chapter 5, the walkthroughs are facilitated by illustrations, giving a more descriptive guide to both new and seasoned testers.
Chapter 7: Advanced Features
This chapter briefly describes other resources that can be tested by using JMeter, i.e. HTTP Server, Database Server, FTP Server, using Regular Expressions, and much more. The reader may want to explore more of JMeter, once he/she has a good understanding of the basics this book covers.
Chapter 8: JMeter and Beyond
This chapter discusses briefly on what more JMeter has and can do for its users. It tells the reader where to go in order to find more information about other elements of JMeter that this book does not have.
JMeter is a 100% pure Java desktop application. Hence, you need to first download and then install the latest production release from the Jakarta official download website: (http://jakarta.apache.org/site/downloads/index.html). Download the binary code from the JMeter package available on this site.
The ideal readers or users of this book would be the experienced or novice testers who have been testing manually and now would like to automate their tests. Those testers who are already automating their testing using other tools or testing software may also want to use this book as they look for alternatives. This book would also be a good point for test Managers/ Leaders to start doing research on the test automation tool that may best suit their testing needs and of course, their budget. One of the many beauties of JMeter, is that one does not need to have prior programming skills to use it, making JMeter one of the most popular open-source testing tools within the testing community.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
There are three styles for code. Code words in text are shown as follows: "You may also change the default file format to save to XML, by editing the jmeter.properties file"
A code block is shown as follows. When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:
Any command-line input and output is written as follows:
New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "Clicking the Forever checkbox causes the test to run repeatedly until stopped manually".
Important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply drop an email to <[email protected]>, making sure to mention the book title in the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email <[email protected]>.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Visit http://www.packtpub.com/files/code/2950_Code.zip to directly downlad the example code.
The downloadable files contain instructions on how to use them.
Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
You can contact us at <[email protected]> if you are having a problem with some aspect of the book, and we will do our best to address it.
Really, what is test automation? Is it something like pressing some button to turn on the testing on auto-pilot? To an extent, yes, you can have that, and more. According to Wikipedia, (http://en.wikipedia.org/wiki/Test_automation):
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.
Simply put, it is the process of automating the manual testing process currently in use, by the use of software. Hence, this definition goes further than simply using some Word Processor software.
This chapter will give you a quick overview of what test automation is all about and its significance in the testing process, and ultimately, the software process. It aims to help you decide whether test automation is the way to go for testing applications. It will also describe the cost-effectiveness of test automation in comparison with manual testing or no testing at all.
As you begin to ponder if test automation is what you need, some questions may be lingering in your mind:
This chapter will answer your questions.
Some software project managers hold strongly to the myth that testing costs too much, takes too much time, does not help them build the product, and can create hostility between the tester(s) and the development team. You will find these are the very people who would spend the least on testing.
On the other hand, there are smarter software managers who understand that testing is an investment in quality. Hence, they tend to spend more on testing. Efficient test project management produces a positive return, fits within the overall project schedule, has quantifiable findings, and is seen as a definite contributor to the project.
However, as developing software overruns, as it normally does, time is at a premium. As you may know or have experienced, 'manual' testing, especially regression testing can be exhausting. A time-consuming and tedious process, it is inefficient and conflicts with today's shorter application development cycles. As a result, it gets in the way to test an application thoroughly—enabling critical bugs to slip through undetected. What's more, manual tests are prone to human error and inconsistencies that can distort test results.
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. However, for most of the time, this is not the case. In software testing, time is a determining factor and the effective use of automation CAN help improve the testing speed.
On the other hand, despite of the appeals of test automation, we need to bear in mind that test automation may just be suitable for only parts of the software testing process. Automated testing IS NOT a total replacement for manual testing. Certain aspects of testing an application would rely more on the human tester than on test automation. The ultimate testers still are the human testers themselves; where applicable, test automation only complements manual testing. Test automation may not test any better than the human tester, but if implemented wisely, can certainly help the tester test faster. Since certain testing of the application can be automated, the tester can spend more quality time on more important and critical aspects of the testing. Ultimately, the tester can test better and more effectively.
The previous paragraph cautions against using automation to replace manual testing, putting you, the reader (or the tester) in an awkward predicament. However, let us think about an average-case scenario: You are pressed against a tight budget and schedule, and you are sure that manually regression testing the application completely would only leave you and your team physically and mentally exhausted. Would automation help you test, if not any better, at least faster? Some hints may just help you decide:
Automation is best used after the tester has grasped the fundamental testing skills and concepts through manual testing experience. Another good time is when the tests that are going to be repeated or simulated, as normally found in regression testing and performance testing, respectively. As this goes, not all testing approaches may justify the use of automation.
Rex Black in his article, Investing in Software Testing: Manual or Automated? concludes that the decision to automate testing comes from the need to repeat tests numerous times or reduce the cycle time for test execution while higher per-test costs and needs for human skills, judgment, and interaction incline towards decision to test manually.
Not all testing approaches are suitable to automate:Suitable: Acceptance, Compatibility, Load, Volume or Capacity, Performance and Reliability, Structural testing, Regression, Exception or Negative testing.
Type of Testing
Description(adapted from source: http://www.istqb.org)
Acceptance testing
Formal testing with respect to user needs, requirements, and business processes conducted to determine whether a system satisfies or does not satisfy the acceptance criteria and to enable the user, customers, or other authorized entity to determine whether or not to accept the system.
Compatibility testing
The process of testing to determine the interoperability of a software product.
Load testing
A type of performance testing conducted to evaluate the behavior of a component or system with increasing load, e.g. numbers of parallel users and/or numbers of transactions, to determine what load can be handled by the component or system.
Volume/Capacity testing
Testing where the system is subjected to large volumes of data.
Performance testing
The process of testing to determine the performance of a software product.
Reliability testing
The process of testing to determine the reliability of a software product.
Structural testing
Testing based on an analysis of the internal structure of the component or system (also known as white-box testing)
Regression testing
