{"action":"created","issue":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/3431","repository_url":"https://api.github.com/repos/IQSS/dataverse","labels_url":"https://api.github.com/repos/IQSS/dataverse/issues/3431/labels{/name}","comments_url":"https://api.github.com/repos/IQSS/dataverse/issues/3431/comments","events_url":"https://api.github.com/repos/IQSS/dataverse/issues/3431/events","html_url":"https://github.com/IQSS/dataverse/issues/3431","id":185399568,"number":3431,"title":"Set expectations in Developer Guide for testing and document tools (Jacoco, Coveralls, REST Assured)","user":{"login":"pdurbin","id":21006,"avatar_url":"https://avatars.githubusercontent.com/u/21006?v=3","gravatar_id":"","url":"https://api.github.com/users/pdurbin","html_url":"https://github.com/pdurbin","followers_url":"https://api.github.com/users/pdurbin/followers","following_url":"https://api.github.com/users/pdurbin/following{/other_user}","gists_url":"https://api.github.com/users/pdurbin/gists{/gist_id}","starred_url":"https://api.github.com/users/pdurbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdurbin/subscriptions","organizations_url":"https://api.github.com/users/pdurbin/orgs","repos_url":"https://api.github.com/users/pdurbin/repos","events_url":"https://api.github.com/users/pdurbin/events{/privacy}","received_events_url":"https://api.github.com/users/pdurbin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Component:%20Code%20Infrastructure","name":"Component: Code Infrastructure","color":"c7def8"},{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Component:%20Documentation","name":"Component: Documentation","color":"c7def8"},{"url":"https://api.github.com/repos/IQSS/dataverse/labels/low-hanging-fruit","name":"low-hanging-fruit","color":"ffffff"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-26T13:51:50Z","updated_at":"2016-10-26T15:53:58Z","closed_at":null,"body":"I've learned a lot about JUnit and code coverage since I wrote http://guides.dataverse.org/en/4.5.1/developers/testing.html and on that page I don't even mention https://coveralls.io/github/IQSS/dataverse which I set up as part of #775.\r\n\r\nInternally I sent this around in August 2015:\r\n\r\nTo see the code coverage report (screenshot attached) from Netbeans, you can do the following:\r\n\r\n- right click the \"dataverse\" project\r\n- click Code Coverage\r\n- click Show Report\r\n\r\n![screen shot 2015-08-12 at 11 20 31 am](https://cloud.githubusercontent.com/assets/21006/19728264/bf0ed474-9b60-11e6-95a6-6e43d3d1b1de.png)\r\n\r\nThe screenshot I didn't send around but probably should have is this red vs. green view on a per-file basis that shows you which lines aren't even being touched by tests:\r\n\r\n![screen shot 2016-10-26 at 9 50 44 am](https://cloud.githubusercontent.com/assets/21006/19728522/b0f91f38-9b61-11e6-9704-ddd9840472f6.png)\r\n\r\nI find this invaluable when trying to figure out where to focus my testing efforts.\r\n\r\nIf you aren't using Netbeans, you can just open your equivalent of file:///Users/pdurbin/NetBeansProjects/dataverse/target/site/jacoco/index.html and see something like this:\r\n\r\n![dataverse_-_2016-10-26_09 46 32](https://cloud.githubusercontent.com/assets/21006/19728378/21993d14-9b61-11e6-8a69-61ab651e14fc.png)\r\n\r\n(I don't believe I'm doing anything special to create that \"index.html\" file but if other developers don't have it locally, please let me know!)\r\n\r\nOn that \"testing\" page I also plan to include this quote from Martin Fowler about how a healthy code base allows you to go faster:\r\n\r\n> \"This is an economic judgment. Several times, many times, I run into teams that say something like, “Oh well. Management isn’t allowing us to do a quality job here because it will slow us down. And we’ve appealed to management and said we need to put more quality in the code, but they’ve said no, we need to go faster instead.” And my comment to that is well, as soon as you’re framing it in terms of code quality versus speed, you’ve lost. Because the whole point of refactoring is to go faster.\r\n> \r\n> And this is why I quite like playing a bit more with the metaphor as the health of a codebase. If you keep yourself healthy then you’ll be able to run faster. But if you just say, “Well, I want to run a lot so I’m therefore going to run a whole load all the time and not eat properly and not pay attention about this shooting pain going up my leg,” then you’re not going to be able to run quickly very long. You have to pay attention to your health. And same with the codebase. You have to continuously say, “How do we keep it in a healthy state? Then we can go fast,” because we’re running marathons here with codebases. And if we neglect that internal quality of the codebase, it hits you surprisingly fast.\"\r\n\r\nhttp://devchat.tv/ruby-rogues/178-rr-book-club-refactoring-ruby-with-martin-fowler\r\n\r\nThis issue closely relates to the larger issue and goal of better automated testing at #2746 but it's a simple doc change to explain how to use these tools."},"comment":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/comments/256393118","html_url":"https://github.com/IQSS/dataverse/issues/3431#issuecomment-256393118","issue_url":"https://api.github.com/repos/IQSS/dataverse/issues/3431","id":256393118,"user":{"login":"pdurbin","id":21006,"avatar_url":"https://avatars.githubusercontent.com/u/21006?v=3","gravatar_id":"","url":"https://api.github.com/users/pdurbin","html_url":"https://github.com/pdurbin","followers_url":"https://api.github.com/users/pdurbin/followers","following_url":"https://api.github.com/users/pdurbin/following{/other_user}","gists_url":"https://api.github.com/users/pdurbin/gists{/gist_id}","starred_url":"https://api.github.com/users/pdurbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdurbin/subscriptions","organizations_url":"https://api.github.com/users/pdurbin/orgs","repos_url":"https://api.github.com/users/pdurbin/repos","events_url":"https://api.github.com/users/pdurbin/events{/privacy}","received_events_url":"https://api.github.com/users/pdurbin/received_events","type":"User","site_admin":false},"created_at":"2016-10-26T15:53:57Z","updated_at":"2016-10-26T15:53:57Z","body":"@michbarsinai thanks! I'm thinking we should take https://github.com/IQSS/dataverse/blob/develop/doc/theTestableCommand/TheTestableCommand.md and convert it from .md to .rst and have it be part of http://guides.dataverse.org/en/latest/developers/testing.html . Does that sound ok? I wrote a lot of testable commands for Private URL but we should see if you and I are on the same page. Code review is very welcome! Here are the classes:\r\n\r\n- https://github.com/IQSS/dataverse/blob/v4.5.1/src/test/java/edu/harvard/iq/dataverse/engine/command/impl/CreatePrivateUrlCommandTest.java\r\n- https://github.com/IQSS/dataverse/blob/v4.5.1/src/test/java/edu/harvard/iq/dataverse/engine/command/impl/DeletePrivateUrlCommandTest.java\r\n- https://github.com/IQSS/dataverse/blob/v4.5.1/src/test/java/edu/harvard/iq/dataverse/engine/command/impl/GetPrivateUrlCommandTest.java"}}
{"actor":{"display_login":"pdurbin"}}