Session

Friends don't let friends test with In-Memory databases

If you have ever written code that tests database interactions, such as data access objects, you very possibly have run up against one of the most perennial annoyances in testing: In order to accurately test these interactions, a database is required.

In-memory databases, shared databases instances or testing in production-like environments are common approaches but all of them have drawbacks: inaccuracy, can't run in parallel or money\\

On top of that:
My company supports 3 database vendors (and versions): MySQL, Oracle and SQL Server
My company supports SQL Scripts for database creation and upgrades
My company supports Liquibase for database creation and upgrades
Multiple combinations to test, how do we test all that?

TestContainers to the rescue!
Testcontainers is a (Java) library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.

Testcontainers make the following kinds of tests easier:

Data access layer integration tests: use a containerized instance of a MySQL, PostgreSQL or Oracle database to test your data access layer code for complete compatibility, but without requiring complex setup on developers' machines and safe in the knowledge that your tests will always start with a known DB state. Any other database type that can be containerized can also be used.

During the presentation, we will see how we can save time and money during the validation of the data layer against multiple databases, how to easily add new versions or new vendors and validate them with no code changes, or write new tests, and even how to produce database documentation in an automated way.
We will show a sneak peek of what TestContainers's SaaS solution, Atomic Jar (Docker) offers to move our testing to the cloud.

Regards

Andrés Torres García

Andrés Torres García CTO @Kalyp Techologies

Avilés, Spain

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top