Yes, but if we want to improve line-level test coverage, we do need to make our code more testable, i.e. add more uts
On 2024/08/07 07:08:34 Christofer Dutz wrote: > I should clarify, > This is the coverage from within the module itself. We definitely have more > coverage when also running the integration test module, however none of the > parts I recently touched seem to have had any form of tests. > > Chris > > Gesendet von Outlook für Android<https://aka.ms/AAb9ysg> > ________________________________ > From: Xinyu Tan <tanxi...@apache.org> > Sent: Monday, August 5, 2024 11:43:24 AM > To: dev@iotdb.apache.org <dev@iotdb.apache.org> > Subject: Re: [DISCUSS] Refactoring IoTDB to eliminate the singleton pattern > > 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 > > >