Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
November 2010
- 115 participants
- 1614 messages
Re: [Pharo-project] rename a method programatically
by Cyrille Delaunay
Ok, thank you :)
2010/11/24 Mariano Martinez Peck <marianopeck(a)gmail.com>
>
>
> On Wed, Nov 24, 2010 at 9:44 AM, Tudor Girba <tudor.girba(a)gmail.com>wrote:
>
>> I was also referring to a programatic solution :). Perhaps the name is
>> misleading, but RB is not the UI. RB is primarily the engine behind that
>> contains the logic of performing a refactoring.
>>
>>
> Exactlly. The UI can be OB-Refactory, or Gaucho, or just programatic.
>
>
>> Doru
>>
>> On 24 Nov 2010, at 09:17, Cyrille Delaunay wrote:
>>
>> > Indeed, in my case I would like to do that wihtout using UI. I want to
>> write a test in which I rename a method and see if the events emited have
>> been well-catched by RPackage.
>> >
>> > 2010/11/24 Igor Stasenko <siguctua(a)gmail.com>
>> > On 24 November 2010 02:00, Tudor Girba <tudor.girba(a)gmail.com> wrote:
>> > > Well, as long as you want to perform a refactoring I believe that RB
>> provides the API in question.
>> > >
>> > Yes, of course. But question was 'how to do that programmatically' ,
>> > not using browser or other UI.
>> >
>> > > Doru
>> > >
>> > >
>> > > On 24 Nov 2010, at 00:52, Igor Stasenko wrote:
>> > >
>> > >> On 24 November 2010 01:43, Tudor Girba <tudor.girba(a)gmail.com>
>> wrote:
>> > >>> Definitely use the RB for any code transformations.
>> > >>>
>> > >>
>> > >> I don't think it's a good option for meta-programming.
>> > >> For meta-programming, basic interface in Behavior or ClassDescription
>> > >> should be enough for manipulating
>> > >> with methods, without dependency from RB.
>> > >> Actually, RB then can use same API for manipulations.
>> > >>
>> > >>> Cheers,
>> > >>> Doru
>> > >>>
>> > >>>
>> > >>> On 23 Nov 2010, at 19:01, Mariano Martinez Peck wrote:
>> > >>>
>> > >>>> Cyrille I don't know why you need that but take into account that
>> RB split their packages even more in the last months. So maybe it is easier
>> for you to directly use RB and load with your code, the RB core or the
>> specific package that you need. Mostly if you need some other similar
>> functionalities.
>> > >>>>
>> > >>>> Cheers
>> > >>>>
>> > >>>> Mariano
>> > >>>>
>> > >>>> On Tue, Nov 23, 2010 at 6:56 PM, jaayer <jaayer(a)zoho.com> wrote:
>> > >>>>
>> > >>>>
>> > >>>>
>> > >>>>
>> > >>>> ---- On Tue, 23 Nov 2010 05:17:05 -0800 Cyrille Delaunay wrote
>> ----
>> > >>>>
>> > >>>>> Hello,
>> > >>>>>
>> > >>>>> I would like to know how I can rename a method programatically and
>> safelly (without missing to raise any event that has to be raised)
>> > >>>>>
>> > >>>>
>> > >>>> I don't believe there is any simple way to do this.
>> > >>>>
>> > >>>> Basically, to rename a method you have to remove it first and
>> compile into its class a new method containing the same source code but with
>> a different selector at the beginning. This is how the refactory browser
>> does it when you select "rename" from the "refactor method" menu. If anyone
>> knows of a better way, I would be interested to hear it.
>> > >>>>
>> > >>>>
>> > >>>>
>> > >>>
>> > >>> --
>> > >>> www.tudorgirba.com
>> > >>>
>> > >>> "To lead is not to demand things, it is to make them happen."
>> > >>>
>> > >>>
>> > >>>
>> > >>>
>> > >>>
>> > >>
>> > >>
>> > >>
>> > >> --
>> > >> Best regards,
>> > >> Igor Stasenko AKA sig.
>> > >>
>> > >
>> > > --
>> > > www.tudorgirba.com
>> > >
>> > > "Not knowing how to do something is not an argument for how it cannot
>> be done."
>> > >
>> > >
>> > >
>> >
>> >
>> >
>> > --
>> > Best regards,
>> > Igor Stasenko AKA sig.
>> >
>> >
>>
>> --
>> www.tudorgirba.com
>>
>> "Problem solving efficiency grows with the abstractness level of problem
>> understanding."
>>
>>
>>
>>
>>
>
Nov. 24, 2010
Re: [Pharo-project] rename a method programatically
by Mariano Martinez Peck
On Wed, Nov 24, 2010 at 9:44 AM, Tudor Girba <tudor.girba(a)gmail.com> wrote:
> I was also referring to a programatic solution :). Perhaps the name is
> misleading, but RB is not the UI. RB is primarily the engine behind that
> contains the logic of performing a refactoring.
>
>
Exactlly. The UI can be OB-Refactory, or Gaucho, or just programatic.
> Doru
>
> On 24 Nov 2010, at 09:17, Cyrille Delaunay wrote:
>
> > Indeed, in my case I would like to do that wihtout using UI. I want to
> write a test in which I rename a method and see if the events emited have
> been well-catched by RPackage.
> >
> > 2010/11/24 Igor Stasenko <siguctua(a)gmail.com>
> > On 24 November 2010 02:00, Tudor Girba <tudor.girba(a)gmail.com> wrote:
> > > Well, as long as you want to perform a refactoring I believe that RB
> provides the API in question.
> > >
> > Yes, of course. But question was 'how to do that programmatically' ,
> > not using browser or other UI.
> >
> > > Doru
> > >
> > >
> > > On 24 Nov 2010, at 00:52, Igor Stasenko wrote:
> > >
> > >> On 24 November 2010 01:43, Tudor Girba <tudor.girba(a)gmail.com> wrote:
> > >>> Definitely use the RB for any code transformations.
> > >>>
> > >>
> > >> I don't think it's a good option for meta-programming.
> > >> For meta-programming, basic interface in Behavior or ClassDescription
> > >> should be enough for manipulating
> > >> with methods, without dependency from RB.
> > >> Actually, RB then can use same API for manipulations.
> > >>
> > >>> Cheers,
> > >>> Doru
> > >>>
> > >>>
> > >>> On 23 Nov 2010, at 19:01, Mariano Martinez Peck wrote:
> > >>>
> > >>>> Cyrille I don't know why you need that but take into account that RB
> split their packages even more in the last months. So maybe it is easier for
> you to directly use RB and load with your code, the RB core or the specific
> package that you need. Mostly if you need some other similar
> functionalities.
> > >>>>
> > >>>> Cheers
> > >>>>
> > >>>> Mariano
> > >>>>
> > >>>> On Tue, Nov 23, 2010 at 6:56 PM, jaayer <jaayer(a)zoho.com> wrote:
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>> ---- On Tue, 23 Nov 2010 05:17:05 -0800 Cyrille Delaunay wrote ----
> > >>>>
> > >>>>> Hello,
> > >>>>>
> > >>>>> I would like to know how I can rename a method programatically and
> safelly (without missing to raise any event that has to be raised)
> > >>>>>
> > >>>>
> > >>>> I don't believe there is any simple way to do this.
> > >>>>
> > >>>> Basically, to rename a method you have to remove it first and
> compile into its class a new method containing the same source code but with
> a different selector at the beginning. This is how the refactory browser
> does it when you select "rename" from the "refactor method" menu. If anyone
> knows of a better way, I would be interested to hear it.
> > >>>>
> > >>>>
> > >>>>
> > >>>
> > >>> --
> > >>> www.tudorgirba.com
> > >>>
> > >>> "To lead is not to demand things, it is to make them happen."
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > >>
> > >>
> > >> --
> > >> Best regards,
> > >> Igor Stasenko AKA sig.
> > >>
> > >
> > > --
> > > www.tudorgirba.com
> > >
> > > "Not knowing how to do something is not an argument for how it cannot
> be done."
> > >
> > >
> > >
> >
> >
> >
> > --
> > Best regards,
> > Igor Stasenko AKA sig.
> >
> >
>
> --
> www.tudorgirba.com
>
> "Problem solving efficiency grows with the abstractness level of problem
> understanding."
>
>
>
>
>
Nov. 24, 2010
Re: [Pharo-project] rename a method programatically
by Tudor Girba
I was also referring to a programatic solution :). Perhaps the name is misleading, but RB is not the UI. RB is primarily the engine behind that contains the logic of performing a refactoring.
Doru
On 24 Nov 2010, at 09:17, Cyrille Delaunay wrote:
> Indeed, in my case I would like to do that wihtout using UI. I want to write a test in which I rename a method and see if the events emited have been well-catched by RPackage.
>
> 2010/11/24 Igor Stasenko <siguctua(a)gmail.com>
> On 24 November 2010 02:00, Tudor Girba <tudor.girba(a)gmail.com> wrote:
> > Well, as long as you want to perform a refactoring I believe that RB provides the API in question.
> >
> Yes, of course. But question was 'how to do that programmatically' ,
> not using browser or other UI.
>
> > Doru
> >
> >
> > On 24 Nov 2010, at 00:52, Igor Stasenko wrote:
> >
> >> On 24 November 2010 01:43, Tudor Girba <tudor.girba(a)gmail.com> wrote:
> >>> Definitely use the RB for any code transformations.
> >>>
> >>
> >> I don't think it's a good option for meta-programming.
> >> For meta-programming, basic interface in Behavior or ClassDescription
> >> should be enough for manipulating
> >> with methods, without dependency from RB.
> >> Actually, RB then can use same API for manipulations.
> >>
> >>> Cheers,
> >>> Doru
> >>>
> >>>
> >>> On 23 Nov 2010, at 19:01, Mariano Martinez Peck wrote:
> >>>
> >>>> Cyrille I don't know why you need that but take into account that RB split their packages even more in the last months. So maybe it is easier for you to directly use RB and load with your code, the RB core or the specific package that you need. Mostly if you need some other similar functionalities.
> >>>>
> >>>> Cheers
> >>>>
> >>>> Mariano
> >>>>
> >>>> On Tue, Nov 23, 2010 at 6:56 PM, jaayer <jaayer(a)zoho.com> wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> ---- On Tue, 23 Nov 2010 05:17:05 -0800 Cyrille Delaunay wrote ----
> >>>>
> >>>>> Hello,
> >>>>>
> >>>>> I would like to know how I can rename a method programatically and safelly (without missing to raise any event that has to be raised)
> >>>>>
> >>>>
> >>>> I don't believe there is any simple way to do this.
> >>>>
> >>>> Basically, to rename a method you have to remove it first and compile into its class a new method containing the same source code but with a different selector at the beginning. This is how the refactory browser does it when you select "rename" from the "refactor method" menu. If anyone knows of a better way, I would be interested to hear it.
> >>>>
> >>>>
> >>>>
> >>>
> >>> --
> >>> www.tudorgirba.com
> >>>
> >>> "To lead is not to demand things, it is to make them happen."
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >> --
> >> Best regards,
> >> Igor Stasenko AKA sig.
> >>
> >
> > --
> > www.tudorgirba.com
> >
> > "Not knowing how to do something is not an argument for how it cannot be done."
> >
> >
> >
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>
--
www.tudorgirba.com
"Problem solving efficiency grows with the abstractness level of problem understanding."
Nov. 24, 2010
Re: [Pharo-project] rename a method programatically
by Mariano Martinez Peck
RB has NOTHING to do with a UI or with a Browser. Actually, it is very well
splitted in packages, and I think you can just use RB with a simple api
"programmatically".
On Wed, Nov 24, 2010 at 9:17 AM, Cyrille Delaunay <cy.delaunay(a)gmail.com>wrote:
> Indeed, in my case I would like to do that wihtout using UI. I want to
> write a test in which I rename a method and see if the events emited have
> been well-catched by RPackage.
>
> 2010/11/24 Igor Stasenko <siguctua(a)gmail.com>
>
> On 24 November 2010 02:00, Tudor Girba <tudor.girba(a)gmail.com> wrote:
>> > Well, as long as you want to perform a refactoring I believe that RB
>> provides the API in question.
>> >
>> Yes, of course. But question was 'how to do that programmatically' ,
>> not using browser or other UI.
>>
>> > Doru
>> >
>> >
>> > On 24 Nov 2010, at 00:52, Igor Stasenko wrote:
>> >
>> >> On 24 November 2010 01:43, Tudor Girba <tudor.girba(a)gmail.com> wrote:
>> >>> Definitely use the RB for any code transformations.
>> >>>
>> >>
>> >> I don't think it's a good option for meta-programming.
>> >> For meta-programming, basic interface in Behavior or ClassDescription
>> >> should be enough for manipulating
>> >> with methods, without dependency from RB.
>> >> Actually, RB then can use same API for manipulations.
>> >>
>> >>> Cheers,
>> >>> Doru
>> >>>
>> >>>
>> >>> On 23 Nov 2010, at 19:01, Mariano Martinez Peck wrote:
>> >>>
>> >>>> Cyrille I don't know why you need that but take into account that RB
>> split their packages even more in the last months. So maybe it is easier for
>> you to directly use RB and load with your code, the RB core or the specific
>> package that you need. Mostly if you need some other similar
>> functionalities.
>> >>>>
>> >>>> Cheers
>> >>>>
>> >>>> Mariano
>> >>>>
>> >>>> On Tue, Nov 23, 2010 at 6:56 PM, jaayer <jaayer(a)zoho.com> wrote:
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> ---- On Tue, 23 Nov 2010 05:17:05 -0800 Cyrille Delaunay wrote ----
>> >>>>
>> >>>>> Hello,
>> >>>>>
>> >>>>> I would like to know how I can rename a method programatically and
>> safelly (without missing to raise any event that has to be raised)
>> >>>>>
>> >>>>
>> >>>> I don't believe there is any simple way to do this.
>> >>>>
>> >>>> Basically, to rename a method you have to remove it first and compile
>> into its class a new method containing the same source code but with a
>> different selector at the beginning. This is how the refactory browser does
>> it when you select "rename" from the "refactor method" menu. If anyone knows
>> of a better way, I would be interested to hear it.
>> >>>>
>> >>>>
>> >>>>
>> >>>
>> >>> --
>> >>> www.tudorgirba.com
>> >>>
>> >>> "To lead is not to demand things, it is to make them happen."
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> Best regards,
>> >> Igor Stasenko AKA sig.
>> >>
>> >
>> > --
>> > www.tudorgirba.com
>> >
>> > "Not knowing how to do something is not an argument for how it cannot be
>> done."
>> >
>> >
>> >
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>>
>
Nov. 24, 2010
Re: [Pharo-project] Fwd: [Pharo-users] TestMock: a full featured mock testing framework now available in SqueakSource
by Tudor Girba
Given this discussion, I would like to encourage you to take a look at Phexample by Adrian Kuhn and Niko Schwarz, based on previous work of Markus Gaelli. The basic idea is that there is no distinction between setup and tests. They are all examples, and examples are built on top of each other.
Phexample is completely compatible with SUnit. It also comes with a fancier API, but even if you would like to debate this API, I believe it is a nice thing that we should look more closely into.
Here are two examples checking an implementation of Stack. The first one creates the stack and checks that it should be empty, and the second one checks the pushing behavior:
ForExampleStack>>shouldBeEmpty
| stack |
stack := Stack new.
stack isEmpty should beTrue.
stack size should = 0.
^ stack
ForExampleStack>>shouldPushElement
| stack |
stack := self given: #shouldBeEmpty.
stack push: 42.
stack isEmpty should not beTrue.
stack size should = 1.
stack top should = 42.
^ stack
More information can be found here:
http://smalltalkthoughts.blogspot.com/2009/11/phexample-because-examples-ex…
You can get it by simply:
Gofer new
squeaksource: 'phexample';
addPackage: 'Phexample';
load
Cheers,
Doru
On 24 Nov 2010, at 08:28, laurent laffont wrote:
> I agree with you Dennis. TDD practices are far ahead in Ruby / Java / Python world.
>
> BUT IMHO can be a real cool neaty great platform for TDD because we have: dynamic development.
>
> What I think we miss:
> - put a Mock framework in PharoCore - Mocks should be a standard tool even for low-level stuff
> - introduce pragmas to declare tests / setUp / tearDown methods so I can write
>
> AddressBookWithLaurentAndDennis>>createAddressBook
> <setUpTest>
> bla bla
>
> AddressBookWithLaurentAndDennis>>shouldHaveNumberOfContactsAnswersTwo
> <test>
> blabla
>
> AddressBookWithLaurentAndDennis>>ifDennisRemovedNumberOfContactsShouldAnswersOne
> <test>
> bla bla
>
>
>
> - (harder) interface to / creation of an executable requirements / BDD framework like Cucumber http://cukes.info/
>
> Laurent
>
>
> On Wed, Nov 24, 2010 at 4:31 AM, Dennis Schetinin <chaetal(a)gmail.com> wrote:
> As for me, I'm simply unable to establish smooth test-driven process without Mocks. I think it does not depend on language at all.
>
> Without mocks I have to divide the task I have into smaller independent parts. It's actually an up-front design. I can make a mistake (I usually do); even worse it's often just impossible to accomplish because too many subcomponents usually interact thoroughly and I simply don't know which one to implement first :). So, without mocks I have to code bottom-up, from details to general. This is unnatural and error-prone.
>
> With mocks I can start directly from the task I have. I get a use case and write a test for the one. Creating the test I detect subcomponents needed, understand how they should interact and document that in the same test. As those subcomponents do not exist yet, I have to specify them and their behavior right in the test (if I don't want to break the process I've just started). That's why I really need mocks. Then I can take another use case or implement one of the mocks I used as a real object and so on. Thus, mocks allow me to go top-down and implement only the things I really need, not the things I think I'll need.
>
> Are there other, maybe better, approaches?
>
> Concerning TDD popularity⦠I'm not sure TDD plays the role it should in Smalltalk community.
>
> Messing with Smalltalk for about 7â8 years, I can't say I often see real TDD code. About 50â70% (depending on Smalltalk dialect) of frameworks I use have no tests at all. The rest often looks being tested a posteriori. Perhaps, Pharo is the only exclusionâ¦
>
> And if TDD is really popular and widely used, why do we have so much regression bugs even in core subsystems even in commercial Smalltalks?
>
> Please, correct me if I'm wrong.
>
> 2010/11/23 laurent laffont <laurent.laffont(a)gmail.com>
>
> On Tue, Nov 23, 2010 at 5:39 PM, Luc Fabresse <luc.fabresse(a)gmail.com> wrote:
> Hi Dennis,
>
> Yes, TDD is highly popular and encouraged in the Smalltalk community.
> And mocks are not necessary in most cases.
>
>
> Hi Luc,
>
> why Mocks are less necessary in Smalltalk than in other (Ruby/Python/whatever...) languages ? Do you have some examples / link ?
>
> Sometimes I think a mocking library should be in PharoCore so I don't need to write my own mocks.....
>
>
> Cheers,
>
> Laurent
>
>
>
>
> #Luc
>
>
> 2010/11/23 Dennis Schetinin <chaetal(a)gmail.com>
>
> How is it compared to Mocketry (http://www.squeaksource.com/Mocketry.html)? SMock?
>
> BTW, isn't TDD without mocks a bit incomplete? And is TDD popular among smalltalkers actually?
>
> 2010/11/22 Mariano Martinez Peck <marianopeck(a)gmail.com>
>
> This is cool Anindya. I don't need mocks right now, but I will keep it in mind!
>
> I cc'ed Pharo-dev mailing list.
>
> Cheers
>
> Mariano
>
> ---------- Forwarded message ----------
> From: Anindya Haldar <anindya_haldar(a)yahoo.com>
> Date: Mon, Nov 22, 2010 at 10:11 AM
> Subject: [Pharo-users] TestMock: a full featured mock testing framework now available in SqueakSource
> To: pharo-users(a)lists.gforge.inria.fr
>
>
> Dear Pharoers,
>
> TestMcok is a full featured mock based test framework that I am very glad to contribute to the community. It is in squeaksource under the project name TestMock. Please feel free to try it, and feedback will be greatly appreciated. The wiki section includes a brief how-to guide with code examples.
>
> Regards,
> Anindya Haldar
>
>
>
>
> _______________________________________________
> Pharo-users mailing list
> Pharo-users(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>
>
>
>
>
> --
> Dennis Schetinin
>
>
>
>
>
> --
> Dennis Schetinin
>
--
www.tudorgirba.com
"In a world where everything is moving ever faster,
one might have better chances to win by moving slower."
Nov. 24, 2010
Re: [Pharo-project] rename a method programatically
by Cyrille Delaunay
Indeed, in my case I would like to do that wihtout using UI. I want to write
a test in which I rename a method and see if the events emited have been
well-catched by RPackage.
2010/11/24 Igor Stasenko <siguctua(a)gmail.com>
> On 24 November 2010 02:00, Tudor Girba <tudor.girba(a)gmail.com> wrote:
> > Well, as long as you want to perform a refactoring I believe that RB
> provides the API in question.
> >
> Yes, of course. But question was 'how to do that programmatically' ,
> not using browser or other UI.
>
> > Doru
> >
> >
> > On 24 Nov 2010, at 00:52, Igor Stasenko wrote:
> >
> >> On 24 November 2010 01:43, Tudor Girba <tudor.girba(a)gmail.com> wrote:
> >>> Definitely use the RB for any code transformations.
> >>>
> >>
> >> I don't think it's a good option for meta-programming.
> >> For meta-programming, basic interface in Behavior or ClassDescription
> >> should be enough for manipulating
> >> with methods, without dependency from RB.
> >> Actually, RB then can use same API for manipulations.
> >>
> >>> Cheers,
> >>> Doru
> >>>
> >>>
> >>> On 23 Nov 2010, at 19:01, Mariano Martinez Peck wrote:
> >>>
> >>>> Cyrille I don't know why you need that but take into account that RB
> split their packages even more in the last months. So maybe it is easier for
> you to directly use RB and load with your code, the RB core or the specific
> package that you need. Mostly if you need some other similar
> functionalities.
> >>>>
> >>>> Cheers
> >>>>
> >>>> Mariano
> >>>>
> >>>> On Tue, Nov 23, 2010 at 6:56 PM, jaayer <jaayer(a)zoho.com> wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> ---- On Tue, 23 Nov 2010 05:17:05 -0800 Cyrille Delaunay wrote ----
> >>>>
> >>>>> Hello,
> >>>>>
> >>>>> I would like to know how I can rename a method programatically and
> safelly (without missing to raise any event that has to be raised)
> >>>>>
> >>>>
> >>>> I don't believe there is any simple way to do this.
> >>>>
> >>>> Basically, to rename a method you have to remove it first and compile
> into its class a new method containing the same source code but with a
> different selector at the beginning. This is how the refactory browser does
> it when you select "rename" from the "refactor method" menu. If anyone knows
> of a better way, I would be interested to hear it.
> >>>>
> >>>>
> >>>>
> >>>
> >>> --
> >>> www.tudorgirba.com
> >>>
> >>> "To lead is not to demand things, it is to make them happen."
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >> --
> >> Best regards,
> >> Igor Stasenko AKA sig.
> >>
> >
> > --
> > www.tudorgirba.com
> >
> > "Not knowing how to do something is not an argument for how it cannot be
> done."
> >
> >
> >
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>
Nov. 24, 2010
Re: [Pharo-project] Fwd: [Pharo-users] TestMock: a full featured mock testing framework now available in SqueakSource
by laurent laffont
I agree with you Dennis. TDD practices are far ahead in Ruby / Java / Python
world.
BUT IMHO can be a real cool neaty great platform for TDD because we have:
dynamic development.
What I think we miss:
- put a Mock framework in PharoCore - Mocks should be a standard tool even
for low-level stuff
- introduce pragmas to declare tests / setUp / tearDown methods so I can
write
AddressBookWithLaurentAndDennis>>createAddressBook
<setUpTest>
bla bla
AddressBookWithLaurentAndDennis>>shouldHaveNumberOfContactsAnswersTwo
<test>
blabla
AddressBookWithLaurentAndDennis>>ifDennisRemovedNumberOfContactsShouldAnswersOne
<test>
bla bla
- (harder) interface to / creation of an executable requirements / BDD
framework like Cucumber http://cukes.info/
Laurent
On Wed, Nov 24, 2010 at 4:31 AM, Dennis Schetinin <chaetal(a)gmail.com> wrote:
> As for me, I'm simply unable to establish smooth test-driven process
> without Mocks. I think it does not depend on language at all.
>
> Without mocks I have to divide the task I have into smaller independent
> parts. It's actually an up-front design. I can make a mistake (I usually
> do); even worse it's often just impossible to accomplish because too many
> subcomponents usually interact thoroughly and I simply don't know which one
> to implement first :). So, without mocks I have to code bottom-up, from
> details to general. This is unnatural and error-prone.
>
> With mocks I can start directly from the task I have. I get a use case and
> write a test for the one. Creating the test I detect subcomponents needed,
> understand how they should interact and document that in the same test. As
> those subcomponents do not exist yet, I have to specify them and their
> behavior right in the test (if I don't want to break the process I've just
> started). That's why I really need mocks. Then I can take another use case
> or implement one of the mocks I used as a real object and so on. Thus, mocks
> allow me to go top-down and implement only the things I really need, not the
> things I think I'll need.
>
> Are there other, maybe better, approaches?
>
> Concerning TDD popularity⦠I'm not sure TDD plays the role it should in
> Smalltalk community.
>
> Messing with Smalltalk for about 7â8 years, I can't say I often see real
> TDD code. About 50â70% (depending on Smalltalk dialect) of frameworks I use
> have no tests at all. The rest often looks being tested a posteriori.
> Perhaps, Pharo is the only exclusionâ¦
>
> And if TDD is really popular and widely used, why do we have so much
> regression bugs even in core subsystems even in commercial Smalltalks?
>
> Please, correct me if I'm wrong.
>
> 2010/11/23 laurent laffont <laurent.laffont(a)gmail.com>
>
> On Tue, Nov 23, 2010 at 5:39 PM, Luc Fabresse <luc.fabresse(a)gmail.com>wrote:
>>
>>> Hi Dennis,
>>>
>>> Yes, TDD is highly popular and encouraged in the Smalltalk community.
>>> And mocks are not necessary in most cases.
>>>
>>
>>
>> Hi Luc,
>>
>> why Mocks are less necessary in Smalltalk than in other
>> (Ruby/Python/whatever...) languages ? Do you have some examples / link ?
>>
>> Sometimes I think a mocking library should be in PharoCore so I don't need
>> to write my own mocks.....
>>
>>
>> Cheers,
>>
>> Laurent
>>
>>
>>
>>
>>>
>>> #Luc
>>>
>>>
>>> 2010/11/23 Dennis Schetinin <chaetal(a)gmail.com>
>>>
>>> How is it compared to Mocketry (
>>>> http://www.squeaksource.com/Mocketry.html)? SMock?
>>>>
>>>> BTW, isn't TDD without mocks a bit incomplete? And is TDD popular among
>>>> smalltalkers actually?
>>>>
>>>> 2010/11/22 Mariano Martinez Peck <marianopeck(a)gmail.com>
>>>>
>>>> This is cool Anindya. I don't need mocks right now, but I will keep it
>>>>> in mind!
>>>>>
>>>>> I cc'ed Pharo-dev mailing list.
>>>>>
>>>>> Cheers
>>>>>
>>>>> Mariano
>>>>>
>>>>> ---------- Forwarded message ----------
>>>>> From: Anindya Haldar <anindya_haldar(a)yahoo.com>
>>>>> Date: Mon, Nov 22, 2010 at 10:11 AM
>>>>> Subject: [Pharo-users] TestMock: a full featured mock testing framework
>>>>> now available in SqueakSource
>>>>> To: pharo-users(a)lists.gforge.inria.fr
>>>>>
>>>>>
>>>>> Dear Pharoers,
>>>>>
>>>>> TestMcok is a full featured mock based test framework that I am very
>>>>> glad to contribute to the community. It is in squeaksource under the project
>>>>> name TestMock. Please feel free to try it, and feedback will be greatly
>>>>> appreciated. The wiki section includes a brief how-to guide with code
>>>>> examples.
>>>>>
>>>>> Regards,
>>>>> Anindya Haldar
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Pharo-users mailing list
>>>>> Pharo-users(a)lists.gforge.inria.fr
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Dennis Schetinin
>>>>
>>>
>>>
>>
>
>
> --
> Dennis Schetinin
>
Nov. 24, 2010
Re: [Pharo-project] removeSelector:
by Noury Bouraqadi
No, it is an ill-named method. The argument is not a selector, but an array. First argument is a class and the second.
Noury
On 23 nov. 2010, at 12:48, Benjamin wrote:
> Hello guys,
>
> regarding that comment of SmalltalkImage>>#removeSelector: is
>
> "Safely remove a selector from a class (or metaclass). If the
> class or the method doesn't exist anymore, never mind and
> answer nil.
> This method should be used instead of 'Class removeSelector:
> #method' to omit global class references."
>
> maybe Behavior>>#removeSelector: sould be deprecated ?
>
>
> Ben
Nov. 24, 2010
Re: [Pharo-project] Fwd: [Pharo-users] TestMock: a full featured mock testing framework now available in SqueakSource
by Dennis Schetinin
As for me, I'm simply unable to establish smooth test-driven process without
Mocks. I think it does not depend on language at all.
Without mocks I have to divide the task I have into smaller independent
parts. It's actually an up-front design. I can make a mistake (I usually
do); even worse it's often just impossible to accomplish because too many
subcomponents usually interact thoroughly and I simply don't know which one
to implement first :). So, without mocks I have to code bottom-up, from
details to general. This is unnatural and error-prone.
With mocks I can start directly from the task I have. I get a use case and
write a test for the one. Creating the test I detect subcomponents needed,
understand how they should interact and document that in the same test. As
those subcomponents do not exist yet, I have to specify them and their
behavior right in the test (if I don't want to break the process I've just
started). That's why I really need mocks. Then I can take another use case
or implement one of the mocks I used as a real object and so on. Thus, mocks
allow me to go top-down and implement only the things I really need, not the
things I think I'll need.
Are there other, maybe better, approaches?
Concerning TDD popularity⦠I'm not sure TDD plays the role it should in
Smalltalk community.
Messing with Smalltalk for about 7â8 years, I can't say I often see real TDD
code. About 50â70% (depending on Smalltalk dialect) of frameworks I use have
no tests at all. The rest often looks being tested a posteriori. Perhaps,
Pharo is the only exclusionâ¦
And if TDD is really popular and widely used, why do we have so much
regression bugs even in core subsystems even in commercial Smalltalks?
Please, correct me if I'm wrong.
2010/11/23 laurent laffont <laurent.laffont(a)gmail.com>
> On Tue, Nov 23, 2010 at 5:39 PM, Luc Fabresse <luc.fabresse(a)gmail.com>wrote:
>
>> Hi Dennis,
>>
>> Yes, TDD is highly popular and encouraged in the Smalltalk community.
>> And mocks are not necessary in most cases.
>>
>
>
> Hi Luc,
>
> why Mocks are less necessary in Smalltalk than in other
> (Ruby/Python/whatever...) languages ? Do you have some examples / link ?
>
> Sometimes I think a mocking library should be in PharoCore so I don't need
> to write my own mocks.....
>
>
> Cheers,
>
> Laurent
>
>
>
>
>>
>> #Luc
>>
>>
>> 2010/11/23 Dennis Schetinin <chaetal(a)gmail.com>
>>
>> How is it compared to Mocketry (http://www.squeaksource.com/Mocketry.html)?
>>> SMock?
>>>
>>> BTW, isn't TDD without mocks a bit incomplete? And is TDD popular among
>>> smalltalkers actually?
>>>
>>> 2010/11/22 Mariano Martinez Peck <marianopeck(a)gmail.com>
>>>
>>> This is cool Anindya. I don't need mocks right now, but I will keep it in
>>>> mind!
>>>>
>>>> I cc'ed Pharo-dev mailing list.
>>>>
>>>> Cheers
>>>>
>>>> Mariano
>>>>
>>>> ---------- Forwarded message ----------
>>>> From: Anindya Haldar <anindya_haldar(a)yahoo.com>
>>>> Date: Mon, Nov 22, 2010 at 10:11 AM
>>>> Subject: [Pharo-users] TestMock: a full featured mock testing framework
>>>> now available in SqueakSource
>>>> To: pharo-users(a)lists.gforge.inria.fr
>>>>
>>>>
>>>> Dear Pharoers,
>>>>
>>>> TestMcok is a full featured mock based test framework that I am very
>>>> glad to contribute to the community. It is in squeaksource under the project
>>>> name TestMock. Please feel free to try it, and feedback will be greatly
>>>> appreciated. The wiki section includes a brief how-to guide with code
>>>> examples.
>>>>
>>>> Regards,
>>>> Anindya Haldar
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-users mailing list
>>>> Pharo-users(a)lists.gforge.inria.fr
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Dennis Schetinin
>>>
>>
>>
>
--
Dennis Schetinin
Nov. 24, 2010
Re: [Pharo-project] rename a method programatically
by Igor Stasenko
On 24 November 2010 02:00, Tudor Girba <tudor.girba(a)gmail.com> wrote:
> Well, as long as you want to perform a refactoring I believe that RB provides the API in question.
>
Yes, of course. But question was 'how to do that programmatically' ,
not using browser or other UI.
> Doru
>
>
> On 24 Nov 2010, at 00:52, Igor Stasenko wrote:
>
>> On 24 November 2010 01:43, Tudor Girba <tudor.girba(a)gmail.com> wrote:
>>> Definitely use the RB for any code transformations.
>>>
>>
>> I don't think it's a good option for meta-programming.
>> For meta-programming, basic interface in Behavior or ClassDescription
>> should be enough for manipulating
>> with methods, without dependency from RB.
>> Actually, RB then can use same API for manipulations.
>>
>>> Cheers,
>>> Doru
>>>
>>>
>>> On 23 Nov 2010, at 19:01, Mariano Martinez Peck wrote:
>>>
>>>> Cyrille I don't know why you need that but take into account that RB split their packages even more in the last months. So maybe it is easier for you to directly use RB and load with your code, the RB core or the specific package that you need. Mostly if you need some other similar functionalities.
>>>>
>>>> Cheers
>>>>
>>>> Mariano
>>>>
>>>> On Tue, Nov 23, 2010 at 6:56 PM, jaayer <jaayer(a)zoho.com> wrote:
>>>>
>>>>
>>>>
>>>>
>>>> ---- On Tue, 23 Nov 2010 05:17:05 -0800 Cyrille Delaunay  wrote ----
>>>>
>>>>> Hello,
>>>>>
>>>>> I would like to know how I can rename a method programatically and safelly (without missing to raise any event that has to be raised)
>>>>>
>>>>
>>>> I don't believe there is any simple way to do this.
>>>>
>>>> Basically, to rename a method you have to remove it first and compile into its class a new method containing the same source code but with a different selector at the beginning. This is how the refactory browser does it when you select "rename" from the "refactor method" menu. If anyone knows of a better way, I would be interested to hear it.
>>>>
>>>>
>>>>
>>>
>>> --
>>> www.tudorgirba.com
>>>
>>> "To lead is not to demand things, it is to make them happen."
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>
> --
> www.tudorgirba.com
>
> "Not knowing how to do something is not an argument for how it cannot be done."
>
>
>
--
Best regards,
Igor Stasenko AKA sig.
Nov. 24, 2010