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

Improve ERC721 tests #1148

Closed
nventuro opened this issue Aug 2, 2018 · 10 comments
Closed

Improve ERC721 tests #1148

nventuro opened this issue Aug 2, 2018 · 10 comments
Labels
good first issue Low hanging fruit for new contributors to get involved! tests Test suite and helpers.

Comments

@nventuro
Copy link
Contributor

nventuro commented Aug 2, 2018

The account names refactor (#1137) didn't cover ERC721 because the whole suite is somewhat problematic: there are multiple references to accounts with weird names (e.g. creator, sender, etc), inconsistent naming, among others. We should take a look at these four files and polish them a bit so that they are more in-line with the rest of the suite. While there's no testing guide yet (#1077), some test suites can be used as a reference point, like ERC20 and Escrow.

@nventuro nventuro added kind:improvement tests Test suite and helpers. labels Aug 2, 2018
@nventuro nventuro added this to the v2.0 milestone Aug 2, 2018
@exemplarov exemplarov mentioned this issue Aug 11, 2018
4 tasks
@frangio frangio modified the milestones: v2.0, v2.1 Aug 29, 2018
@come-maiz
Copy link
Contributor

As mentioned in #1256 by @nventuro , we should also have a specific test block for getApproved

@frangio frangio modified the milestones: Test helpers, v2.2 Dec 5, 2018
@frangio frangio removed this from the v2.2 milestone Jan 9, 2019
@nventuro nventuro added good first issue Low hanging fruit for new contributors to get involved! and removed improvement labels Apr 8, 2019
@logeekal
Copy link
Contributor

logeekal commented Jul 5, 2019

This seems to be an old issue. If it is still open I can pick this up. I am currently setting up the project, will report back with findings.

Edit:
@nventuro , Okay so i went through the source and test files and observed that tests are pretty exhaustive.
Could you please give introductory pointers on what needs to be done in terms of improving the test case?

In the related bug #1137 , you point our that ERC721 tests are mess. IF you can give more detail on what needs to be improved, it will be helpful.

@nventuro
Copy link
Contributor Author

nventuro commented Jul 5, 2019

Hey @logeekal, thanks for volunteering for this!

I haven't looked at these tests in quite some time, but like you said, they are correct, and have 100% line coverage. The issues that I recall with them come from a maintainability/readability point of view, as mentioned in one of the comments:

there are multiple references to accounts with weird names (e.g. creator, sender, etc), inconsistent naming, among others

That said, it is very possible that I was being too harsh when evaluating these tests 😅 So don't sweat it if you don't find anything other than these naming issues I mentioned.

@logeekal
Copy link
Contributor

logeekal commented Jul 8, 2019

Thanks @nventuro for your revert, I will get back to you after looking at the code again. Also as @ElOpio has pointed above about missing getApproved test, I will add that as well.

Cheers.

@frangio
Copy link
Contributor

frangio commented Jul 8, 2019

@logeekal Cool! Feel free to suggest improvements if you think of anything else. 🙂

@logeekal
Copy link
Contributor

@logeekal Cool! Feel free to suggest improvements if you think of anything else. 🙂

Sure @frangio . I am thinking of doing this fix in 2 parts.

  1. I have added missing tests for getApproved function
  2. I will go through the naming of the variables(creator, sender, etc) and will suggest some changes as per the original reason for opening the issue.

For the first one, I will be opening the pull request soon. You can let me know if it is not the correct way.

Thanks.

@logeekal
Copy link
Contributor

logeekal commented Jul 19, 2019

@frangio & @nventuro ,
Regarding the naming consistency in ERC721 tests. I went through the complete test suite and below are my observations :

image

I did not see any code in ERC721 test suite using accounts[] format, so we are good on that front.

On the left most column, I give my suggestions but those are very minor changes, please let me know what you guys think and if I should go ahead with these changes.

@nventuro
Copy link
Contributor Author

Niiice, I didn't expect a full-fledged spreadsheet 😅 Your suggestions look good, please go ahead!

@logeekal
Copy link
Contributor

logeekal commented Aug 18, 2019

@nventuro , @frangio , Raised above pull request (#1891 ) for renaming variables. Please let me know if anything else is left on this bug.

@nventuro
Copy link
Contributor Author

Closed via #1820 and #1891.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Low hanging fruit for new contributors to get involved! tests Test suite and helpers.
Projects
None yet
Development

No branches or pull requests

4 participants