{"id":{"repo_id":"chalmers","oai_identifier":"oai:odr.chalmers.se:20.500.12380/305702"},"canonical_url":"https://search.ndltd.org/etd/chalmers/oai:odr.chalmers.se:20.500.12380/305702","repository":{"repo_id":"chalmers","name":"Chalmers University of Technology","base_url":"https://odr.chalmers.se/oai/request"},"display":{"title":"JUnit-to-JMH: Automatic Generation of Performance Benchmarks from Existing Unit Tests in Java","abstract":"Software microbenchmarks have been proposed as a tool that could be used for performance regression testing, similarly to how unit tests are used for functional regression testing. However, studies on open-source Java projects have shown that unlike unit tests, suites of good microbenchmarks that could be used for performance regression testing are absent from most projects. To address this lack of usable microbenchmarks in existing projects, this thesis proposes an approach for automatically generating benchmarks from existing suites of unit tests, and presents a prototype implementation of the approach called JUnitto- JMH, capable of generating JMH benchmarks from existing JUnit 4 unit tests. The prototype was evaluated on the unit test suite of a real-world open source Java project as well as on a set of specially crafted workloads. The prototype was found to be able to produce compiling benchmarks for all of the study subject’s JUnit tests, of which 98.86% were able to run without executiontime errors, taking just under 30 seconds on average to produce the full suite of 11363 benchmarks. The generated benchmarks were found to produce more stable performance measurements compared to timing measurements obtained from executing the original unit tests. Generated benchmarks were also found to be able to detect performance differences between specially crafted workloads of different size, albeit less effectively than hand-written JMH benchmarks.","abstract_html":"Software microbenchmarks have been proposed as a tool that could be used for performance regression testing, similarly to how unit tests are used for functional regression testing. However, studies on open-source Java projects have shown that unlike unit tests, suites of good microbenchmarks that could be used for performance regression testing are absent from most projects. To address this lack of usable microbenchmarks in existing projects, this thesis proposes an approach for automatically generating benchmarks from existing suites of unit tests, and presents a prototype implementation of the approach called JUnitto- JMH, capable of generating JMH benchmarks from existing JUnit 4 unit tests. The prototype was evaluated on the unit test suite of a real-world open source Java project as well as on a set of specially crafted workloads. The prototype was found to be able to produce compiling benchmarks for all of the study subject’s JUnit tests, of which 98.86% were able to run without executiontime errors, taking just under 30 seconds on average to produce the full suite of 11363 benchmarks. The generated benchmarks were found to produce more stable performance measurements compared to timing measurements obtained from executing the original unit tests. Generated benchmarks were also found to be able to detect performance differences between specially crafted workloads of different size, albeit less effectively than hand-written JMH benchmarks.","abstract_has_math":false,"creators":["ALEXANDERSSON, NICLAS"],"institution":null,"degree_name":null,"degree_level":"H","degree_discipline":null,"degree_department":"Chalmers tekniska högskola / Institutionen för data och informationsteknik","school":null,"contributors":[],"advisors":["Leitner, Philipp"],"committee_chairs":[],"committee_members":["Hebig, Regina"],"year":2022,"date_issued":"2022","date_published":"2022","updated_at":"2026-11-19T03:02:23Z","subjects":["JMH","performance regression testing","microbenchmarking","benchmark generation"],"languages":["eng"],"rights":[],"rights_urls":[],"identifier_entries":[{"key":"dc:identifier.coursecode","label":"Dc Identifier Coursecode","values":["DATX05"],"render_values":[{"text":"DATX05","href":null,"code":true}]}],"person_identifier_entries":[]},"links":{"outbound_url":"https://hdl.handle.net/20.500.12380/305702","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"https://hdl.handle.net/20.500.12380/305702","record_label":"Repository record","record_kind":"handle","record_source":"dc:identifier.uri","access_status":null,"embargo_until":null,"access_note":null},"oai_pmh_record":{"url":"https://union.ndltd.org/oai-pmh/?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai%3Aunion.ndltd.org%3Arepo%3Achalmers%3Aoai%3Aodr.chalmers.se%3A20.500.12380%2F305702","prefix":"oai_dc"},"source_record":{"url":"https://odr.chalmers.se/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Aodr.chalmers.se%3A20.500.12380%2F305702","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.committeemember","label":"Committee Member","values":["Hebig, Regina"]},{"key":"dc:contributor.department","label":"Department","values":["Chalmers tekniska högskola / Institutionen för data och informationsteknik"]},{"key":"dc:contributor.supervisor","label":"Supervisor","values":["Leitner, Philipp"]},{"key":"dc:creator","label":"Author","values":["ALEXANDERSSON, NICLAS"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2022-10-10T05:16:34Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2022-10-10T05:16:34Z"]},{"key":"dc:date.issued","label":"Date","values":["2022"]},{"key":"dc:date.submitted","label":"Dc Date Submitted","values":["2020"]},{"key":"dc:type.degree","label":"Dc Type Degree","values":["Examensarbete för masterexamen"]},{"key":"thesis:degree_level","label":"Degree Level","values":["H"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["JMH","performance regression testing","microbenchmarking","benchmark generation"]},{"key":"dc:subject.uppsok","label":"Dc Subject Uppsok","values":["Technology"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language.iso","label":"Language (ISO)","values":["eng"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.coursecode","label":"Dc Identifier Coursecode","values":["DATX05"]},{"key":"dc:identifier.uri","label":"Identifier URI","values":["https://hdl.handle.net/20.500.12380/305702"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["Software microbenchmarks have been proposed as a tool that could be used for performance regression testing, similarly to how unit tests are used for functional regression testing. However, studies on open-source Java projects have shown that unlike unit tests, suites of good microbenchmarks that could be used for performance regression testing are absent from most projects. To address this lack of usable microbenchmarks in existing projects, this thesis proposes an approach for automatically generating benchmarks from existing suites of unit tests, and presents a prototype implementation of the approach called JUnitto- JMH, capable of generating JMH benchmarks from existing JUnit 4 unit tests. The prototype was evaluated on the unit test suite of a real-world open source Java project as well as on a set of specially crafted workloads. The prototype was found to be able to produce compiling benchmarks for all of the study subject’s JUnit tests, of which 98.86% were able to run without executiontime errors, taking just under 30 seconds on average to produce the full suite of 11363 benchmarks. The generated benchmarks were found to produce more stable performance measurements compared to timing measurements obtained from executing the original unit tests. Generated benchmarks were also found to be able to detect performance differences between specially crafted workloads of different size, albeit less effectively than hand-written JMH benchmarks."]},{"key":"dc:title","label":"Title","values":["JUnit-to-JMH: Automatic Generation of Performance Benchmarks from Existing Unit Tests in Java"]},{"key":"others:access_status","label":"Others Access Status","values":["metadata.only"]}]}],"canonical_facts":{"dc:contributor.committeemember":["Hebig, Regina"],"dc:contributor.department":["Chalmers tekniska högskola / Institutionen för data och informationsteknik"],"dc:contributor.supervisor":["Leitner, Philipp"],"dc:creator":["ALEXANDERSSON, NICLAS"],"dc:date.accessioned":["2022-10-10T05:16:34Z"],"dc:date.available":["2022-10-10T05:16:34Z"],"dc:date.issued":["2022"],"dc:date.submitted":["2020"],"dc:description.abstract":["Software microbenchmarks have been proposed as a tool that could be used for performance regression testing, similarly to how unit tests are used for functional regression testing. However, studies on open-source Java projects have shown that unlike unit tests, suites of good microbenchmarks that could be used for performance regression testing are absent from most projects. To address this lack of usable microbenchmarks in existing projects, this thesis proposes an approach for automatically generating benchmarks from existing suites of unit tests, and presents a prototype implementation of the approach called JUnitto- JMH, capable of generating JMH benchmarks from existing JUnit 4 unit tests. The prototype was evaluated on the unit test suite of a real-world open source Java project as well as on a set of specially crafted workloads. The prototype was found to be able to produce compiling benchmarks for all of the study subject’s JUnit tests, of which 98.86% were able to run without executiontime errors, taking just under 30 seconds on average to produce the full suite of 11363 benchmarks. The generated benchmarks were found to produce more stable performance measurements compared to timing measurements obtained from executing the original unit tests. Generated benchmarks were also found to be able to detect performance differences between specially crafted workloads of different size, albeit less effectively than hand-written JMH benchmarks."],"dc:identifier.coursecode":["DATX05"],"dc:identifier.uri":["https://hdl.handle.net/20.500.12380/305702"],"dc:language.iso":["eng"],"dc:subject":["JMH","performance regression testing","microbenchmarking","benchmark generation"],"dc:subject.uppsok":["Technology"],"dc:title":["JUnit-to-JMH: Automatic Generation of Performance Benchmarks from Existing Unit Tests in Java"],"dc:type.degree":["Examensarbete för masterexamen"],"others:access_status":["metadata.only"],"thesis:degree_level":["H"]},"updated_at":"2026-11-19T03:02:23Z"}