How to TDD for CouchDB with CouchApp? - tdd

Recently I've discovered CouchDB. I want to use CouchApp to build a flash games site. It looks like a perfect fit 'cause this kind of a site is totally document based with a bit of binary attachments.
The only thing I need to learn before I start is how to TDD with CouchApp/CouchDB. I couldn't google any workflow tutorial and I'm not experienced enough to adapt any existing server-side JS workflow to the CouchDB environment.
Your suggestions?

I looked at this and found jsunit and Jasmine.
I settled on jsunit for familiarity and because I had a book with some examples in it (yeah, I know a real scientific decision process).
I got what I wanted out of it, but an not entirely happy about the way of working in a browser as a test runner. I need to look at some ways to automate it in my build process.

Related

Dreamweaver or learn do it from scratch

I would like to create a website (non commercial) for fun. After lot of thought, have decided to go ahead with Rails & Java (in the backend). The main challenge I am facing is with the UI - am not an expert - can work on Html/Css/Javascripts however it would take me much much longer and this is my bottleneck.
I am leaning towards Dreamweaver to build the UI. My question is - will using a tool like Dreamweaver really help me - an armature in UI to create a small web site or am I better off diving deep into CSS/JQuery-UI and then start coding...
In my opinion, drop dreamweaver. You should go look at Bootstrap. It's a very easy to use framework that will assist you in creating your own website from scratch. It's amazingly simple to use and has many jQuery plugins pre-packaged and ready to use.
I second Henry. But if you're new to frontend design; also something to note is the power of tools like chrome inspector to pick it all apart. It's a great way to quickly develop, but also by simply exploring, you'll find yourself learning it all very quickly.. But there's still a lot to learn.
Plus if you're looking into rails, dreamweaver just doesn't fit into the workflow. But then again, I can't imagine dreamweaver fitting into any workflow.

Unit Testing for an Absolute Beginner - I'm using Ruby

I've realised that I really do need to get started on the behaviours and patterns related to unit testing in general and with ruby specifically, as I can then migrate that knowledge to other languages. Are there any really good examples on how to get started? The problem I have is that with the current systems I'm using and working on it seems like getting started with Unit testing is insurmountable.
I've never built a single unit test for operational code other than trying the same fifteen or so online tutorials that show you ruby's core classes seem to function fine. I need to know how to build these tests for my own systems and the mentality of what to look for and test for.
What good tutorials are online that show you how to do more than just test that an assert_true is true and the opposite is false? Even if they're not for ruby, what must-read and must experiment unit testing guide should I read or go over? Preferably one with a step by step tutorial.
Stuff like using these unit tests in actual existing models and frameworks and what to actually test for? I'm still trying to get my head around the testing mentality and I keep getting sidetracked by the different elements. No one's really specifically outlined what mentality you need to approach unit testing with, as all of those who have written guides or tutorials seem to have internalised the logic with which you approach the system.
Any help would be really appreciated.
Technically it's BDD, but I would recommend The RSpec Book because it does a good job of explaining concepts and has extended tutorials. The second section of the book covers Cucumber, so it will teach you that as well.
I know this is a perl tutorial, but I think it's really good for the approach/philosophy: cromatic's and Michael G Schwern's Test::Tutorial pdf. It's the first tutorial I read that said to make your tests fail first, and there's lots of other good tips.
It's really easy to get sidetracked and drawn into details such as code coverage tools like rcov and even more detailed tools such as heckle, flog, flay. These tools are great and they track down bugs but they should be secondary to unit tests being related to design and documentation.
I feel this sums it up - From the agile TDD page
"The act of writing a unit test is more an act of design than of verification."
"It is also more an act of documentation than of verification"

Using Drupal and Ruby. Has anyone integrated both?

I started a small web project and used Drupal to build it. So far, so good: you can quickly set up a nice CMS oriented site, add social features via modules, and you have an extensive API to do the customizations in a nicely architected platform.
The problem comes now: the site is growing beyond what was originally planned for and I find myself in the situation of seriously starting write code for it. While I gained a new respect for PHP thanks to the Drupal project, I want to do it in Ruby. I'll feel more confortable, it'll be easier to maintain later and I can reuse it in other Ruby/Rails apps. Over time I suppose I'll rewrite the existing parts in Drupal in Ruby.
Based on this, the question is: has anyone integrated both (both a success or failure story)? It's quite a big decision, and I just can't find info about anyone who has done it on Google.
Sorry to be negative. This doesn't sound like a good idea to me.
I'll feel more confortable, it'll be easier to maintain later for me and I can reuse it in other Ruby/Rails apps.
I seriously doubt that. It will probably be more difficult to maintain/reuse in the future because of the extra code you will need to write to "integrate" Drupal and Ruby. The more the code, the more the likelihood of bugs. I'm assuming you're going to link the two together using REST/webservices/similar technology -- if that is the case you are writing so much extra code! Gluing the front end elements (which have to be in Drupal) with the functional elements (probably in Ruby) justs sounds so complicated to me.
I'm guessing its only you who is going to be maintaining the code. What if its someone else? Will you easily be able to find someone who has two skill sets (Ruby + Drupal) in your area/budget?
What about giving back to the Drupal community? If your code becomes something useful and its this big mess of Drupal + Ruby you really can't put it up on Drupal.org for others to build, improve and test.
I suggest two options
Use Drupal only.
Sounds like you're in love with Ruby or at any rate just too used to it. In that case: Find a Ruby based CMS! (Sorry I don't know any!)
To me its a classic dilemma: Should you do Drupal Custom Module development which will mean more short term pain cause you'll be out of your comfort zone.... or should you integrate Ruby + Drupal which will be easier in the short run but very painful in the long.
I would choose short term pain :-)
I think the term used to describe your idea is Polyglot Programming: http://memeagora.blogspot.com/2006/12/polyglot-programming.html
One of my criticisms of Drupal is that everything is in Drupal or PHP. Drush is an exception of course but it would be nice to see some development tools that don't use the Drupal stack exclusively. I have used Apache Ant on Drupal with some success (before the days of Drush).
I've also worked on a Drupal project that provided Software as a Service to a Java front end. That didn't work too well but the Drupal Services project has enjoyed some renewed development since then. I've also worked on several Drupal projects that interface with flash front ends (ugg!), google maps and mobile phone gadgets.
Are you thinking of a Service Orientated Architecture? If you're comfortable with that then you could be on the write track to writing truly agile software. I'd like to hear how you go!
However, if your only justification is that your feel more comfortable in Ruby (and I can see why) then, you should probably get yourself out of your comfort zone.

What are some methodologies that a solo developer should use while creating cocoa programs?

I have recently started learning cocoa development with a fairly large scale(probably Core Data based) application in mind as my goal. I have been looking into development methodologies that would be used to help build a higher quality product with better code and although I have found a couple that I am sure I would like to use, such as version control(probably with git) there are some others like unit testing that seem like they would be hard to use when the majority of the application is written with IB and Core Data. I would really appreciate some suggestions as to what tools or workflow methods a solo developer should be using.
Thanks.
P.S. First post in SO!
EDIT: By the way I primarily plan to develop for OS X and not the iPhone.
welcome to SO :-)
One thing I struggle with as a solo dev is discipline...!
Always comment, test, design ahead if you want to increase the quality of your code, reduce the amount of times you re-write something until your interfaces/class structure actually works, and have code that you can come back to in a years time and know what you mean!
Apple have a great guide for Unit Testing
As of iOS 4, Apple have added a UIAutomation framework for testing the User Interface of apps.
O'Reilly has a guide here, and you may want to have a peak at Apple's official documentation for UIAutomation
Its fairly new, but it won't hurt to take a look at it.
There has also been a query on SO about automated testing of iPhone apps.
Our own Chris Hanson did a series of posts about Cocoa and Unit Testing. It isn't as difficult as you think.
use git, it makes it really easy to go back to prior versions
comment your code, as others mentioned you'll need to look at it years later and understand it
get in the habit of building yourself reusable classes. Many tasks you perform when developing will need to be duplicated in other projects
expect that no matter how diligent your try to be, your users will have problems. As such you have to develop a methodology of allowing your customers to report their errors to you that is useful. I recently implemented this for myself. It's basically a way to get meaningful stack traces back from users through email. I learned this here.

How to get involved in development of Mozilla Firefox?

I am a CS grad student, and I am interested in spending some spare time in getting involved with development of Mozilla Firefox web browser . I would like to contribute to HTML renderer , JavaScript engine etc. But I don't have any solid experience in writing parsers or similar stuff, and I don't have any clue from where to start.
There are of course some links in https://developer.mozilla.org/En/Developer_Guide/ but since Firefox is already is very huge project, I don't know from where I should start learning.
So, my question is what core things I need to learn first to get started with Web browser Development and from where I can learn this (any links)? Do I have to revise how to write parsers/compilers? How do I learn to write HTML renderer/ JavaScript engine? Is it even possible considering they are already very huge projects? Sometime back, I downloaded source code of V8 JavaScript engine (http://code.google.com/p/v8/) but I couldn't understand much from it's source code as it was highly optimized code, and there were no much useful comments for beginner like me to understand what going on.
Update:
I am fairly comfortable working with C, C++, Java, PHP, C#, VB.Net, JavaScript and I am more interested in learning how web browser parses an web page, how it constructs and maintains the DOM, how CSS is applied, how HTML reflow engine works, how it interacts with JavaScript engine, how it interacts with web server, how the components are drawn on the screen etc.
Read the docs on getting started. Hang out on irc.mozilla.org in #developers and watch for interesting conversations. Introduce yourself in #introduction and ask questions. Go to http://bugzilla.mozilla.org and start searching for open bugs in components that sound interesting, then look for bugs that catch your fancy. Use tools like http://mxr.mozilla.org/ and http://dxr.mozilla.org to help you locate the relevant code, and ask questions in #developers. Learn, hack, repeat.
I wrote a post about my experiences getting involved over the past year, and it seems to reflect the path that a significant amount of Mozilla developers took.
You might want to review a list of known bugs and see if you're able to fix them. Other possible way to get a foot in the door is to get involved in quality assurance tasks, which would help you learn better internals of the application.
Bugs marked in Bugzilla with the [good first bug] whiteboard status are a good place to start. You can view the list here.
Find something you like and try to fix it! The developers on IRC (#developers in irc.mozilla.org) are usually happy to help when you get stuck.
If you are interested in parsing, learn finite state automata and formal gramars, it should be part of your CS curriculum at some point, like in a compilers class. For the javascript part, study about JIT compilers, specially on how a tracing JIT works. Follow Mozilla development blogs, here is a good starting article:
http://hacks.mozilla.org/2010/03/a-quick-note-on-javascript-engine-components/
Finally, but not least importantly, try to contact people already working there, and try to build a mentor-pupil relationship, they can assign you tasks and can help if you get stuck when working on the code. Going to opensource conferences is a great way to meet the people behind a project and get started contributing.
Mozilla Developer Guide

Resources