Skip to content

Improve incomingDiagConnection interfacing#383

Open
guillaumeaub-ctw wants to merge 6 commits intoeclipse-openbsw:mainfrom
guillaumeaub-ctw:main
Open

Improve incomingDiagConnection interfacing#383
guillaumeaub-ctw wants to merge 6 commits intoeclipse-openbsw:mainfrom
guillaumeaub-ctw:main

Conversation

@guillaumeaub-ctw
Copy link

No description provided.

…endency to uds, which caused all of uds's dependencies being included in the udsMock. This was a problem for other modules which wanted to use the udsMock.

Make udsMock only depend on the interface of uds.
…ctly resolved if the destructor is not explicitely defined
@rolandreichweinbmw rolandreichweinbmw changed the title Improve incomingDiagConnection interfacing within openBsw Improve incomingDiagConnection interfacing Mar 10, 2026
Copy link
Contributor

@christian-schilling christian-schilling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm currently working on a big refactoring of UDS and as part of that refactoring aim to remove the use of interfaces, virtual and mocks as much as possible. This change is in direct conflict with those goals.
What is the underlying need/problem you are trying to address? I'm sure we can find a better solution.

@guillaumeaub-ctw
Copy link
Author

guillaumeaub-ctw commented Mar 11, 2026

Hi @christian-schilling,

The goal of this POC is to make JOB implementation and later UDS independent of transport. At least the parts that users need to integrate.

Here is our problem :

  • UDS is globally not dissociated from transport library which is hardware dependent.
  • When an openBSW user is integrating new jobs, he would like to unit test them in an isolated environment.
    Actually it is not possible because IncomingDiagConnection is depending on transport depending on hardware related libraries.

So, I was trying to see how we could decouple a maximum Uds from transport by introducing an interface that could be mocked. Using that PR we could limit the dependencies of our jobs uts to :

  • etl
  • uds config : libs/bsw/uds/test/mock/include/uds/
  • async : libs/bsw/async/mock/gmock/src/async/
  • We still had to create a manual mock for transport as the PR is not finished

How could we unit test our code if you remove mocks and interfaces ?

@christian-schilling
Copy link
Contributor

Thanks @guillaumeaub-ctw for the clarification.
So the problem is not really IncomingDiagConnection or the dependency on UDS itself, but rather the fact that it drags transport and lower level dependencies with it.
So the solution I have in mind it breaking up the IncomingDiagConnection class entirely into smaller parts so that for job testing only the relevant parts need to be used.

@guillaumeaub-ctw
Copy link
Author

Good morning @christian-schilling,

Do you have a PR I can look at so I can see the direction it will take and how we should adapt ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants