test suite for java classes

90 views
Skip to first unread message

Simon Vocella

unread,
Sep 24, 2016, 1:23:39 PM9/24/16
to Clojure Dev
Hi everyone,

I am Simon and I am a developer!
I did some projects in Clojure and I studied a lot testing, software design and I really think that Clojure is a good work.

I am interested in contributing in the project and I read http://dev.clojure.org/display/community/Developing+Patches.

I watched the project https://github.com/clojure/clojure and I see that many classes in https://github.com/clojure/clojure/tree/master/src/jvm/clojure are not tested or maybe are tested indirectly in clojure.

Do you find useful if I write some tests in junit for these classes? Or it will only be a pain because the project guideline is to test in clojure as much as possible?

Thanks for your time,
Simon

Alex Miller

unread,
Sep 25, 2016, 2:13:43 PM9/25/16
to cloju...@googlegroups.com
Hi Simon,

It's unlikely we'd take a contribution like this for Clojure. We prefer to start from problems, consider alternatives, and work towards a solution. 

Alex


--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-dev+unsubscribe@googlegroups.com.
To post to this group, send email to cloju...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojure-dev.
For more options, visit https://groups.google.com/d/optout.

Simon Vocella

unread,
Sep 26, 2016, 4:11:31 PM9/26/16
to Clojure Dev
Hi Alex,

thanks for your answer.

I see many complex logic in some java classes, don't you have many issues because it's not directly tested?
In the history of Clojure do you have few regression or bug for these classes? I am really interested to understand, I want to be proactive, not be critic.

My idea is to take one of these classes, try to test properly with unit and do some refactoring to achieve a better design, that should give a high confidence when someone will introduce a new change.

Simon

Il giorno domenica 25 settembre 2016 20:13:43 UTC+2, Alex Miller ha scritto:
Hi Simon,

It's unlikely we'd take a contribution like this for Clojure. We prefer to start from problems, consider alternatives, and work towards a solution. 

Alex
On Sat, Sep 24, 2016 at 11:08 AM, Simon Vocella <vox...@gmail.com> wrote:
Hi everyone,

I am Simon and I am a developer!
I did some projects in Clojure and I studied a lot testing, software design and I really think that Clojure is a good work.

I am interested in contributing in the project and I read http://dev.clojure.org/display/community/Developing+Patches.

I watched the project https://github.com/clojure/clojure and I see that many classes in https://github.com/clojure/clojure/tree/master/src/jvm/clojure are not tested or maybe are tested indirectly in clojure.

Do you find useful if I write some tests in junit for these classes? Or it will only be a pain because the project guideline is to test in clojure as much as possible?

Thanks for your time,
Simon

--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-dev...@googlegroups.com.

Alex Miller

unread,
Sep 26, 2016, 4:50:04 PM9/26/16
to cloju...@googlegroups.com
Most of the logic in those classes is tested via Clojure-based tests in the test suite, often via generative tests that create 1000s of test examples. Feel free to check out the bug tracker (http://dev.clojure.org/jira/browse/CLJ) or changelog (https://github.com/clojure/clojure/blob/master/changes.md) for possible areas more likely to see issues. 

We're not interested in refactoring or changes just for the sake of changing things. Regarding JUnit, we don't have (or want) JUnit-based tests in the test suite. We prefer generative tests with test.check (or check-based spec tests) and secondarily example-based tests with clojure.test. 

I think it would be a great exercise to pick a piece of core Clojure functionality and write generative tests for it, particularly if it's something not already covered. Adding robust generative tests is something worth considering. Note that there are generative tests written using both test.generative (generally older ones) and test.check (newer ones) in the suite and I would strongly prefer the latter at this point.

I guess one caveat is that any new generative tests should also consider leveraging the new clojure.spec.check functionality for checking functions, which implies the existence of specs for core functions, which is something in progress but not yet released. So... that part might be a little tricky right now.

Of course, if you write tests however and discover a problem, that's certainly something we'd want to know about. :)
 



To unsubscribe from this group and stop receiving emails from it, send an email to clojure-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages