DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. Performance Testing Can Be as Simple as Unit Testing.

Performance Testing Can Be as Simple as Unit Testing.

Sam Kyatham user avatar by
Sam Kyatham
·
Mar. 07, 13 · Interview
Like (1)
Save
Tweet
Share
8.55K Views

Join the DZone community and get the full member experience.

Join For Free

The first tool that comes in to mind when someone wants to do performance testing of Java server side applications is JMETER. It's free, opensource, and one of the best lightweight stable products to automate the performance/load testing.

Maven is another fantastic tool that helps to manage dependecies and build management. As we already know, maven takes care of running all our unit tests as part of a build.

Why not run your performance tests for every build to see if there is any bottleneck in performance?

If you are already familier with the JMeter and creating the test script file(.JMX file) for your application using jmeter, then it is as simple as compiling a Java project.

If you are not familier with JMeter then it is advisable to know this first: http://jmeter.apache.org/

Steps:

(1) Add the following plug-in your pom.xml file


<plugin>

  <groupId>com.lazerycode.jmeter</groupId>

  <artifactId>jmeter-maven-plugin</artifactId>

  <version>1.4</version>

  <executions>

  <execution>

  <id>jmeter-tests</id>

  <phase>verify</phase>

  <goals>

  <goal>jmeter</goal>

  </goals>

  </execution>

  </executions>

 </plugin>

 (2) Keep the performance JMeter's test script files in yourprojectdirectory/src/test/resources/jmeter/ directory.

 (3) Run the maven command:  mvn clean install

 (4) That's all, the maven command build, run the unit tests and then run the performance tests based on the scripts placed in src/test/jmeter/ directory.

 (5) Basic report (including success, failures, average response time, min and max response timings) in reports directory.

unit test

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Front-End Troubleshooting Using OpenTelemetry
  • DevOps for Developers: Continuous Integration, GitHub Actions, and Sonar Cloud
  • Solving the Kubernetes Security Puzzle
  • Custom Validators in Quarkus

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: