Tests around Pharo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

Tests around Pharo

mschepens

As students of Master 2 IAGL from Lille 1 university (France), four of us are asked to develop some tests around an open-source project. Among proposed projects, we decided to contribute to Pharo.

We'll have to develop 15-20tests (isolated/automated/reproducible/quick/good code coverage), and we are wanting them to be as much useful as possible for developers.

Where (in the project) could it be useful to develop some tests ? Do you have advices/instructions for us in order to develop them ?


We are new with Pharo and Smalltalk, and are having about 8-10hours available per developer.


Best regards,

Mathieu Schepens

Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

HilaireFernandes
Based on Pharo, you may also consider developing tests for Dr.Geo[1][2].
It is an interactive geometry framework for Pharo and it comes with a
complete API, helpful to write tests. There is already a test package
ready to be completed.

Thanks

Hilaire

[1] http://drgeo.eu
[2] http://smalltalkhub.com/#!/~HilaireFernandes/DrGeo


Le 10/09/2014 15:40, Mathieu Schepens a écrit :

> As students of Master 2 IAGL from Lille 1 university (France), four of
> us are asked to develop some tests around an open-source project. Among
> proposed projects, we decided to contribute to Pharo.
>
> We'll have to develop 15-20tests
> (isolated/automated/reproducible/quick/good code coverage), and we are
> wanting them to be as much useful as possible for developers.
>
> Where (in the project) could it be useful to develop some tests ? Do you
> have advices/instructions for us in order to develop them ?
>
>


--
Dr. Geo - http://drgeo.eu
iStoa - http://istao.drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

SergeStinckwich
In reply to this post by mschepens
On Wed, Sep 10, 2014 at 3:40 PM, Mathieu Schepens
<[hidden email]> wrote:
> As students of Master 2 IAGL from Lille 1 university (France), four of us
> are asked to develop some tests around an open-source project. Among
> proposed projects, we decided to contribute to Pharo.

Welcome in the Pharo dev community !
I know the guy who ask you to do that ;-)

Feel free to ask us if you have any questions.


> We'll have to develop 15-20tests (isolated/automated/reproducible/quick/good
> code coverage), and we are wanting them to be as much useful as possible for
> developers.
>
> Where (in the project) could it be useful to develop some tests ? Do you
> have advices/instructions for us in order to develop them ?

If you are interested in maths, you can have a look to SciSmalltalk :
https://github.com/SergeStinckwich/SciSmalltalk
a mathematical library for Smalltalk. We have already more than 400
tests but we are looking for more.

Regards,
--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/

Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

Ben Coman
In reply to this post by mschepens
Mathieu Schepens wrote:

>
> As students of Master 2 IAGL from Lille 1 university (France), four of
> us are asked to develop some tests around an open-source project.
> Among proposed projects, we decided to contribute to Pharo.
>
> We'll have to develop 15-20tests
> (isolated/automated/reproducible/quick/good code coverage), and we are
> wanting them to be as much useful as possible for developers.
>
> Where (in the project) could it be useful to develop some tests ? Do
> you have advices/instructions for us in order to develop them ?
>
>
> We are new with Pharo and Smalltalk, and are having about 8-10hours
> available per developer.
>
>
> Best regards,
>
> Mathieu Schepens
>

Thanks for your consideration of Pharo.  Now we should properly
understand your time constraints.  So...
* What is your experience with Pharo?
* How comfortable are you with the syntax, Browser and Debugger?
* Have you used the TestRunner previously?
* Have you submitted a code Slice for integration before?

In a lot of areas, a lot of background knowledge is required to writing
useful tests, which you obviously can't gain in your allocated time.  
However every additional test increasing coverage is useful. However
even more use than these individual tests is that you have a good
experience with Pharo, to hopefully see you back here later are this
course requirement is done.  (Careful, Pharo is addictive).  So to be
pragmatic, I suggest a good starting point is a widely understood domain
like strings.  I'll give you an example of how to discover some coverage
gaps yourself.

FINDING GAPS
1. Open World menu > Tools > Finder
2. From its pulldown menu which says "Selectors" choose "Examples"
3. Now imagine some kind of string function you are familiar with...
What are the parameters and what is the result?  For example, imagine a
function to might give you the first N characters of a String.  For two
parameters 'abcd' and 2, the result would be 'ab'.  Now in the text box
on the left side, type those three items separated by a dot.  For
example...    'abcd' . 2 . 'ab'
4. Press the <Search> button, and you will see three results. Using
"contractTo:"  as an example, navigate to view its code. In that code
select the text "contractTo:", right-click and choose "Extended
search... > senders of it".  The list that comes up shows a class on the
left and on the right the method that calls "contractTo".   Now you will
notice that none of the classes include the name "Test". Ah-Haaa!! A gap
to fill :)

DEFINING TESTS
1. Open Spotlight in the top right by pressing CMD-SPACE (on a Mac,
other platforms have a different key modifier)
2. Enter... StringTest
which should open a Browser on the StringTest class
3. Just for practice, click on the little circle next to the method
names to run that test method. Right-click on the test and choose
"Debug" to step through the test.
4. Review the other existing tests and replicate for you own tests for
methods found that have a gap in coverage.

SUBMISSION AND INTEGRATION
Once you have your new tests working you should get a login to the Pharo
issue tracker at   http://pharo.fogbugz.com   create a ticket, and
submit a "Slice" with your changes for review and integration. (btw,
right now I am heading off to bed so others will follow up further
questions).

good luck, cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

mschepens
First of all, thank you for your answers, your precious advices and for having taken time to answer us.
Answers to Ben Coman :
It's our first experience with Pharo, but we'll take more time to learn this project if it's necessary.
We're a little comfortable with the tool, we already took the time to discover it, to do the first tutorial which is proposed when pharo is launched, and to develop first classes and tests for learning about pharo.
We never used the TestRunner previously, we just ran our tests for our classes yesterday.
We never submitted a code Slice for Intergration before.

We're still waiting propositions of Test or code to cover, and again thank you for your attention.
Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

Ben Coman
mschepens wrote:

> First of all, thank you for your answers, your precious advices and for
> having taken time to answer us.
> Answers to Ben Coman :
> It's our first experience with Pharo, but we'll take more time to learn this
> project if it's necessary.
> We're a little comfortable with the tool, we already took the time to
> discover it, to do the first tutorial which is proposed when pharo is
> launched, and to develop first classes and tests for learning about pharo.
> We never used the TestRunner previously, we just ran our tests for our
> classes yesterday.
> We never submitted a code Slice for Intergration before.
>
> We're still waiting propositions of Test or code to cover, and again thank
> you for your attention.
>
>  

So there was the "contractTo:" example that I provided.  This provides a
simple end-to-end practice example for getting "some" code integrated
into Pharo. Try that first.

Now perhaps no one has a "list" missing tests. Either new tests get
written together with new system code, or just when people bump into
problems.  Open source is about scratching your own itch, and learning
how to discover gaps is nearly as important a skill as filling them.  
Did you try my recipe to find gaps?  Report what you found, then it is
less of a burden for all to review and advise on those, than for us to
do this task for you.

Now an alternative recipe to find gaps is in the Browser, scroll down to
Collections-** and for various classes look in the "testing" protocol of
the third pane, then right-click of various methods and choose "Senders
of..." to see if it is sent from a test method.  btw, it is just
co-incidence the protocol is called "testing".  This is the general
protocol for method that return a "true or false" result.  I'd chose
this to start with since it should be simpler to work out what each
method does from looking at its Senders, and how to write a test for it,
than other infrastructure methods.

Now you may find it useful to review....
http://www.catb.org/esr/faqs/smart-questions.html

Good luck with it, and I feel free to ask more questions.
cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

mschepens
Hello,

We opened some issues on fogbugz (14220, 14221 and 14222) and created slices from our pharo images.
Can anyone confirm us that these slices are automatically sent when they are created under a pharo image ?

Again thanks to all of you for your advices and your time !
We're still available if there is any comment around our tests.
Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

EstebanLM
Hi,

first, thanks for your contributions :)
but no, they are not automatically committed, you have to do it manually (by saving the slice into the corresponding inbox, currently the Pharo40Inbox).
then you need to move the issue to “fix review needed” in the issue tracker.

cheers,
Esteban

> On 13 Oct 2014, at 11:44, mschepens <[hidden email]> wrote:
>
> Hello,
>
> We opened some issues on fogbugz (14220, 14221 and 14222) and created slices
> from our pharo images.
> Can anyone confirm us that these slices are automatically sent when they are
> created under a pharo image ?
>
> Again thanks to all of you for your advices and your time !
> We're still available if there is any comment around our tests.
>
>
>
> --
> View this message in context: http://forum.world.st/Tests-around-Pharo-tp4777295p4784279.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

Ben Coman
mschepens, Your list of tests looks like a useful enhancement.  I notice
your three issues are tagged milestone=Pharo3.0,  but that milestone has
past.  As policy Pharo 3 now only gets bug fixes, not enhancements (even
nice ones like tests, which we love).

Your work will be integrated into Pharo-4-alpha, where current
development is focused.  To upload to the Pharo 4 inbox, sign up for an
account at http://smalltalkhub.com, then...

* If you have a Pharo 3 image, add the repository as described on this
page...
http://smalltalkhub.com/#!/~Pharo/Pharo40Inbox
but including your SmalltalkHub user and password to allow you to upload.

* If you have a Pharo 4 image, you will already have the Pharo40Inbox
repository listed, but you may need to edit its definition to add your
user and password.

You may already have saved the Slice to you local "package cache"
repository.  You should be able to browse that repository and then
<Copy> it to the Pharo40Inbox. Report on each issue once that is done.
At the same time, as Esteban said, <Resolve> your issue to status "Fix
Review Needed", at which point the CI monkey will auto test your slice
against the latest Pharo 4.

Once the CI report is clean, and hopefully some human reviews it, then
for now it is a manual step by the integrators to push it into the Image.

Now I assume you will want to close the loop to review the Image that
integrates your tests, so you might want to install PharoLauncher which
helps you manage which multiple Images.
See http://www.smalltalkhub.com/#!/~Pharo/PharoLauncher.

regards -ben

Esteban Lorenzano wrote:

> Hi,
>
> first, thanks for your contributions :)
> but no, they are not automatically committed, you have to do it manually (by saving the slice into the corresponding inbox, currently the Pharo40Inbox).
> then you need to move the issue to “fix review needed” in the issue tracker.
>
> cheers,
> Esteban
>
>> On 13 Oct 2014, at 11:44, mschepens <[hidden email]> wrote:
>>
>> Hello,
>>
>> We opened some issues on fogbugz (14220, 14221 and 14222) and created slices
>> from our pharo images.
>> Can anyone confirm us that these slices are automatically sent when they are
>> created under a pharo image ?
>>
>> Again thanks to all of you for your advices and your time !
>> We're still available if there is any comment around our tests.
>>
>>
>>
>> --
>> View this message in context: http://forum.world.st/Tests-around-Pharo-tp4777295p4784279.html
>> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>>
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

stepharo
In reply to this post by mschepens
Why don;t you work with hilaire.
Hilaire said:

     Based on Pharo, you may also consider developing tests for
Dr.Geo[1][2]. It is an interactive geometry framework for Pharo and it
comes with a complete API, helpful to write tests. There is already a
test package ready to be completed.

     Thanks

     Hilaire

     [1] http://drgeo.eu
     [2] http://smalltalkhub.com/#!/~HilaireFernandes/DrGeo


So load the code and go



On 11/9/14 20:57, mschepens wrote:

> First of all, thank you for your answers, your precious advices and for
> having taken time to answer us.
> Answers to Ben Coman :
> It's our first experience with Pharo, but we'll take more time to learn this
> project if it's necessary.
> We're a little comfortable with the tool, we already took the time to
> discover it, to do the first tutorial which is proposed when pharo is
> launched, and to develop first classes and tests for learning about pharo.
> We never used the TestRunner previously, we just ran our tests for our
> classes yesterday.
> We never submitted a code Slice for Intergration before.
>
> We're still waiting propositions of Test or code to cover, and again thank
> you for your attention.
>
>
>
>
> --
> View this message in context: http://forum.world.st/Tests-around-Pharo-tp4777295p4777496.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

stepharo
In reply to this post by mschepens
You should sign the license agreements else we will not accept your code.
You can print sign and give to damien the printed version:
http://files.pharo.org/media/PharoSoftwareDistributionAgreement.pdf

And yes this is part of the exercise: understanding how a community works.


Stef

On 13/10/14 11:44, mschepens wrote:

> Hello,
>
> We opened some issues on fogbugz (14220, 14221 and 14222) and created slices
> from our pharo images.
> Can anyone confirm us that these slices are automatically sent when they are
> created under a pharo image ?
>
> Again thanks to all of you for your advices and your time !
> We're still available if there is any comment around our tests.
>
>
>
> --
> View this message in context: http://forum.world.st/Tests-around-Pharo-tp4777295p4784279.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

mschepens
Well thank you again for your advices.
We'll do operations for slices around 11-12 o'clock.

For tests that Hilaire proposed (Dr Geo), we met some pharo committers during events in our university, and they suggested us to work mainly around collections, so we decided to focus to Collections part during the development time we had.

About the license agreements I didn't see it anywhere, I will print it and send it to Damien this evening.

Once our code will be accepted, we'll close the loop by reviewing the image integrating it.
Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

mschepens
After numerous tries, it was impossible for us to access to smaltalkhub from our university at 11 o'clock, we'll try this evening or next days from our personal connections.
Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

camille teruel

On 15 oct. 2014, at 12:35, mschepens <[hidden email]> wrote:

> After numerous tries, it was impossible for us to access to smaltalkhub from
> our university at 11 o'clock, we'll try this evening or next days from our
> personal connections.
>

Hi Mathieu,

I teach at M5 this friday morning, so I can come to IAGL room around 12h15 to show you directly if you want.
Tell me.

Camille

>
>
> --
> View this message in context: http://forum.world.st/Tests-around-Pharo-tp4777295p4784680.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

demarey

Le 15 oct. 2014 à 13:01, Camille Teruel a écrit :

>
> On 15 oct. 2014, at 12:35, mschepens <[hidden email]> wrote:
>
>> After numerous tries, it was impossible for us to access to smaltalkhub from
>> our university at 11 o'clock, we'll try this evening or next days from our
>> personal connections.
>>
>
> Hi Mathieu,
>
> I teach at M5 this friday morning, so I can come to IAGL room around 12h15 to show you directly if you want.
> Tell me.
It is just because University blocks all traffic.
They need to use an http proxy. I don't know if it is doable from a Pharo image.

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

Sven Van Caekenberghe-2

On 15 Oct 2014, at 13:52, Christophe Demarey <[hidden email]> wrote:

>
> Le 15 oct. 2014 à 13:01, Camille Teruel a écrit :
>
>>
>> On 15 oct. 2014, at 12:35, mschepens <[hidden email]> wrote:
>>
>>> After numerous tries, it was impossible for us to access to smaltalkhub from
>>> our university at 11 o'clock, we'll try this evening or next days from our
>>> personal connections.
>>>
>>
>> Hi Mathieu,
>>
>> I teach at M5 this friday morning, so I can come to IAGL room around 12h15 to show you directly if you want.
>> Tell me.
>
> It is just because University blocks all traffic.
> They need to use an http proxy. I don't know if it is doable from a Pharo image.

Sure, it is doable/available/working:

  System > Settings > Network > Use HTTP proxy...

But HTTP Proxies, especially weird or badly configured ones, are a known PITA.
Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

S Krish

Using cntlm Proxy is an option in the cases where normal HTTP Proxy does not work right


On Wed, Oct 15, 2014 at 5:26 PM, Sven Van Caekenberghe <[hidden email]> wrote:

On 15 Oct 2014, at 13:52, Christophe Demarey <[hidden email]> wrote:

>
> Le 15 oct. 2014 à 13:01, Camille Teruel a écrit :
>
>>
>> On 15 oct. 2014, at 12:35, mschepens <[hidden email]> wrote:
>>
>>> After numerous tries, it was impossible for us to access to smaltalkhub from
>>> our university at 11 o'clock, we'll try this evening or next days from our
>>> personal connections.
>>>
>>
>> Hi Mathieu,
>>
>> I teach at M5 this friday morning, so I can come to IAGL room around 12h15 to show you directly if you want.
>> Tell me.
>
> It is just because University blocks all traffic.
> They need to use an http proxy. I don't know if it is doable from a Pharo image.

Sure, it is doable/available/working:

  System > Settings > Network > Use HTTP proxy...

But HTTP Proxies, especially weird or badly configured ones, are a known PITA.

Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

mschepens
I finally managed the proxy problem by sending commits from my own web connection.
So I put the issues to "Fix review needed". I had some problems while importing Collections-Tests (Native part, for the FloatArrayTest) but finally managed it too.

I sent to Damien Cassou the "license agreements" filled and signed, I will give him my copy of this paper next wednesday.

Hope our tests will be helpful and will increase test coverage of pharo, it was really interesting for us to work on this project, and we acquired significant knowledges (about smalltalk but about opensource projects too).
We'll follow our commits evolution, and again thanks to all of you for the time you gave us !
Reply | Threaded
Open this post in threaded view
|

Re: Tests around Pharo

Ben Coman
mschepens wrote:

> I finally managed the proxy problem by sending commits from my own web
> connection.
> So I put the issues to "Fix review needed". I had some problems while
> importing Collections-Tests (Native part, for the FloatArrayTest) but
> finally managed it too.
>
> I sent to Damien Cassou the "license agreements" filled and signed, I will
> give him my copy of this paper next wednesday.
>
> Hope our tests will be helpful and will increase test coverage of pharo,

Yes. They certainly will. Its the accumulation of small improvements
that make a system great.

> it was really interesting for us to work on this project, and we acquired
> significant knowledges (about smalltalk but about opensource projects too).

It rubs both ways.  I had never noticed PharoUser before, and I learnt
something new from reviewing your contribution. Opensource is as much
learning from other people's code, as it is building a pool of good
software.

> We'll follow our commits evolution,

The CI monkey spotted a few quality assurance items.  I lead you through
fixing them for issue 14222.  Could you have a go at that for your three
issues?

> and again thanks to all of you for the time you gave us !

You are welcome.  It can be a bit daunting breaking in, but like
everything, the more you do, the easier it gets.  Hope to see you back
again when you use Pharo to implement your next idea to take over the
world! :)

cheers -ben

>
>
>
> --
> View this message in context: http://forum.world.st/Tests-around-Pharo-tp4777295p4784793.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>
>