Hi, Chris I am shocked to see our class coverage and line coverage so low.
I support making changes to our use of singletons to identify more issues in unit tests, reducing the likelihood of problems surfacing in integration tests, release testing, or even user environments. In the future, I also advocate prioritizing unit tests over integration tests when testing certain functionalities. My suggestion is to adopt a test-driven approach. We should first define some quantifiable and observable metrics, and then continuously refactor the singleton pattern while improving these metrics. This approach seems more sustainable. Best ------------- Xinyu Tan On 2024/08/02 11:59:34 Christofer Dutz wrote: > Hi all, > > So, one thing that has always been bothering me a bit with respect to the > IoTDB code-base, was the usage of the singleton pattern. > Even if it simplifies composition of a project, it comes with quite some > severe disadvantages. > > In my last PR I tried refactoring the usage of singletons to make components > more unit-testable and I was quite happy with the results. > > I wrote up my ideas as well as some facts from fellow Apache projects. > > https://timechor.feishu.cn/docx/QLgZdJWgUoKBLSx1t3EcBJdRnud > > Please have a look and comment here. I would really like to start the > progress of refactoring IoTDB (At least with this approach it doesn’t have to > be an all-or-nothing big-bang type of refactoring, but instead can happen > over time). > > Chris >