hi, I''ve just a doubt about this tests. When (/for what) use for example functional tests instead of integration tests o r unit tests? Can someone explain me this? :) thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
bruce.balmer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Dec-21 15:18 UTC
Re: functional, integration and uni tests: when, what?
unit tests test the model/database part of the operation functional tests test a single controller integration tests test any and all controllers simulating a session by one or more users. I believe that anything done by a functional test could be done by an integration test - I guess that functional tests are slighly simpler and thus better if that is all that is required. I look forward to being corrected by someone better informed --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
bruce.balmer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> unit tests test the model/database part of the operation > functional tests test a single controller > integration tests test any and all controllers simulating a session by > one or more users. > > I believe that anything done by a functional test could be done by an > integration test - I guess that functional tests are slighly simpler > and thus better if that is all that is required. > > I look forward to being corrected by someone better informedok...in a blog(or site, i don''t remember :( ) I''ve read that they use functional tests to test things like layouts, redirections, etc and with integration tests the functionality for each story with/without other stories...what do you think? if you do, for example, some tests about the login as functional tests, with integrations test do you test another time the login ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
dblack-TKXtfPMJ4Ozk1uMJSBkQmQ@public.gmane.org
2006-Dec-21 16:11 UTC
Re: functional, integration and uni tests: when, what?
Hi -- On Thu, 21 Dec 2006, bruce.balmer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > unit tests test the model/database part of the operation > functional tests test a single controller > integration tests test any and all controllers simulating a session by > one or more users. > > I believe that anything done by a functional test could be done by an > integration test - I guess that functional tests are slighly simpler > and thus better if that is all that is required.At RailsConf Europe, the question came up on the core team panel whether functional tests were in effect obsolete because of integration tests. There was some interesting discussion, and a couple of different perspectives. I have to admit I write relatively few functional tests. I''m not claiming that''s a best practice; I just find myself reaching for integration tests, since they are a superset of functional tests and I have no particular reason to favor the "test one controller at a time" principle as long as I feel I''ve tested what I need to. Maybe it''s just that I hit a few cases where I had to jump through hoops to run two controllers in a functional test (e.g., to perform a login and then do something else), so I tended to view integration tests as a superior way to do what I was already doing and more. David -- Q. What''s a good holiday present for the serious Rails developer? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) aka The Ruby book for Rails developers! Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The problem with the Rails 1.2 RC1 is that there are bugs in the API that makes the integration testing very difficult. I have found that unit testing and functional testing helps me to keep moving forward with my project when I am adding features as well as when I am refactoring. Instead of doing integration testing, for the time being I have decided to use Selenium on Rails as a substitute. When the bugs are fixed I will be doing more integration tests. On 12/21/06, dblack-TKXtfPMJ4Ozk1uMJSBkQmQ@public.gmane.org <dblack-TKXtfPMJ4Ozk1uMJSBkQmQ@public.gmane.org> wrote:> > > Maybe it''s just that I hit a few cases where I had to jump through > hoops to run two controllers in a functional test (e.g., to perform a > login and then do something else), so I tended to view integration > tests as a superior way to do what I was already doing and more. > > > David > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 21, 8:10 am, john <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> hi, I''ve just a doubt about this tests. When (/for what) use for example > functional tests instead of integration tests o r unit tests? > Can someone explain me this? :) > thanksIf you''ve never used tests before I would recommend starting with unit tests. They are a little easier to get your head around and form the basis for functional and integration tests. Without good unit tests you''ll end up chasing down model bugs in your functional and integration tests. Aaron --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
john wrote:> > hi, I''ve just a doubt about this tests. When (/for what) use for example > functional tests instead of integration tests o r unit tests? > Can someone explain me this? :) > thanks >I think it''s down to a matter of taste to a fair degree (as the discussion at the London RailsConf demonstrated with core members taking different views. I *prefer* to use functional tests for well defined, encapsulated actions (and they seem to work nicely with REST perhaps for this reason). On the other hand integration tests seem to work better either with a story based approach, or where you are testing a more complicated scenario. Unit tests, however, are my favourite -- particularly now that I''ve embraced the skinny controller fat model approach -- as I like as much of the action to be handled at model level. Just my $0.02 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---