Time
S
Nick
Message
02:01
axfelix joined #dataverse
02:02
metamattj joined #dataverse
02:56
axfelix joined #dataverse
03:13
garnett joined #dataverse
04:08
LyndsySimon_ joined #dataverse
04:10
mjturk_ joined #dataverse
04:36
axfelix joined #dataverse
04:44
garnett joined #dataverse
05:28
garnett joined #dataverse
06:42
axfelix joined #dataverse
06:58
melbatoast joined #dataverse
08:56
bencomp joined #dataverse
14:47
kur1j joined #dataverse
16:07
metamattj joined #dataverse
16:20
axfelix joined #dataverse
17:34
balo joined #dataverse
17:48
metamattj joined #dataverse
19:51
metamattj joined #dataverse
19:55
metamattj joined #dataverse
20:41
michbarsinai joined #dataverse
20:41
michbarsinai
@pdurbin, you there?
20:56
pdurbin
michbarsinai: for half an hour :)
20:57
pdurbin
what can I do for you?
21:04
shauna joined #dataverse
21:09
garnett joined #dataverse
21:12
michbarsinai
:)
21:12
michbarsinai
Was wondering about the code coverage metric... how much makes sense for Dataverse?
21:12
michbarsinai
I mean, DataTags is a library (mostly), and it's at 43%.
21:13
pdurbin
excellent question
21:13
michbarsinai
But these are the 43% that matter (parsers, models).
21:13
pdurbin
I can't see how we'll ever reach 100% for Dataverse.
21:13
michbarsinai
It's actually bad practice to unit test tostring(), right?
21:13
pdurbin
and I wonder if the tool (jacoco) could/should be informed to skip parts of the code
21:14
michbarsinai
Should, I guess.
21:14
pdurbin
all the backing beans on JSF pages... I don't know how I'd even write unit tests for those
21:14
michbarsinai
Really, not all lines are equal
21:14
michbarsinai
coverage misses that
21:14
pdurbin
unit testable stuff in backing beans should probably be moved anyway. business logic stuff. commands
21:15
pdurbin
should be the same for api and jsf
21:15
pdurbin
that's what our talk was about :)
21:15
michbarsinai
true. Commands should be well tested
21:15
pdurbin
and right now they aren't :(
21:16
pdurbin
anyway, I think we can do better than...
21:16
* pdurbin
looks at https://coveralls.io/github/IQSS/dataverse?branch=master
21:16
pdurbin
4.54% code coverage
21:16
michbarsinai
yep. Not trivial, though.
21:16
michbarsinai
That's too low, for sure
21:17
pdurbin
yeah
21:17
pdurbin
michbarsinai: can I show you the tests I'm working on for ddi export?
21:17
michbarsinai
sure!
21:18
pdurbin
cool. there are multiple levels of unit tests
21:19
michbarsinai
ok..
21:19
pdurbin
here's the main one to look at: https://github.com/IQSS/dataverse/blob/9b04e1af00520f0442d8ca5bf1bbfc150e046665/src/test/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtilTest.java
21:19
pdurbin
the idea is that you start with JSON output from a dataset
21:20
pdurbin
they you run it through the DdiExportUtil.datasetDtoAsJson2ddi method
21:20
pdurbin
out comes some XML (DDI format)
21:20
pdurbin
and you compare against expected XML
21:20
pdurbin
the reason I like this so much is that you don't have to have glassfish or postgres running
21:21
michbarsinai
(can't copy-paste from the terminal, need to reformat :-P
21:21
michbarsinai
...
21:21
pdurbin
hmm?
21:22
pdurbin
michbarsinai: do you see what I mean? no dependencies on glassfish or postgres. it's a unit test
21:22
michbarsinai
I copied the text, but it included the user list on the right.
21:22
michbarsinai
looking at the code now
21:23
pdurbin
michbarsinai: try running the tests! should "just work" :)
21:24
michbarsinai
right. I'm installing NB 8.1, so I'm at the browser now :-)
21:24
pdurbin
oh oh
21:24
* pdurbin
wonders if 8.1 final is out
21:24
michbarsinai
hot off the press
21:24
pdurbin
nice, so it is: https://netbeans.org
21:25
michbarsinai
DDI noob question: that's a standard, right?
21:25
pdurbin
yeah
21:26
pdurbin
http://www.ddialliance.org/Specification/DDI-Codebook/2.5/
21:26
michbarsinai
So the XMLs can be taken as literals
21:27
michbarsinai
wait, no. There's whitespace... is there an easy way to compare XML DOM trees?
21:27
pdurbin
I run the XML through a pretty printer
21:30
michbarsinai
cool
21:32
michbarsinai
Nice tests. How are the json and xml files created?
21:32
pdurbin
manually
21:33
pdurbin
oh and I'm testing that the XML validates according to the DDI schema: https://github.com/IQSS/dataverse/blob/3660398b2fac6b1e8c0a6f26e0c9fd66e5dadf2c/src/test/java/edu/harvard/iq/dataverse/util/xml/XmlValidatorTest.java
21:33
pdurbin
BUT
21:34
pdurbin
I haven't been able to validate DDI 2.5 yet... we're still on DDI 2.0
21:34
pdurbin
anyway
21:34
pdurbin
I'm thinking about how to better test things. I guess that's the point. :)
21:35
pdurbin
michbarsinai: but if you can help us figure out how to test commands it would be awesome
21:35
pdurbin
or test anything really
21:35
michbarsinai
This one is a bit hard... ideally, you'd create the dataset and then create the json from it
21:35
pdurbin
help get our code coverage numbers up
21:36
pdurbin
right. that's what I mean about how I create the json manually
21:36
pdurbin
you create a dataset and then download its json
21:36
michbarsinai
right. If I get that correctly, the json should not be created at all as a file
21:36
pdurbin
it that possible?
21:36
pdurbin
when you create a dataset it gets persisted to the database
21:36
pdurbin
you need postgres running
21:37
pdurbin
sounds more like an integration test
21:37
michbarsinai
you should be able (*should*) to create a dataset object, fill the fields
21:37
michbarsinai
then hand it over to the JSON pronter
21:37
michbarsinai
printer
21:38
pdurbin
should :)
21:38
michbarsinai
However, maybe the code is split in a non-testible way.
21:38
pdurbin
yeah, that's what I'm worried about
21:38
pdurbin
I find the code a bit hard to test in general.
21:38
michbarsinai
That
21:38
pdurbin
but new code I'm trying to make testable
21:38
michbarsinai
That's JSF, I think
21:39
pdurbin
yeah
21:39
michbarsinai
Testibility should be a priority for 4.3, I guess.
21:40
michbarsinai
Back you your test, though, suppose you refactir what's needed to get the json created on the fly
21:40
michbarsinai
Where do you get teh XML from?
21:40
michbarsinai
*the
21:41
michbarsinai
I think it might be OK to use a static XML file here, since that's working against a standard
21:41
pdurbin
the first XML was from Leonid's stub. now I need to make it real DDI
21:41
pdurbin
but not right now. gotta go pick up the kids from school
21:41
pdurbin
the art critics ;)
21:42
michbarsinai
Triceratops, aye?
21:43
michbarsinai
Sy Hi to the guys there :-)
21:49
michbarsinai
\part
22:01
axfelix joined #dataverse
22:41
garnett joined #dataverse