JMeter-Testing Tools

Java-Examples

                                                                                                                                                                                                                    Show all | Close all
  • Overview

    • What is testing

      Testing can never completely identify all the defects within software.[2] Instead, it furnishes a criticism or comparison that compares the state and behavior of the product against oracles-principles or mechanisms by which someone might recognize a problem. These oracles may include (but are not limited to) specifications, contracts,[3] comparable products, past versions of the same product, inferences about intended or expected purpose, user or customer expectations, relevant standards, applicable laws, or other criteria. A primary purpose of testing is to detect software failures so that defects may be discovered and corrected. Testing cannot establish that a product functions properly under all conditions but can only establish that it does not function properly under specific conditions.[4] The scope of software testing often includes examination of code as well as execution of that code in various environments and conditions as well as examining the aspects of code: does it do what it is supposed to do and do what it needs to do. In the current culture of software development, a testing organization may be separate from the development team. There are various roles for testing team members. Information derived from software testing may be used to correct the process by which software is developed.[5] Every software product has a target audience. For example, the audience for video game software is completely different from banking software. Therefore, when an organization develops or otherwise invests in a software product, it can assess whether the software product will be acceptable to its end users, its target audience, its purchasers, and other stakeholders.

      The Reason & Importance of Testing


      It is very important to have decent quality software's. Having this means the quality should match many requirements such as keeping the easy use of GUI's, as well as containing faults and failures and many more. A lot of effort is required to keep this quality to a reasonable standard. Testing is one of the most important parts in quality assurance especially in the development stages. As the development of the program comes to an end it becomes harder to fix errors, in fact becomes harder to spot errors. This would mean, perhaps, to check each section during the development so that the errors can be spotted and fixed before progressing to the next stages.
      Testing should be done during the development stages and if it is not done during the development stages then it is more than likely that there will be a lot of bugs and errors. Some problems which may not have been seen during the development stages, without testing at the end, could be something like a function being used whilst the stack is empty. This could lead to a system crashing. However, if testing is done this could be spotted before proceeding to the next stage.
      Humans are prone to make mistakes and so if they do everything then it may not be as efficient. Some code may be missed out with humans and so this could cause errors in the system.
    • why we use testing tools


      Testing tools can help automate tasks such as product installation, test data creation, GUI interaction, problem detection (consider parsing or polling agents equipped with oracles), defect logging, etc., without necessarily automating tests in an end-to-end fashion. One must keep satisfying popular requirements when thinking of test automation:
      Platform and OS independence
      Data driven capability (Input Data, Output Data, Metadata)
      Customizable Reporting (DB Access, crystal reports)
      Easy debugging and logging
      Version control friendly - minimal binary files
      Extensible & Customizable (Open APIs to be able to integrate with other tools)
      Common Driver (For example, in the Java development ecosystem, that means Ant or Maven and the popular IDEs). This enables tests to integrate with the developers' workflows.
      Support unattended test runs for integration with build processes and batch runs. Continuous integration servers require this.
      Email Notifications (automated notification on failure or threshold levels). This may be the test runner or tooling[clarification needed] that executes it.
      Support distributed execution environment (distributed test bed)
      Distributed application support (distributed SUT)
      As the software industry grows, it becomes more and more competitive and advanced for businesses to produce such good quality software. With this also comes the reliability and deadlines which must be met. Testing plays a big part in the case of deadlines as testing can take a long time on the software. The production of the software and the quality together must be increased for businesses to produce the best possible software. Testing, therefore, has to be done throughout the process of programming the software. Manual testing takes too long and can waste a lot of time. With the aid of testing tools this can increase efficiency and get the deadlines met.
    • Types of testing tools

      What are testing tools ?


      Testing tools are a form of automated testing. It is basically using programs to do different testing tasks i.e. doing the tests through some form of automated method. They are computerized and help in assisting every type of testing. Some of these testing tasks include checking the conditions, also checking the predicted results with the actual results along with many other types of testing involved. A lot of these testing tools have commonly used coding languages such as Java and C. The testing tools themselves have been made using these programming languages. A lot of the tools used have different options available to help with testing. This can be very useful when producing the essential reports of that particular product.

      Different Methodologies Used For Testing


      There are different methodologies that are can be used when implementing testing tools. The testing methodologies can be used together or individually. It all depends on what you are testing as they provide better resources for different tasks. Below are a few of the main different types that are used but there are other types of testing that can be used:

      Unit Testing

      This is the software used for verification and validation. It's a method in which the programmer can test all the separate code and see if it is viable to use. This type of testing is based on a small scale and uses small units of the program. When looking at procedural programming the unit can be any individual function or a procedure which is written in the same language as the production code.

      White Box Testing

      This is also known as clear box testing, glass box testing, translucent box testing or structural testing. It uses the internal perspective of the system and then designs test cases based on this internal structure. Basically the code itself and all the conditions, statements and paths along with it are tested. Programming skills are required for noticing all the paths through the software. White box testing does many things such as analyzing the data flow, control flow, information flow and coding practices.

      Regression Testing

      This is a type of software testing which basically looks for software regressions. The regressions can happen whenever the software stops working as it is meant to. The testing makes sure that any bugs or changes have been fixed which may have caused previous working functions to have failed as a result of the newly added features. It is better to do this type of testing under the automated tool environment. The regression testing may take place once the programmer has tried to fix a problem or has purposely added in code to give out errors.

      Integration Testing

      This is where the separate software modules are put together and are then tested as a whole. This normally takes place after unit testing has been done. The point of doing integration testing is because it verifies the functional and performance requirements of the design items. It is component of Extreme Programming (XP). Two different ways of doing integration testing is bottom-up and top-down.
  • Apache Jmeter

    Apache JMeter is an Apache project that can be used as a load testing tool for analyzing and measuring the performance of a variety of services, with a focus on web applications.
    JMeter can be used as a unit test tool for JDBC database connections, FTP, LDAP, Webservices, JMS, HTTP, generic TCP connections and OS Native processes. JMeter can also be configured as a monitor, although this is typically considered an ad-hoc solution in lieu of advanced monitoring solutions.
    JMeter supports variable parameterization, assertions (response validation), per thread cookies, configuration Variables and a variety of reports.
    JMeter architecture is based on plugins. Most of its "out of the box" features are implemented with plugins. Off-site developers can easily extend JMeter with custom plugins.
  • Versions of jmeter

    Apache JMeter versions
    Version Release Date Description
    1.0.2 2001-03-09 earliest in archive
    ... ...
    2.3RC3 2007-07-11
    2.3RC4 2007-09-02
    2.3 2007-09-24
    2.3.1 2007-11-28
    2.3.2 2008-06-10
    2.3.3 2009-05-24
    2.3.4 2009-06-21
    2.4 2010-07-14 Java 5
    2.5 2011-08-17 Java 5
    2.5.1 2011-10-03 Java 5
    2.6 2012-02-01 Java 5
    2.7 2012-05-27 Java 5
    2.8 2012-10-06 Java 5
  • Environment and requirement

    • Java Environment
      A fully compliant Java 1.2 environment is required for Apache JMeter to execute. Since Apache JMeter uses only standard Java APIs (java.*), please, do not file in a bug report if your JRE fails to execute Apache JMeter because a class implementation is missing, or not fully compliant.
    • Java JFC (Swing components)
      Swing GUI extentions are required for Apache JMeter. Due to incompatibility in the package names, the precompiled version works only with Swing placed under the package javax.swing which is its final destination found in the Java 2(tm) platform.
    • Java Compiler [optional]
      A Java compiler is not needed since the distribution includes a precompiled java binary archive. Note that a compiler is required if you plan to recompile the source code or if you plan to build your own plugins.
    • SAX 1.0 XML Parser [optional]
      The SAX 1.0 libraries and a SAX compliant parser are necassary for restoring of saved HTTPSamples and to compile Apache JMeter. JMeter ships with Apache's Xerces parser.
    • Java Mailtm & javax.activation [optional]
      The javax.mail & javax.activation packages are required to receive mail notifications from JMeter.
    • JSSE [optional]
      JSSE is used to provide an SSL implementation to enable testing of https protocol.
    If your system meets the above requirements, thanks to the beauty of Java you don't have to do anything else: under the directory /bin you will find the binary application and the system wrappers you need to run Apache JMeter. You may want to go the running instructions to continue.
    If the precompiled binary doesn't match your system (Swing package incompatibility) or you simply want to recompile the source code, you may use Apache's Ant.
    To build with ant:
    • move to the base of the jmeter distribution
    • Linux/Unix: run "build.sh install"
    • Windows: run "build install"
  • How to install jmeter in eclipse

    JMeter is an open source load testing tool, it's pretty easy to get up
    and running and it's quite fun to test and break things on your own server.

    Here's a quick getting started guide on how to record a simple test plan.

    Download and install JMeter

    Open Jmeter (bin/Jmeter.bat on Windows)

    Add (via right click) a Thread group to the Test Plan
    Add a Non Test Element > HTTP Proxy Server to the Workbench
    Open the HTTP Proxy Server Page and change the port if required

    Set the Target Controller to Test Plan > Thread Group on the same page



    Configure your browser (Firefox!) to use the Proxy Server (it's localhost)

    Press Start at the bottom of the page

    Now, JMeter will record all the HTTP requests your browser makes, so make sure you have closed all the other tabs you have open, otherwise you will get a mixture of Ad's and ajax requests recorded as well.

    As an example, tonight I was doing some load testing on the Tile service for Mapguide, so I opened a map and zoomed in and panned around a bit. Then I pressed Stop in JMeter and I had a list of HTTP requests. Simple!

    Don't forget to reset your browser proxy settings!



    You can delete any requests you don't want from the list at any time.

    Add a Timer > Gaussian Random Timer to the Thread Group which will make the requests random.

    Add a Listener > Aggregate Report to the Test Plan

    Now for the first run, the default load setting is fine.

    Select the Aggregate Report and the from the top menu click Run > Start



    If that worked out ok and there are no errors, you can the configure the thread group to run multiple times with multiple users. You can see I had an error rate of 100% in the example above.



    If you get errors, check your webserver and application server logs. You can also log and view each http request and response using Listener > View Results in Table. Filtering to only show errors is also helpful.




    If you are running a big load test, remember each Listener keeps a copy of the results in memory so you might be better running a Listener > Simple Data Writer instead which writes the results out to a file. You can then read the file in later into any of the reports.

    Overall it took me a bit of time to get familiar with JMeter, there's lots of cool things you can do with it. Keep in mind session handling (cookies) for dynamic applications as well!

    Remember to read the documentation and be careful! Make sure you know what servers will be affected by your testing, and don't jump to simple conclusions, 3-tier web apps are complex beasts.

    I have seen developers trying to solve a performance issue and completely misunderstanding the problem. Then they go and try and solve the wrong problem, usually involving lots of wasted coding.

    Always start with a smaller load, you better off finding and fixing a bug which occurs often under low load, than an obscure bug which occurs only under extreme load.
  • Download...

    Cilck here to download for Official website