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

Implement simpleComparison() and create load tests for issue #119 and #174 #220

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

Hannnnnnn404
Copy link
Contributor

PR Details

  • Provide another kind of pattern simpleComparison(), which makes it faster than compareImages().
  • Creare load tests to see if simpleComparison() method is faster.

Description

  • Implement a method called simpleComparison(), which makes it faster to compare images without drawing rectangles.
  • Add isFirstDifference() method to judge the first different pixel of two images.
  • Create load tests to verify time differences between simpleComparison() and compareImages().

Related Issue

Motivation and Context

The change is aim to users who don't want to know what differences of compare images. Some users only need to know that if two images are different or not. This simpleComparison pattern can makes it faster for users to get result quickly.

How Has This Been Tested

  • Add a new test file called LoadTest.java, in which I designed some load test to test speed differernces.
  • Verify the simpleComparison() feature to make sure it could run normally. Check out the compare result ComparisonState.
  • For some image instances, calculate running time of simpleComparison() and compareImages() method. simpleComparison() should be faster than compareImages().

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Hannnnnnn404 Hannnnnnn404 changed the title Implement simpleComparison() and create load tests Implement simpleComparison() and create load tests for issue#119 and #174 Apr 19, 2022
@Hannnnnnn404 Hannnnnnn404 changed the title Implement simpleComparison() and create load tests for issue#119 and #174 Implement simpleComparison() and create load tests for issue #119 and #174 Apr 19, 2022
@Test
@DisplayName("compare load differences between {@link simpleComparison} method and {@link compareImage} method")
public void loadTest2(){
//load images to be compared:
Copy link
Owner

Choose a reason for hiding this comment

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

Please, follow general way for creating tests with BDD blocks:
//given
//when
//then

Copy link
Contributor Author

@Hannnnnnn404 Hannnnnnn404 Apr 21, 2022

Choose a reason for hiding this comment

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

Do you mean that I should code tests following the BDD style? I‘m trying to modified my tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please, follow general way for creating tests with BDD blocks: //given //when //then
Do you mean that I should code tests following the BDD style? And my logic of load tests is right.

@Hannnnnnn404 Hannnnnnn404 requested a review from romankh3 March 3, 2023 00:29
@romankh3 romankh3 merged commit 97af3fc into romankh3:master Jun 17, 2024
2 checks passed
@romankh3
Copy link
Owner

thanks for your contribution

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