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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

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
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

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Architecture and Code Design, Pt. 2: Polyglot Persistence Insights To Use Today and in the Upcoming Years
  • Architecture and Code Design, Pt. 1: Relational Persistence Insights to Use Today and On the Upcoming Years
  • The Cypress Edge: Next-Level Testing Strategies for React Developers
  • NoSQL for Relational Minds

Trending

  • DZone's Article Submission Guidelines
  • How to Submit a Post to DZone
  • Enforcing Architecture With ArchUnit in Java
  • Tired of Spring Overhead? Try Dropwizard for Your Next Java Microservice
  1. DZone
  2. Data Engineering
  3. Data
  4. The Power of Data-Driven Testing: A Deep Dive into Jakarta Persistence Specifications and NoSQL

The Power of Data-Driven Testing: A Deep Dive into Jakarta Persistence Specifications and NoSQL

Transforming legacy code with Jakarta Persistence: Data-driven testing, modern libraries, and tools enhance quality and efficiency.

By 
Otavio Santana user avatar
Otavio Santana
DZone Core CORE ·
Dec. 01, 23 · Presentation
Likes (2)
Comment
Save
Tweet
Share
3.1K Views

Join the DZone community and get the full member experience.

Join For Free

Software development is an ever-changing field. In this landscape, achieving high-quality code is crucial. However, initial challenges arise due to legacy code, undefined development practices, and numerous proofs of concepts. This article explores the transformative journey of testing modernization using Jakarta Persistence Specifications (Jakarta Data and Jakarta NoSQL) and open-source tools. We’ll focus on six crucial steps to enhance software quality, utilizing the power of data-driven testing.

The Initial Challenge: Legacy Code and Undefined Practices

The project’s starting point involved dealing with legacy code from various companies dating back to 2017. The need for testing modernization was evident, with no defined development practices and several proofs of concepts surrounding the project. The project contributors faced the challenge of establishing a cohesive testing strategy and improving code quality.

Testing Modernization in Six Steps

The six steps of testing modernization

The six steps of testing modernization

1. Testing Guidelines

Establishing a set of testing guidelines was the foundational step. A Testing Guide, available on GitHub, was created. This guide encapsulated best practices, naming conventions, specific test creation approaches, and coverage extension through mutation testing. These guidelines provided a standardized approach for all project contributors, ensuring consistency and coherence in testing practices.

2. Modern Testing Library

Migration to modern testing libraries was crucial for keeping up with the latest industry standards. The project transitioned to JUnit 5, specifically JUnit Jupiter, leveraging its advanced features to enhance code coverage and documentation. This move empowered developers to adopt contemporary testing practices and improve the overall quality of the codebase.

3. Data-Driven Approach

The adoption of a data-driven testing approach proved to be a game-changer. By leveraging Jakarta Persistence Specifications, developers could explore data exploration techniques, increasing code coverage and reducing code maintainability challenges. This data-driven approach allowed for more thorough testing, uncovering potential issues that might go unnoticed in traditional testing methods.

4. Extensive Assertions

Libraries like AssertJ played a pivotal role in enhancing validation processes. Including a wide range of assertions, including soft assertion approaches, making it easier for developers to validate their code effectively. AssertJ empowered developers to express their test assertions more readably and fluently, contributing to improved test quality.

5. Coverage Extension

The project integrated PiTest, a mutation testing system, to ensure comprehensive test coverage. PiTest identified issues that traditional tests might overlook by mutating the code and analyzing its impact. This approach provided gold-standard test coverage for Java and the JVM, contributing to a more robust and resilient codebase.

6. Container for Testing

Given the significance of database and data integration specifications, the project embraced TestContainers. This library facilitated the creation of lightweight APIs for bootstrapping integration tests using Docker containers. TestContainers simplified the process of setting up accurate services for testing, ensuring reliable and reproducible test environments.

Takeaways

  1. Guidelines are essential: Establishing and adhering to testing guidelines is crucial for maintaining consistency and coherence across a project. It sets the foundation for a robust testing strategy.
  2. Modernization is efficient: Testing modernization need not be time-consuming. Tools like Openrewrite can significantly ease the transition, allowing developers to embrace modern testing practices swiftly.
  3. Proper tools enhance efficiency: Leveraging modern testing libraries, extensive assertions, coverage extension tools, and containerization significantly enhances the speed and assertiveness of the testing process.
  4. Partial reliance on tools: While tools are valuable, developers should also bring expertise. Partial reliance on tools and human insight results in better coverage and higher code quality.

In conclusion, the power of data-driven testing, coupled with the Jakarta Persistence Specifications and NoSQL technologies, has proven to be a potent force in achieving exceptional code quality. The journey from legacy code and undefined practices to a well-defined, modern testing strategy showcases the transformative impact of embracing cutting-edge tools and methodologies. As the software development landscape evolves, staying abreast of the latest technologies and testing practices is essential for building robust and resilient software systems.

  • Slides
NoSQL Data (computing) Persistence (computer science) Testing

Opinions expressed by DZone contributors are their own.

Related

  • Architecture and Code Design, Pt. 2: Polyglot Persistence Insights To Use Today and in the Upcoming Years
  • Architecture and Code Design, Pt. 1: Relational Persistence Insights to Use Today and On the Upcoming Years
  • The Cypress Edge: Next-Level Testing Strategies for React Developers
  • NoSQL for Relational Minds

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!