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 <[hidden email]> Date: Mon, Nov 22, 2010 at 10:11 AM Subject: [Pharo-users] TestMock: a full featured mock testing framework now available in SqueakSource To: [hidden email] 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 [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
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 <[hidden email]> This is cool Anindya. I don't need mocks right now, but I will keep it in mind! -- Dennis Schetinin |
Hi Dennis,
Yes, TDD is highly popular and encouraged in the Smalltalk community. And mocks are not necessary in most cases. #Luc 2010/11/23 Dennis Schetinin <[hidden email]> How is it compared to Mocketry (http://www.squeaksource.com/Mocketry.html)? SMock? |
On Tue, Nov 23, 2010 at 5:39 PM, Luc Fabresse <[hidden email]> wrote: Hi Dennis, 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
|
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 <[hidden email]>
-- Dennis Schetinin |
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 <[hidden email]> 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. |
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-expand-on.html 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 <[hidden email]> 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 <[hidden email]> > > On Tue, Nov 23, 2010 at 5:39 PM, Luc Fabresse <[hidden email]> 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 <[hidden email]> > > 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 <[hidden email]> > > 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 <[hidden email]> > Date: Mon, Nov 22, 2010 at 10:11 AM > Subject: [Pharo-users] TestMock: a full featured mock testing framework now available in SqueakSource > To: [hidden email] > > > 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 > [hidden email] > 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." |
I'm aware of this idea. It is very interesting. Actually, I often meet this pattern in practice. But I don't see how it is connected with Mocks :)
2010/11/24 Tudor Girba <[hidden email]> 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. -- Dennis Schetinin |
In reply to this post by Dennis Schetinin
Nothing should be in the core (not even the tests)
in the core we should have a way to load package from a distribution server. Now if this is in Pharo-dev this is another story :) We can get tests and mock and mock framework. Stef > 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 <[hidden email]> 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 <[hidden email]> > > On Tue, Nov 23, 2010 at 5:39 PM, Luc Fabresse <[hidden email]> 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 <[hidden email]> > > 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 <[hidden email]> > > 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 <[hidden email]> > Date: Mon, Nov 22, 2010 at 10:11 AM > Subject: [Pharo-users] TestMock: a full featured mock testing framework now available in SqueakSource > To: [hidden email] > > > 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 > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users > > > > > > -- > Dennis Schetinin > > > > > > -- > Dennis Schetinin > |
In reply to this post by Tudor Girba
By the way dennis did you start to write a chapter on Mocks?
Stef On Nov 24, 2010, at 11:21 AM, Dennis Schetinin wrote: > I'm aware of this idea. It is very interesting. Actually, I often meet this pattern in practice. But I don't see how it is connected with Mocks :) > > 2010/11/24 Tudor Girba <[hidden email]> > 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-expand-on.html > > 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 <[hidden email]> 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 <[hidden email]> > > > > On Tue, Nov 23, 2010 at 5:39 PM, Luc Fabresse <[hidden email]> 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 <[hidden email]> > > > > 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 <[hidden email]> > > > > 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 <[hidden email]> > > Date: Mon, Nov 22, 2010 at 10:11 AM > > Subject: [Pharo-users] TestMock: a full featured mock testing framework now available in SqueakSource > > To: [hidden email] > > > > > > 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 > > [hidden email] > > 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." > > > > > > > > -- > Dennis Schetinin |
In reply to this post by Stéphane Ducasse
I'm lost ... actually tests are in PharoCore. It is planned to remove them ?
Laurent
On Wed, Nov 24, 2010 at 2:29 PM, Stéphane Ducasse <[hidden email]> wrote: Nothing should be in the core (not even the tests) |
In reply to this post by Stéphane Ducasse
PharoCore should be really small at the end.
Why a testing framework should be in the core when you can load it and load the tests? Stef > I'm lost ... actually tests are in PharoCore. It is planned to remove them ? > > Laurent > > On Wed, Nov 24, 2010 at 2:29 PM, Stéphane Ducasse <[hidden email]> wrote: > Nothing should be in the core (not even the tests) > in the core we should have a way to load package from a distribution server. > > Now if this is in Pharo-dev this is another story :) > We can get tests and mock and mock framework. > > Stef > > > > 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 <[hidden email]> 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 <[hidden email]> > > > > On Tue, Nov 23, 2010 at 5:39 PM, Luc Fabresse <[hidden email]> 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 <[hidden email]> > > > > 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 <[hidden email]> > > > > 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 <[hidden email]> > > Date: Mon, Nov 22, 2010 at 10:11 AM > > Subject: [Pharo-users] TestMock: a full featured mock testing framework now available in SqueakSource > > To: [hidden email] > > > > > > 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 > > [hidden email] > > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users > > > > > > > > > > > > -- > > Dennis Schetinin > > > > > > > > > > > > -- > > Dennis Schetinin > > > > > |
On Wed, Nov 24, 2010 at 3:15 PM, Stéphane Ducasse <[hidden email]> wrote: PharoCore should be really small at the end. OK. So I vote for a Mock library in Pharo (Dev).
Laurent
|
In reply to this post by Stéphane Ducasse
prepare it and help building the pharo-dev script and it will be there.
On Nov 24, 2010, at 3:36 PM, laurent laffont wrote: > On Wed, Nov 24, 2010 at 3:15 PM, Stéphane Ducasse <[hidden email]> wrote: > PharoCore should be really small at the end. > Why a testing framework should be in the core when you can load it and load the tests? > > OK. > > So I vote for a Mock library in Pharo (Dev). > > Laurent > > > Stef > > > > > I'm lost ... actually tests are in PharoCore. It is planned to remove them ? > > > > Laurent > > > > On Wed, Nov 24, 2010 at 2:29 PM, Stéphane Ducasse <[hidden email]> wrote: > > Nothing should be in the core (not even the tests) > > in the core we should have a way to load package from a distribution server. > > > > Now if this is in Pharo-dev this is another story :) > > We can get tests and mock and mock framework. > > > > Stef > > > > > > > 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 <[hidden email]> 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 <[hidden email]> > > > > > > On Tue, Nov 23, 2010 at 5:39 PM, Luc Fabresse <[hidden email]> 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 <[hidden email]> > > > > > > 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 <[hidden email]> > > > > > > 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 <[hidden email]> > > > Date: Mon, Nov 22, 2010 at 10:11 AM > > > Subject: [Pharo-users] TestMock: a full featured mock testing framework now available in SqueakSource > > > To: [hidden email] > > > > > > > > > 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 > > > [hidden email] > > > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users > > > > > > > > > > > > > > > > > > -- > > > Dennis Schetinin > > > > > > > > > > > > > > > > > > -- > > > Dennis Schetinin > > > > > > > > > > > > |
On Wed, Nov 24, 2010 at 3:46 PM, Stéphane Ducasse <[hidden email]> wrote: prepare it and help building the pharo-dev script and it will be there. No problem :) Laurent
|
In reply to this post by Stéphane Ducasse
Stephane,
I'm curious, if there are not tests in the core, how do you know if it is working? In particular, how do you know if that loading mechanism is working?
On Wed, Nov 24, 2010 at 10:29 AM, Stéphane Ducasse <[hidden email]> wrote: Nothing should be in the core (not even the tests) Thanks |
In reply to this post by Stéphane Ducasse
On Nov 24, 2010, at 6:54 PM, Bernardo Ezequiel Contreras wrote: > Stephane, > I'm curious, > if there are not tests in the core, how do you know if it is working? you load them and run then. > In particular, how do you know if that loading mechanism is working? you load tests that check the loading and run them > On Wed, Nov 24, 2010 at 10:29 AM, Stéphane Ducasse <[hidden email]> wrote: > Nothing should be in the core (not even the tests) > in the core we should have a way to load package from a distribution server. > > Now if this is in Pharo-dev this is another story :) > We can get tests and mock and mock framework. > > Stef > > > > Thanks |
In reply to this post by vonbecmann
El mié, 24-11-2010 a las 14:54 -0300, Bernardo Ezequiel Contreras
escribió: > Stephane, > I'm curious, > if there are not tests in the core, how do you know if it is > working? > In particular, how do you know if that loading mechanism is > working? Of course there will be test, but they will be loaded only if you want. for example in the Pharo image (or pharo dev) they will be included. The core won't have it loaded because it is intended to be the base for deployent with a very minimal image. Of course the tools are here to verify that the core is in good shape, so the hudson build server will take a core image, load the tests for core and run the test. The reports will show if it has problems or not. Cheers > > > On Wed, Nov 24, 2010 at 10:29 AM, Stéphane Ducasse > <[hidden email]> wrote: > Nothing should be in the core (not even the tests) > in the core we should have a way to load package from a > distribution server. > > Now if this is in Pharo-dev this is another story :) > We can get tests and mock and mock framework. > > Stef > > > > > Thanks -- Miguel Cobá http://twitter.com/MiguelCobaMtz http://miguel.leugim.com.mx |
In reply to this post by Stéphane Ducasse
By the way dennis did you start to write a chapter on Mocks? Well, actually I'm another Dennis :) I think you talked about the Mocks chapter with Dennis Kudryashov, author of Mocketry. On the other hand, he was my student, we still stay in touch with him and decided to work together on the topic. We didn't make much progress so far unfortunately, but we have a plan for the chapter and about 50% of text in Russian. -- Dennis Schetinin |
2010/11/24 Dennis Schetinin <[hidden email]>
Yes, I think we need little step to finish it. I just very busy in last few month. |
Free forum by Nabble | Edit this page |