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

[NEW EXAMPLE] ErrorProne - Test Helper #2

Closed
ainzzorl opened this issue Jul 9, 2021 · 3 comments
Closed

[NEW EXAMPLE] ErrorProne - Test Helper #2

ainzzorl opened this issue Jul 9, 2021 · 3 comments
Labels
new example New example proposal

Comments

@ainzzorl
Copy link
Owner

ainzzorl commented Jul 9, 2021

General

Description

Error Prone is a static analysis tool for Java that catches common programming mistakes at compile-time. It's comprised of hundreds of mostly independent bug checkers.

They employ a clever test helper to streamline testing these checkers, in a DSL-like fashion.

Links

What makes it interesting

  • Taken from a popular, mature project, maintained by a major tech company.
  • Example of testing things that are non-trivial to test.
  • DSL-like API.
  • Quite common pattern among any tools that do code analysis - see below.

Other

Many related products - linters, bug checkers, etc. - implement very similar patterns.

E.g. SonarQube's CheckVerifier, Rubocop's ExpectOffence.

@ainzzorl ainzzorl added the new example New example proposal label Jul 9, 2021
@ainzzorl
Copy link
Owner Author

Before publishing:

  • Tags: maybe "test-helper"?
  • Backticks and links for class names.
  • Forgot to include doTest?

@ainzzorl
Copy link
Owner Author

Updated and set to PUBLISHED.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new example New example proposal
Projects
None yet
Development

No branches or pull requests

1 participant