Test Driven Design Best Practices

In this post, we are going to talk about some best practices on TDD in Java application development. Particularly, some misunderstandings about TDD will be discussed too in this article.

What should a test code be like?

Test application using Database

It is a very common question that if DAO layers or Repositories should be tested when we are writing unit test.

Unit test should

How to test DAO or Repositories

There are three ways to simplify the process of testing DAO layers, which are

  • Connecting to database in dev environment and rollback after all is done (not recommended)
  • Using docker containers, recover the container after each time of testing
  • Using memory databases such as h2
Author

Brimon

Posted on

2022-10-01

Updated on

2022-10-01

Licensed under

Comments