Support for TDD

2 views
Skip to first unread message

Hernan Wilkinson

unread,
Jan 10, 2017, 6:23:18 PM1/10/17
to cui...@googlegroups.com, cu...@jvuletich.org
Hi,
 here is my first contribution to Cuis! 
 Attached are two CS with support for TDD. Why two? because I have no idea how to move changes from one change set to another neither how to create a package :-)
 Anyway, install them and run: Editor initialize

 This will add two options on the code menu:
A) Accept & Run Tests in Class (t)
B) Accept & Run Tests in Category (y)

Both do the following:
1) Saves the method 
2) If the method is a test, runs it and if there is an error opens the debugger to solve the error
3) After running the method succesfully, if option A) was chosen, runs all tests in the method class, if B) was chosen runs all tests in the category of the method class
4) If all tests of 3) passed, flashes the code editor with a green color. If not, an inspector will be open with a test result wrapper that shows the test that error and fail, one per line string representation of the object that allows you to easily debut the test just pressing cmd+d over the line. Also the message #reRun can be send to self and it will rerun all tests and show only the new errors and failures... it is the easies UI that I could think of ...

If the method being saved is not a test, it does not run that method but it runs the class's tests or category's tests. The same happens if cmd+t or cmd+y is pressed in a class that is not a test case. This is a very easy way to run tests.

For sure ther is place for improvements in the implementation and also in the functionality...

Let me know what you think!
Hernan.

--
Hernán Wilkinson
Agile Software Development, Teaching & Coaching
Phone: +54-011-4893-2057
Twitter: @HernanWilkinson
Address: Alem 896, Floor 6, Buenos Aires, Argentina
TDDSupport-HernanWilkinson-1-HernanWilkinson.1.cs.st
TDDSupport-HernanWilkinson-0-HernanWilkinson.1.cs.st

Gerardo Richarte

unread,
Jan 10, 2017, 6:48:16 PM1/10/17
to Hernan Wilkinson, cui...@googlegroups.com, cu...@jvuletich.org
I've been doing a bit of TDD with this, and I found something quite annoying: When I program "from the test backwards", every time I save a method, I get a popup asking me to correct a selector, and of course, the name doesn't exist! i'm doing TDD!!!

bummer.

thanks for this addition! I haven't taken a look at the code, but I will because I want to know how do you know what tests to use when not saving in a TestCase subclass... I guess each class may answer to #testClass, shouldn't they? of course you can also use senders...

cheers!

--
You received this message because you are subscribed to the Google Groups "Cuis MachineLearning" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cuisml+unsubscribe@googlegroups.com.
To post to this group, send email to cui...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cuisml/CAJAbP8jHufrMVzeW27Dx3frhDoVjNq-t0V_%2BxMWeQp9wuD7HUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hernan Wilkinson

unread,
Jan 10, 2017, 8:02:08 PM1/10/17
to Gerardo Richarte, cu...@jvuletich.org, cui...@googlegroups.com
Allowing to send not defined messages is something I haven't change on cuis, I did it a long time ago on pharo... 😬

Not every class should have a test class related, that is a unit testing point of view
If you try to run a test from a class it is not a test case it wont do anything unless you selected to run all tests in the class  category. 
There are many things to try using conventions like the one you say, other is to look for a class called as the selected one with Test at the end of its name, the same for categories, etc

Other useful feature cuis is missing is the create button on the debugger for dnu and abstract methods... 

To unsubscribe from this group and stop receiving emails from it, send an email to cuisml+un...@googlegroups.com.

Javier Burroni

unread,
Jan 10, 2017, 9:48:57 PM1/10/17
to Gerardo Richarte, Hernan Wilkinson, cu...@jvuletich.org, cui...@googlegroups.com
I know this is off topic, but I agree about the missing create button in the debugger! 
I was doing a demo to some people and realized that it was missing! 
But people got amazed about Smalltalk anyway 

Hernan Wilkinson

unread,
Jan 11, 2017, 6:24:16 AM1/11/17
to Javier Burroni, Gerardo Richarte, cu...@jvuletich.org, cui...@googlegroups.com
yeah, sorry I started the thread here but I figured it could help Gera on his work :-)

About sending not defined messages, I wanted to mention that I feel pretty confortable with the Cuis solution, because it tells you about it but allows you to compile the method anyway.

The create button is available on the information window that gets open before the debugger, so when removing that window and debugging the option is not available anymore

Juan, I also changed two other unrelated things:
1) The size of the inspector window, I made it bigger
2) I added as shortcut to debug cmd+D, it is very useful


To unsubscribe from this group and stop receiving emails from it, send an email to cuisml+unsubscribe@googlegroups.com.








--


You received this message because you are subscribed to the Google Groups "Cuis MachineLearning" group.


To unsubscribe from this group and stop receiving emails from it, send an email to cuisml+unsubscribe@googlegroups.com.



To post to this group, send email to cui...@googlegroups.com.


Juan Vuletich

unread,
Jan 14, 2017, 7:14:58 AM1/14/17
to Hernan Wilkinson, Javier Burroni, Gerardo Richarte, cu...@jvuletich.org, cui...@googlegroups.com
I've just commited your changes to GitHub.

Thanks!

BTW, I'd really like to be able to follow Gera's work more closely. I hope to be able to devote a bit of time to this!
To unsubscribe from this group and stop receiving emails from it, send an email to cuisml+un...@googlegroups.com.

To post to this group, send email to cui...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages