[MacRuby-devel] HotCocoa Part I

Laurent Sansonetti lsansonetti at apple.com
Wed Dec 3 01:31:59 PST 2008


Hi Eloy,

On Dec 3, 2008, at 12:46 AM, Eloy Duran wrote:

> Hi listees,
>
>> The critical question, then, is how to create an environment that  
>> allows
>> (nay, encourages!) frameworks to be created, tested, polished,  
>> documented,
>> indexed, shared, etc.  My intuition is that GitHub should be part  
>> of this,
>> because it promotes free-flowing cooperation, merging, etc.   
>> However, I'm
>> quite sure that GitHub isn't the entire solution.  So, ideas are  
>> welcome!
>
> I personally think the most important thing to do first is the  
> testing part.
> Since the main part of MacRuby is written in (Objective-)C,
> I expect the most user contribution in the HotCocoa part.
>
> But with the current state of the code this encourages code without  
> tests,
> and who is ever going to go back and write tests for them?
> Also, because HotCocoa is probably the part most users will  
> contribute on,
> it should be easy for a user to do so in a cycle like below and not  
> have to worry
> about introducing a regression (or worse, worry so much that they  
> won't take the effort to create a patch at all):
>
>  get source -> run tests -> write tests -> implement feature -> run  
> tests again -> create patch
>
> This workflow is good for the user because she/he doesn't need to  
> read all source first
> to make sure they don't break anything else.
> But also for the devs who are going to commit the patches.
> And tests are also useful as examples on how to use the code.

I agree HotCocoa should be covered by tests, at least to catch  
regressions.

HotCocoa was initially started as an experiment and we (well, Rich)  
iterated a lot on the interface, now it's maybe time to start thinking  
about freezing some parts of the API (most probably the mappings) and  
covering these with tests would be a good idea.

I think that most contributions will be mapping files.

> So I would vote for rewriting HotCocoa in a TDD manner,
> which isn't too hard with the majority of the functionality already  
> fleshed out.

I disagree on this point, why would you want to rewrite the existing  
code instead of just covering it with tests? This sounds like a bad  
idea to me.

I know this violates the TDD principle but we could simply make sure  
the already-written functionality is covered with tests.

> I know I'm quite alone on the stance about TDD etc on this list, so  
> I need to put my money where my mouth is.
> Thus I have started experimenting with mspec (since we'll need it  
> anyways) and rewrote some parts of HotCocoa.
> However this was purely "playing" time, meaning I'll throw away that  
> code and start again now that
> I have some experience with all code involved.
>
> After that would come a testing facility for HotCocoa apps.
> Which I would probably create in a manner to work with both Rucola  
> and HotCocoa.
> (Probably by re-using some stuff of Rucola::TestCase.)
>
> I expect to really start work at this and committing the end of this  
> week/next week.
> So there's plenty of time left for discussion on this topic.

While this is all interesting, please do not commit anything to trunk  
before we discuss this idea together.

Also, I am a bit suspicious when it comes to the rspec syntax. I  
personally would prefer the shoulda or pure test/unit syntax.

Laurent


More information about the MacRuby-devel mailing list