Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor AD code to improve testability #518

Closed
Zhangxunmt opened this issue Apr 22, 2022 · 3 comments
Closed

Refactor AD code to improve testability #518

Zhangxunmt opened this issue Apr 22, 2022 · 3 comments
Labels
bug Something isn't working Priority-Medium

Comments

@Zhangxunmt
Copy link
Contributor

This is related to the test issues discussed in #424 and #493 . AD still has a long list of classes that could not meet the test coverage bar.

One dominate reason for lacking tests coverage is that some classes in AD have super long and complicated functions which are difficult to be tested. To resolve this problem, we need to refactor those untested classes and decouple the complexities into smaller sub-functions.

After the first scan of the Jacoco test exclusive list, the following classes needs refactor before adding more unit tests.

DeleteAnomalyDetectorTransportAction
SearchAnomalyResultTransportAction
AnomalyResultBulkIndexHandler
ADTaskManager
ADBatchTaskRunner
AnomalyDetectorRunner
AnomalyDetectorJobRunner
ModelValidationActionHandler
ModelValidationActionHandler
RestStatsAnomalyDetectorAction
RestValidateAnomalyDetectorAction
RestIndexAnomalyDetectorAction

@Zhangxunmt Zhangxunmt added bug Something isn't working untriaged Priority-Medium and removed untriaged labels Apr 22, 2022
@Zhangxunmt
Copy link
Contributor Author

One example for refactoring #517

@ohltyler
Copy link
Member

@Zhangxunmt would you consider this resolved or is there more files needed to refactor?

@Zhangxunmt Zhangxunmt removed the v2.2.0 label Aug 10, 2022
@Zhangxunmt
Copy link
Contributor Author

It's partially done. Only a few are removed from the jacoco exclusion list. We can close this issue and track the same in this one #424.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority-Medium
Projects
None yet
Development

No branches or pull requests

3 participants