I''m not a paid developer, but I still feel guilty. I thought it might be entertaining to have a little "programmer confession." So let''s hear an answer to this simple question: What makes you guilty about your Rails development? Mine is a bad one: I don''t write tests. I understand that TDD makes sense, but I just don''t do it. I''ve always rationalized "oh I''ll figure out the whole testing thing on the next app" but 5 or 6 apps deep I''ve never done it. Hell, I''ve never even run tests for plugins, Typo, or anything. I skipped the Testing chapter in the Rails book. I know this clearly makes me a bad person. Dave Thomas, if you''re reading this, please don''t repossess my copy of The Pragmatic Programmer! -Jeff
I just started doing unit tests on my current application because I felt bad :) I''ll figure out functional tests on the next app :) -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Jeff Casimir Sent: Thursday, January 12, 2006 2:25 PM To: rails@lists.rubyonrails.org Subject: [Rails] The Guilt List I''m not a paid developer, but I still feel guilty. I thought it might be entertaining to have a little "programmer confession." So let''s hear an answer to this simple question: What makes you guilty about your Rails development? Mine is a bad one: I don''t write tests. I understand that TDD makes sense, but I just don''t do it. I''ve always rationalized "oh I''ll figure out the whole testing thing on the next app" but 5 or 6 apps deep I''ve never done it. Hell, I''ve never even run tests for plugins, Typo, or anything. I skipped the Testing chapter in the Rails book. I know this clearly makes me a bad person. Dave Thomas, if you''re reading this, please don''t repossess my copy of The Pragmatic Programmer! -Jeff _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
The rule is: If you''re going to feel guilty you can go ahead and do anything you want. Have sex with baby goats or start wars. As long as you know you''re guilty! I feel guilty about sleeping late. Also, I sometimes confuse the rules of JavaScript and Ruby. This makes me feel stupid but that''s pretty close to feeling guilty. You know, if we were really organized right we''d have installed Ruby into the web browsers and obsoleted the problem. If I were a consistent person I''d follow that up by advocating running JavaScript on the server. But the thought of giving up Ruby gives me hives. We are all guilty of imposing "Too many languages" on our systems, to the detriment of the managers, customers, and general public. Also, I feel guilty using easy languages like those instead of machine language. I used to be pretty damn good at slinging machine registers and interrupt masks. Warren Seltzer -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Jeff Casimir Sent: Thursday, January 12, 2006 10:25 PM To: rails@lists.rubyonrails.org Subject: [Rails] The Guilt List I''m not a paid developer, but I still feel guilty. I thought it might be entertaining to have a little "programmer confession." So let''s hear an answer to this simple question: What makes you guilty about your Rails development? Mine is a bad one: I don''t write tests. I understand that TDD makes sense, but I just don''t do it. I''ve always rationalized "oh I''ll figure out the whole testing thing on the next app" but 5 or 6 apps deep I''ve never done it. Hell, I''ve never even run tests for plugins, Typo, or anything. I skipped the Testing chapter in the Rails book. I know this clearly makes me a bad person. Dave Thomas, if you''re reading this, please don''t repossess my copy of The Pragmatic Programmer! -Jeff _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
The only guilt I feel in my rails aps is that I now have the time to do things right, including tests, and can bill for the whole thing. With PHP I used to take short cuts and cheat here and there because that is what the clients expected. They wanted something to work in the shortest amount of time possible. Clients still want that, but with Rails, I can indulge in the guilty pleasure of testing first, and still get the job done ahead of schedule. The truth be told, test driven development is actually faster than code - reload, so I''m not sure if it is Rails, Tests, or both that have allowed my my guilty pleasure. But I''ll give credit to Rails because it makes testing so blasted easy. matt On 1/12/06, Hogan, Brian P. <HOGANBP@uwec.edu> wrote:> > I just started doing unit tests on my current application because I felt > bad :) I''ll figure out functional tests on the next app :) > > > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Jeff Casimir > Sent: Thursday, January 12, 2006 2:25 PM > To: rails@lists.rubyonrails.org > Subject: [Rails] The Guilt List > > > I''m not a paid developer, but I still feel guilty. I thought it might > be entertaining to have a little "programmer confession." So let''s hear > > an answer to this simple question: > > What makes you guilty about your Rails development? > > Mine is a bad one: I don''t write tests. I understand that TDD makes > sense, but I just don''t do it. I''ve always rationalized "oh I''ll figure > > out the whole testing thing on the next app" but 5 or 6 apps deep I''ve > never done it. Hell, I''ve never even run tests for plugins, Typo, or > anything. I skipped the Testing chapter in the Rails book. I know this > > clearly makes me a bad person. > > Dave Thomas, if you''re reading this, please don''t repossess my copy of > The Pragmatic Programmer! > > -Jeff > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060112/a5a92dbe/attachment.html
Actually, this is one of the problems with the concept of ''testing'' which implies that the functionality is completed and therefore just needs verification that it works as programmed. However, testing for is not about finding the gaps in my program it is able fleshing out the requirements of the design in a flexible forgiving structure. Good testing is about testing assumptions of the domain model as much as it is about testing the technical implementations. As an example, try this exercise with a small portion of your application. Before you dive into the model and the controller and the view, start writing assumptions you are making about how the application "should" perform. Lets say we have a User model that needs to manage articles and images. Before I have written anything in my model I start brainstorming requirements in my unit tests test_user_create_image test_user_destroy_image test_user_cannot_destroy_others_images test_user_can_relase_ownership_of_image test_user_update test_user_create etc.etc. etc. Immediately, I can start to plan out my application, is it smart to allow the user to create an image from inside the user model? Should it be abstracted into its own image model instead? These questions are easy to answer in tests because the code base is at its most flexible stage. It would be much harder to abstract these relationships when you have a controller and view tied to the assumptions you made about your domain.. Anyway that is my two cents. Mark On 1/12/06, Hogan, Brian P. <HOGANBP@uwec.edu> wrote:> I just started doing unit tests on my current application because I felt > bad :) I''ll figure out functional tests on the next app :) > > > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Jeff Casimir > Sent: Thursday, January 12, 2006 2:25 PM > To: rails@lists.rubyonrails.org > Subject: [Rails] The Guilt List > > > I''m not a paid developer, but I still feel guilty. I thought it might > be entertaining to have a little "programmer confession." So let''s hear > > an answer to this simple question: > > What makes you guilty about your Rails development? > > Mine is a bad one: I don''t write tests. I understand that TDD makes > sense, but I just don''t do it. I''ve always rationalized "oh I''ll figure > > out the whole testing thing on the next app" but 5 or 6 apps deep I''ve > never done it. Hell, I''ve never even run tests for plugins, Typo, or > anything. I skipped the Testing chapter in the Rails book. I know this > > clearly makes me a bad person. > > Dave Thomas, if you''re reading this, please don''t repossess my copy of > The Pragmatic Programmer! > > -Jeff > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- -------------------------------------------------------------------- I am Mark Daggett and I approve this message.
On 1/12/06, Warren Seltzer <warrens@actcom.net.il> wrote:> Have sex with baby goats or start wars. As long as you know you''re guilty!This is not the place to bashing our dear President!
--- Jeff Casimir <jeff@commontext.com> wrote:> What makes you guilty about your Rails development? > > Mine is a bad one: I don''t write tests. I > understand that TDD makes > sense, but I just don''t do it. I''ve always > rationalized "oh I''ll figure > out the whole testing thing on the next app" but 5 > or 6 apps deep I''ve > never done it. Hell, I''ve never even run tests for > plugins, Typo, or > anything. I skipped the Testing chapter in the > Rails book. I know this > clearly makes me a bad person.I''m guilty of that. I''m currently reading the testing chapter in the Agile book, attended a Java testing meeting last night, and can see the value of testing. But writing so many tests just to make sure retrieved data is valid seems unnecessary to me - after all, there are all sorts of validatations that can be placed in models, plus constraints, etc. in the database. It''s all QA though I suppose... I don''t see how TDD is faster, but if it is... csn __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Hey, he admitted it was only one goat... and that the goat reeeeeally liked him. Ironically enough, he passed a consensual goat sex bill under the radar a few years back. Anyhow... I''m guilty of the lack of tests too. I blame tight deadlines, and my rookie status of using Ruby and the Rails framework. That said, I would love to see a screencast of real TDD in action... maybe even vs. the non-TDD approach. On 1/12/06, Mike Pence <mike.pence@gmail.com> wrote:> > On 1/12/06, Warren Seltzer <warrens@actcom.net.il> wrote: > > Have sex with baby goats or start wars. As long as you know you''re > guilty! > > This is not the place to bashing our dear President! > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060112/f9ba9cc9/attachment.html
On 1/12/06, CSN <cool_screen_name90001@yahoo.com> wrote:> > --- Jeff Casimir <jeff@commontext.com> wrote: > > > What makes you guilty about your Rails development? > > > > Mine is a bad one: I don''t write tests. I > > understand that TDD makes > > sense, but I just don''t do it. I''ve always > > rationalized "oh I''ll figure > > out the whole testing thing on the next app" but 5 > > or 6 apps deep I''ve > > never done it. Hell, I''ve never even run tests for > > plugins, Typo, or > > anything. I skipped the Testing chapter in the > > Rails book. I know this > > clearly makes me a bad person. > > I''m guilty of that. I''m currently reading the testing > chapter in the Agile book, attended a Java testing > meeting last night, and can see the value of testing. > But writing so many tests just to make sure retrieved > data is valid seems unnecessary to me - after all, > there are all sorts of validatations that can be > placed in models, plus constraints, etc. in the > database. It''s all QA though I suppose... I don''t see > how TDD is faster, but if it is...Is there a "Non-Testers Anonymous"? I think a 12 step program is in order here for those of us who haven''t quite perfected out testing skills. ;-) Curt
TDD is faster because you code exactly as much as you need to, and nothing more. You lay out the interface to you make it behave properly. Your''re right that the tests themselves are overhead, but you end up saving enough wasted time to more than make up for it. Your code is lean, and you have confidence that it works as advertised. Then as a bonus, when you are done with a module, you have tests in place to make sure the stuff you do next, and a month from now doesn''t break what you just did. No more phone calls on Friday at 4pm from screeming clients, well, less of them anyways. Pretty soon after you are in a testing mindset, you test even for small projects. Its habbit, and because they are similar tests to ones you have written a thousand times before, they take no extra time at all. Then you realize that TDD can cure world hunger, decifer who killed Kennedy, and land you an invitation to a key swapping party at Uma Thurman''s house. After that you realize that TDD just makes you happy, so you start to apply it to other aspects of your life. Test Driven cooking for example - Make eggs - Fail! You don''t have eggs go to the store and buy eggs. Make eggs - Pass, you have eggs to cook. Fail! You didn''t turn on the stove. Turn on the stove. etc.... matt On 1/12/06, Dylan Stamat <dylans@gmail.com> wrote:> > Hey, he admitted it was only one goat... and that the goat reeeeeally > liked him. > Ironically enough, he passed a consensual goat sex bill under the radar a > few years back. > > Anyhow... I''m guilty of the lack of tests too. I blame tight deadlines, > and my rookie status of using Ruby and the Rails framework. > That said, I would love to see a screencast of real TDD in action... maybe > even vs. the non-TDD approach. > > > > > On 1/12/06, Mike Pence <mike.pence@gmail.com> wrote: > > > > On 1/12/06, Warren Seltzer <warrens@actcom.net.il> wrote: > > > Have sex with baby goats or start wars. As long as you know you''re > > guilty! > > > > This is not the place to bashing our dear President! > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060112/447556cc/attachment-0001.html
Jeff Casimir wrote:> Mine is a bad one: I don''t write tests. I understand that TDD makes > sense, but I just don''t do it. I''ve always rationalized "oh I''ll figure > out the whole testing thing on the next app" but 5 or 6 apps deep I''ve > never done it.I too have had guilty feelings about this and I have partially resolved the problem by writing tests, but only realy really simple ones. I don''t do too many unit tests, but it is possible to write a simple functional test that simply runs an action on a controller and verifies that the action worked without any unexpected exceptions being thrown. You don''t *have* to write lots of assertions that all the right things have happened. The test still has some value if it runs and nothing ''blows up''. Having a simple test for each action on each controller means that you can be fairly sure that your changes have not prevented something else from working. For example, you can then remove (what you believe are) obsolete methods from your models and be pretty sure you have not broken anything. Well it works for me and seems to be a reasonable compromise between lots of work and lots of bugs. -- Posted via http://www.ruby-forum.com/.
--- Curt Hibbs <ml.chibbs@gmail.com> wrote:> On 1/12/06, CSN <cool_screen_name90001@yahoo.com> > wrote: > > > > --- Jeff Casimir <jeff@commontext.com> wrote: > > > > > What makes you guilty about your Rails > development? > > > > > > Mine is a bad one: I don''t write tests. I > > > understand that TDD makes > > > sense, but I just don''t do it. I''ve always > > > rationalized "oh I''ll figure > > > out the whole testing thing on the next app" but > 5 > > > or 6 apps deep I''ve > > > never done it. Hell, I''ve never even run tests > for > > > plugins, Typo, or > > > anything. I skipped the Testing chapter in the > > > Rails book. I know this > > > clearly makes me a bad person. > > > > I''m guilty of that. I''m currently reading the > testing > > chapter in the Agile book, attended a Java testing > > meeting last night, and can see the value of > testing. > > But writing so many tests just to make sure > retrieved > > data is valid seems unnecessary to me - after all, > > there are all sorts of validatations that can be > > placed in models, plus constraints, etc. in the > > database. It''s all QA though I suppose... I don''t > see > > how TDD is faster, but if it is... > > Is there a "Non-Testers Anonymous"? I think a 12 > step program is in > order here for those of us who haven''t quite > perfected out testing > skills. ;-) > > CurtHmm, is that before or after "Poor Documentors Anonymous"? ;P Oh wait, the guy from the testing session last night said that testing lends itself to good documentation. Uh oh... csn __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
John Jeffery wrote:> Jeff Casimir wrote: > > >>Mine is a bad one: I don''t write tests. I understand that TDD makes >>sense, but I just don''t do it. I''ve always rationalized "oh I''ll figure >>out the whole testing thing on the next app" but 5 or 6 apps deep I''ve >>never done it. > > > I too have had guilty feelings about this and I have partially resolved > the problem by writing tests, but only realy really simple ones. > > I don''t do too many unit tests, but it is possible to write a simple > functional test that simply runs an action on a controller and verifies > that the action worked without any unexpected exceptions being thrown. > You don''t *have* to write lots of assertions that all the right things > have happened. The test still has some value if it runs and nothing > ''blows up''. > > Having a simple test for each action on each controller means that you > can be fairly sure that your changes have not prevented something else > from working. For example, you can then remove (what you believe are) > obsolete methods from your models and be pretty sure you have not broken > anything. > > Well it works for me and seems to be a reasonable compromise between > lots of work and lots of bugs.These sound like "smoke tests" (as in "connect up all the boxes, turn them all on, and check that no smoke comes out") - useful to check that everything is configured properly. They also sound like tests you have written *after* coding the action. As others have pointed out, TDD is about expressing each tiny piece of requirement unambiguously (as a test) before coding the solution, and being able to focus on just what is needed to satisfy that requirement (pass the test) before moving on to the next one. Reading Kent Beck''s book on Test Driven Development really impressed me with how small the steps can be, and how literally he takes "the simplest thing that could possibly work". Going to an Agile Summer School last summer confirmed this for me. I''ve heard for a long time, and recently been able to see for myself, that you can clearly see the difference between code developed using TDD (clean, small tightly focused methods, highly testable) and code developed "the old way". regards Justin
>> "key swapping party at Uma Thurman''s house"OMG... I''m not even going to write application code anymore... just tests... On 1/12/06, Justin Forder <justin@justinforder.me.uk> wrote:> > John Jeffery wrote: > > Jeff Casimir wrote: > > > > > >>Mine is a bad one: I don''t write tests. I understand that TDD makes > >>sense, but I just don''t do it. I''ve always rationalized "oh I''ll figure > >>out the whole testing thing on the next app" but 5 or 6 apps deep I''ve > >>never done it. > > > > > > I too have had guilty feelings about this and I have partially resolved > > the problem by writing tests, but only realy really simple ones. > > > > I don''t do too many unit tests, but it is possible to write a simple > > functional test that simply runs an action on a controller and verifies > > that the action worked without any unexpected exceptions being thrown. > > You don''t *have* to write lots of assertions that all the right things > > have happened. The test still has some value if it runs and nothing > > ''blows up''. > > > > Having a simple test for each action on each controller means that you > > can be fairly sure that your changes have not prevented something else > > from working. For example, you can then remove (what you believe are) > > obsolete methods from your models and be pretty sure you have not broken > > anything. > > > > Well it works for me and seems to be a reasonable compromise between > > lots of work and lots of bugs. > > These sound like "smoke tests" (as in "connect up all the boxes, turn > them all on, and check that no smoke comes out") - useful to check that > everything is configured properly. They also sound like tests you have > written *after* coding the action. > > As others have pointed out, TDD is about expressing each tiny piece of > requirement unambiguously (as a test) before coding the solution, and > being able to focus on just what is needed to satisfy that requirement > (pass the test) before moving on to the next one. Reading Kent Beck''s > book on Test Driven Development really impressed me with how small the > steps can be, and how literally he takes "the simplest thing that could > possibly work". Going to an Agile Summer School last summer confirmed > this for me. > > I''ve heard for a long time, and recently been able to see for myself, > that you can clearly see the difference between code developed using TDD > (clean, small tightly focused methods, highly testable) and code > developed "the old way". > > regards > > Justin > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060113/cbc08bb8/attachment-0001.html
matthew clark wrote:> TDD is faster because you code exactly as much as you need to, and > nothing more. You lay out the interface to you make it behave > properly. Your''re right that the tests themselves are overhead, but you > end up saving enough wasted time to more than make up for it.That''s the first mistake I made. I only properly came to understand it recently, but tests aren''t overhead at all - they''re what makes it possible to change things with confidence. Without tests, if I made an internal change (maybe putting a DRB proxy in instead of a native object, for example), I had to sit back and rely on user feedback to tell me if I''d b0rked anything. Now I''ve got a bunch of automated users sitting in my test/ directory, actively trying to break my application, that will tell me straight away if they can''t get their job done. Without screaming. Funnily enough, I came to software via ASIC design, where automated testing is so ubiquitous, you almost don''t notice it. It took a few projects without it to realise how valuable a concept it was... -- Alex
Folks- What would everyone think about having a test first challenge for rails? We could run it sort of like ruby-quiz but for rails and TDD. What I envision would be something like this: * Come up with specifications for a small rails app with certain functionality. * Have someone write a full test suite and a reference version of the app that passes all the test. * Then announce the challenge and only give people the description of what the app does, a sql dump or schema.rb and a comprehensive test suite. * Give people like a week to make all the tests pass and then post everyones app somewhere so everyone else could see how others approached the problem domain. I think this would be a cool way for people to learn how to do Rails TDD in a fun competitive environment. Thoughts? Cheers- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster http://yakimaherald.com 509-577-7732 ezra@yakima-herald.com
Are there some good books on test-driven development I can check out? I''m quite intrigued with the concept - I''m brand new to this stuff, having picked up the pickaxe book and Agile Development with Rails two days ago. Exciting times. -- James Hearn
This might be fun, but it is NOT TDD, as the term is understood by those who invented it. TDD is about writing a little bit of test code, then a little bit of production code, then refactoring, and repeating over and over again. It is NOT about writing a full set of tests before you start on any code. The idea is that you''ll always write just enough code to make the next test pass (and keep all older tests passing). This process is supposed to keep your code as simple as possible, while still meeting the requirements. I love and practice TDD. It is not a panacea, of course. Every way of developing software requires smart, hardworking coders and customers to be successful. (First person to find a find a method without these requirements WINS!) Jim -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Ezra Zygmuntowicz Sent: Friday, January 13, 2006 12:26 PM To: rails@lists.rubyonrails.org Subject: Re: [Rails] Re: The Guilt List Folks- What would everyone think about having a test first challenge for rails? We could run it sort of like ruby-quiz but for rails and TDD. What I envision would be something like this: * Come up with specifications for a small rails app with certain functionality. * Have someone write a full test suite and a reference version of the app that passes all the test. * Then announce the challenge and only give people the description of what the app does, a sql dump or schema.rb and a comprehensive test suite. * Give people like a week to make all the tests pass and then post everyones app somewhere so everyone else could see how others approached the problem domain. I think this would be a cool way for people to learn how to do Rails TDD in a fun competitive environment. Thoughts? Cheers- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster http://yakimaherald.com 509-577-7732 ezra@yakima-herald.com _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Fri, Jan 13, 2006 at 10:25:32AM -0800, Ezra Zygmuntowicz wrote:> What would everyone think about having a test first challenge for > rails? We could run it sort of like ruby-quiz but for rails and TDD. > What I envision would be something like this: > > * Come up with specifications for a small rails app with certain > functionality. > * Have someone write a full test suite and a reference version of the > app that passes all the test. > * Then announce the challenge and only give people the description of > what the app does, a sql dump or schema.rb and a comprehensive test > suite. > * Give people like a week to make all the tests pass and then post > everyones app somewhere so everyone else could see how others > approached the problem domain. > > I think this would be a cool way for people to learn how to do Rails > TDD in a fun competitive environment. > > Thoughts?Sounds pretty cool. Definitely worth considering. I''d add the views to the provided skeleton, since the functional testing of Rails is at the controller level, and we don''t want people to spend all their time dickering with prettyness instead of writing code to satisfy the test cases. To make the project a good simulation of TDD, though, you''d need to provide a series of test suites, each with a little more functionality than the last. The instructions to people would be "satisfy all the tests before starting the next lot" -- heh, we could possibly even hack "rake default" to add the next lot of test cases when it detects that the test suite passes completely. Oooh, actually, that''s a really cool idea -- each time the test suite completely passes, you get a paragraph or two blurb of what the next "chunk" of development is, and more test cases get piled on. Then, when you immediately re-run rake, more tests fail, and you go around again. I''m suddenly very enthused for something like this -- but unfortunately I''ve already signed my weekend away to another project. Darn it. Oh well, maybe something to hack on the train (or I could perhaps use my current project as the basis for this... hmm...) - Matt
I have used functional test ONE time. The time I was implementing the tests was _much_ longer than implementing controller/views. So I don''t use them anymore, since controller/view code will be pretty simple anyway. Unit tests for models are great though. Implementation is fast, and they are useful. But my tests pass 80%-90% of the time at the first try if I pay close attention to the code I write. (review every character you type, and think of nicer ways) Make sure you don''t hack together things, and it will be fine. But I actually do hack together tings if I want to do things as fast as possible. Most times it results in having a lot of code in your views, and that results in longer development time because it takes time to move this code to controller/helpers. It would be better if I started with helpers right away. -- Posted via http://www.ruby-forum.com/.
I am not ready for the challenge but I think it is an EXCELLENT idea. I hope lots of you will take Ezra up on his idea. I''ll participate in a challenge a little down the road when I am less of a threat to my own programming happiness. And if I may quote DHH (by implication) "ugliness leads to unhappiness and unhappiness leads to low productivity. Thus.... ugliness leads to low productivity. I am still suffering from coding ugliness (but it is getting more beautiful day by day). bruce On 13-Jan-06, at 11:25 AM, Ezra Zygmuntowicz wrote:> Folks- > > What would everyone think about having a test first challenge for > rails? We could run it sort of like ruby-quiz but for rails and > TDD. What I envision would be something like this: > > * Come up with specifications for a small rails app with certain > functionality. > * Have someone write a full test suite and a reference version of > the app that passes all the test. > * Then announce the challenge and only give people the description > of what the app does, a sql dump or schema.rb and a comprehensive > test suite. > * Give people like a week to make all the tests pass and then post > everyones app somewhere so everyone else could see how others > approached the problem domain. > > I think this would be a cool way for people to learn how to do > Rails TDD in a fun competitive environment. > > Thoughts? > > Cheers- > -Ezra Zygmuntowicz > Yakima Herald-Republic > WebMaster > http://yakimaherald.com > 509-577-7732 > ezra@yakima-herald.com > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
On Jan 13, 2006, at 1:09 PM, Matthew Palmer wrote:> On Fri, Jan 13, 2006 at 10:25:32AM -0800, Ezra Zygmuntowicz wrote: >> What would everyone think about having a test first challenge for >> rails? We could run it sort of like ruby-quiz but for rails and TDD. >> What I envision would be something like this: >> >> * Come up with specifications for a small rails app with certain >> functionality. >> * Have someone write a full test suite and a reference version of the >> app that passes all the test. >> * Then announce the challenge and only give people the description of >> what the app does, a sql dump or schema.rb and a comprehensive test >> suite. >> * Give people like a week to make all the tests pass and then post >> everyones app somewhere so everyone else could see how others >> approached the problem domain. >> >> I think this would be a cool way for people to learn how to do Rails >> TDD in a fun competitive environment. >> >> Thoughts? > > Sounds pretty cool. Definitely worth considering. I''d add the > views to the > provided skeleton, since the functional testing of Rails is at the > controller level, and we don''t want people to spend all their time > dickering > with prettyness instead of writing code to satisfy the test cases. > > To make the project a good simulation of TDD, though, you''d need to > provide > a series of test suites, each with a little more functionality than > the > last. The instructions to people would be "satisfy all the tests > before > starting the next lot" -- heh, we could possibly even hack "rake > default" to > add the next lot of test cases when it detects that the test suite > passes > completely. > > Oooh, actually, that''s a really cool idea -- each time the test suite > completely passes, you get a paragraph or two blurb of what the > next "chunk" > of development is, and more test cases get piled on. Then, when you > immediately re-run rake, more tests fail, and you go around again. > > I''m suddenly very enthused for something like this -- but > unfortunately I''ve > already signed my weekend away to another project. Darn it. Oh > well, maybe > something to hack on the train (or I could perhaps use my current > project as > the basis for this... hmm...) > > - MattYeah the rules would have to be thought out some more. i guess what I suggested isn''t really full blown TDD if you get all the tests to start with and a full schema. But something along these lines would be fun i think. And I like your idea about rake Matt, but maybe that would take too much effort in order to get started. So what about something like this instead: * A description of the functionality of the final app is posted. * It gets broken down into user stories(xp style). * The contestants get a suite of tests for one small user story at a time * Everybody gets a few days to make the tests pass and implement that story I don''t know, its only an idea but I think it would be fun. And i''m open for suggestions. If enough people want to take part in this then I will try to get it organized. So if anyone is interested respond to this thread and say so. if there''s enough people then we can come up with real rules and a gameplan and move forward from there. This should probably be a very small app with maybe 4 or 5 user stories needed to finish the whole thing so it doesn''t take too much time for anyone to finish. Cheers- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster http://yakimaherald.com 509-577-7732 ezra@yakima-herald.com
That sounds like a really interesting idea. I would try to make time for it. On 1/13/06, Ezra Zygmuntowicz <ezra@yakima-herald.com> wrote:> > > On Jan 13, 2006, at 1:09 PM, Matthew Palmer wrote: > > > On Fri, Jan 13, 2006 at 10:25:32AM -0800, Ezra Zygmuntowicz wrote: > >> What would everyone think about having a test first challenge for > >> rails? We could run it sort of like ruby-quiz but for rails and TDD. > >> What I envision would be something like this: > >> > >> * Come up with specifications for a small rails app with certain > >> functionality. > >> * Have someone write a full test suite and a reference version of the > >> app that passes all the test. > >> * Then announce the challenge and only give people the description of > >> what the app does, a sql dump or schema.rb and a comprehensive test > >> suite. > >> * Give people like a week to make all the tests pass and then post > >> everyones app somewhere so everyone else could see how others > >> approached the problem domain. > >> > >> I think this would be a cool way for people to learn how to do > Rails > >> TDD in a fun competitive environment. > >> > >> Thoughts? > > > > Sounds pretty cool. Definitely worth considering. I''d add the > > views to the > > provided skeleton, since the functional testing of Rails is at the > > controller level, and we don''t want people to spend all their time > > dickering > > with prettyness instead of writing code to satisfy the test cases. > > > > To make the project a good simulation of TDD, though, you''d need to > > provide > > a series of test suites, each with a little more functionality than > > the > > last. The instructions to people would be "satisfy all the tests > > before > > starting the next lot" -- heh, we could possibly even hack "rake > > default" to > > add the next lot of test cases when it detects that the test suite > > passes > > completely. > > > > Oooh, actually, that''s a really cool idea -- each time the test suite > > completely passes, you get a paragraph or two blurb of what the > > next "chunk" > > of development is, and more test cases get piled on. Then, when you > > immediately re-run rake, more tests fail, and you go around again. > > > > I''m suddenly very enthused for something like this -- but > > unfortunately I''ve > > already signed my weekend away to another project. Darn it. Oh > > well, maybe > > something to hack on the train (or I could perhaps use my current > > project as > > the basis for this... hmm...) > > > > - Matt > > > Yeah the rules would have to be thought out some more. i guess > what > I suggested isn''t really full blown TDD if you get all the tests to > start with and a full schema. But something along these lines would > be fun i think. > > And I like your idea about rake Matt, but maybe that would take > too > much effort in order to get started. So what about something like > this instead: > > * A description of the functionality of the final app is posted. > * It gets broken down into user stories(xp style). > * The contestants get a suite of tests for one small user story at a > time > * Everybody gets a few days to make the tests pass and implement that > story > > I don''t know, its only an idea but I think it would be fun. And > i''m > open for suggestions. If enough people want to take part in this then > I will try to get it organized. So if anyone is interested respond to > this thread and say so. if there''s enough people then we can come up > with real rules and a gameplan and move forward from there. > > This should probably be a very small app with maybe 4 or 5 user > stories needed to finish the whole thing so it doesn''t take too much > time for > anyone to finish. > > Cheers- > -Ezra Zygmuntowicz > Yakima Herald-Republic > WebMaster > http://yakimaherald.com > 509-577-7732 > ezra@yakima-herald.com > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060114/2d48d259/attachment.html
I''ll do it. I''m a long time tester, burgeoning Rubista. Sounds like fun. matt clark On 1/13/06, Ezra Zygmuntowicz <ezra@yakima-herald.com> wrote:> > > On Jan 13, 2006, at 1:09 PM, Matthew Palmer wrote: > > > On Fri, Jan 13, 2006 at 10:25:32AM -0800, Ezra Zygmuntowicz wrote: > >> What would everyone think about having a test first challenge for > >> rails? We could run it sort of like ruby-quiz but for rails and TDD. > >> What I envision would be something like this: > >> > >> * Come up with specifications for a small rails app with certain > >> functionality. > >> * Have someone write a full test suite and a reference version of the > >> app that passes all the test. > >> * Then announce the challenge and only give people the description of > >> what the app does, a sql dump or schema.rb and a comprehensive test > >> suite. > >> * Give people like a week to make all the tests pass and then post > >> everyones app somewhere so everyone else could see how others > >> approached the problem domain. > >> > >> I think this would be a cool way for people to learn how to do > Rails > >> TDD in a fun competitive environment. > >> > >> Thoughts? > > > > Sounds pretty cool. Definitely worth considering. I''d add the > > views to the > > provided skeleton, since the functional testing of Rails is at the > > controller level, and we don''t want people to spend all their time > > dickering > > with prettyness instead of writing code to satisfy the test cases. > > > > To make the project a good simulation of TDD, though, you''d need to > > provide > > a series of test suites, each with a little more functionality than > > the > > last. The instructions to people would be "satisfy all the tests > > before > > starting the next lot" -- heh, we could possibly even hack "rake > > default" to > > add the next lot of test cases when it detects that the test suite > > passes > > completely. > > > > Oooh, actually, that''s a really cool idea -- each time the test suite > > completely passes, you get a paragraph or two blurb of what the > > next "chunk" > > of development is, and more test cases get piled on. Then, when you > > immediately re-run rake, more tests fail, and you go around again. > > > > I''m suddenly very enthused for something like this -- but > > unfortunately I''ve > > already signed my weekend away to another project. Darn it. Oh > > well, maybe > > something to hack on the train (or I could perhaps use my current > > project as > > the basis for this... hmm...) > > > > - Matt > > > Yeah the rules would have to be thought out some more. i guess > what > I suggested isn''t really full blown TDD if you get all the tests to > start with and a full schema. But something along these lines would > be fun i think. > > And I like your idea about rake Matt, but maybe that would take > too > much effort in order to get started. So what about something like > this instead: > > * A description of the functionality of the final app is posted. > * It gets broken down into user stories(xp style). > * The contestants get a suite of tests for one small user story at a > time > * Everybody gets a few days to make the tests pass and implement that > story > > I don''t know, its only an idea but I think it would be fun. And > i''m > open for suggestions. If enough people want to take part in this then > I will try to get it organized. So if anyone is interested respond to > this thread and say so. if there''s enough people then we can come up > with real rules and a gameplan and move forward from there. > > This should probably be a very small app with maybe 4 or 5 user > stories needed to finish the whole thing so it doesn''t take too much > time for > anyone to finish. > > Cheers- > -Ezra Zygmuntowicz > Yakima Herald-Republic > WebMaster > http://yakimaherald.com > 509-577-7732 > ezra@yakima-herald.com > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060114/667182cd/attachment-0001.html