Fork me on GitHub
#ldnclj
<
2015-11-24
>
agile_geek08:11:00

Discussion of the day: I like the idea of property based and generative testing but as most of my work involves manipulating data in to different shapes rather than calculating anything I’m unconvinced that it helps me that much. What are other ppl’s thoughts on good use cases for generative and/or property based testing?

agile_geek08:11:07

P.S. I have an ulterior motive as I’m thinking of putting together a presentation on the subject for the FP North East user group.

maleghast09:11:20

Morning (for you) @agile_geek simple_smile I can see your dilemma - honestly it’s an area of testing that I’ve never really gotten into either, so I am a little lacking in opinions, but I am interested in what others may bring...

mccraigmccraig10:11:19

@agile_geek: can't different shape combinations also be generated ? i.e. can you not used generative testing to find shapes which trigger buggy paths through your code ?

maleghast10:11:28

raises eyebrow @mccraigmccraig: That sounds like an interesting possibility that had not even occurred to me

mccraigmccraig10:11:47

@maleghast: disclaimer - ianagtu (i am not a generative test user) - so i may be talking through my hat

maleghast10:11:35

Fair point, but it’s an interesting idea

agile_geek10:11:27

@mccraigmccraig: I’m sure they can but I’m not sure I see how.

agile_geek10:11:31

You can definitely use generators to create data structures with random strings, numbers etc. in the shape you require.

agile_geek10:11:30

I guess the bit I struggle with is what to assert. Other than an expected schema…and I have schema for that.

tcrayford10:11:53

@agile_geek: Yeller uses test.check extensively

mccraigmccraig10:11:57

@agile_geek: presumably you would want to generate input shapes to your transformation, and then schema-check the outputs ?

tcrayford10:11:25

I can't imagine using example based tests for that much these days :/

agile_geek10:11:02

@tcrayford: Is your code base open source?

tcrayford10:11:15

Commercial product ;)

agile_geek10:11:03

@tcrayford: I wonder if you’d mind sharing an example? Feel free to simplify or obfuscate.

agile_geek10:11:45

@tcrayford: cool. I’ll check them out when I get chance.

agile_geek10:11:10

@tcrayford: BTW are you coming to ClojureX?

tcrayford10:11:29

Yeller has a very high level test which throws a set of generated messages at the system, then checks the count of messages after loading them all is correct.

tcrayford10:11:42

Sadly I don't think I can make ClojureX this year

agile_geek10:11:36

Shame. I wouldn’t have minded a chat over coffee about this.

tcrayford10:11:41

That test has caught a bunch of "aww shit I dropped messages somehow" way before hitting production

tcrayford10:11:47

Yeah, me too :/

tcrayford10:11:09

It really does depend on your domain though

tcrayford10:11:26

I'd highly recommend John Hughes talk from Clojure West

agile_geek10:11:27

@tcrayford: nice example. Food for thought

agile_geek10:11:38

I’ll check that out too

tcrayford10:11:42

Other classic things: serialization round tripping is the easiest and most obvious thing

tcrayford10:11:04

Given that most systems use JSON or Transit or something like that to communicate with clients

tcrayford10:11:33

Generate values, serialize them then deserialize them, assert that the deserialized value is the same as the original one

tcrayford10:11:56

For Yeller, literally everything I put in storage or send or receive over the wire has a serialization roundtrip test

pupeno12:11:39

Good morning.

jamiei14:11:21

Which puts Clojure in the "Losing steam on SO" graph.

jamiei14:11:01

I wonder if October last year was particularly busy for questions, or if there is a general trend to be looked it in Clojure

mccraigmccraig15:11:38

@jamiei: it's very difficult to interpret that chart, i.e. what can be inferred from "losing steam"... off the top of my head splitting of topics (e.g. [clojure] -> [clojure,clojurescript]), release of new versions and consequent issue spikes may affect the numbers greatly

jamiei15:11:21

"it's important to note that tags losing steam on Stack Overflow is not necessarily indicative of people losing interest. It might just be that the questions regarding smaller topic areas get saturated and there are no more questions that need to be asked."

jamiei15:11:29

or split as you say

agile_geek15:11:24

Also how much does this very forum reduce the number of stack overflow questions?

agile_geek15:11:52

I don’t ask on Stack Overflow any more … I ask here. Usually of the library authors directly!

agile_geek15:11:41

Another interesting measurement to take would be how much time I spend being distracted by this Slack team instead of doing work in JavaLand for my client….or perhaps I better not look under that rock!

jamiei15:11:00

You were joking, right? You are actually still online simple_smile

jamiei15:11:29

Apparently not..

agile_geek17:11:51

@jamiei: I am but I am trying to focus on what I’m paid to do for a change! 😉

korny19:11:25

just checking, anyone here going to the clojure dojo @ TW tonight? We had a number of people accept, but very few arrive...

korny19:11:44

there’s a big talk happening in the other half of the office, suspect some folks might have gotten lost