Hi Roel ;)
Anything which extends that period
of time I turn into methods, so that they get saved with the rest of my code. It frequently happens that these methods turn into 'class methods' in a protocol 'examples' (PS: I fo not know how much of a newbie you are -- don't hesitate to tell me that I'm talking chinese here!).
I think I'm newbie level 2 or 3 lol I 'm ok with most of concepts and the squeak environement but I still need practise...and in general Im a newbie in programming...but anyway, you didn't talk chinese here ;)
For the methods that you use to test things, turn them into unit
tests. Testing is a very good ractice (I am glad you do already).
actually, I put two kind of stuff in workspace, tests of functionnlaities I try to obtain... and also documentation on thinks I discover ... like for instance, I need to manipulate XML file, so I have a worspace for my XML experiments... same for connecting a postgres database... etc etc ... It's more a reminder of what I did and what were the results... It could be done in an external text file but I find it handly to direclty write in workspace (except when I need to use a previous image...)
By
turning the pieces of code into unit tests you (1) will be able to run them all by themself instead of selecting and executing them manually one by one, and (2) you can again save them with the rest of your code. So, if you have some code like the following in your workspace:
"Test whether + does what I think it does" 3 + 4 "should give 7"
You can:
- create a class 'PlusTest', subclass of TestCase.
- in class PlusTest, create a protocol called 'testing'.
- convert your workspace test in a unit test by putting it in a
method whose name starts with 'test' testAddition self assert: (3 + 4 = 7).
- open the TestRunner tool
- find your class in the list and you can execute your tests.
Thanks for this tip thats true that I can make tests with some code tries... I thought unit test had to be associated with a given application but I can also do tests for my experiments ...
Thanks Roel ;)