Loading ...
Sorry, an error occurred while loading the content.

56972Re: [scrumdevelopment] Convince the team of writing unit tests even if you have got integration tests

Expand Messages
  • David Karr
    Jun 24, 2013
    • 0 Attachment
      Integration tests are often fragile, because they often depend on test data resources.  When integration tests fail, it's often ambiguous whether it really represents a test failure, or simply obsolete data.  Because of this, integration tests require more maintenance, and are often ignored.

      Unit tests run very quickly, and should run as part of the normal developer build.  Test failures come quickly, resulting in a shorter feedback cycle.

      An additional value of unit tests is as documentation of the "code under test".  New developers can read the unit tests to understand the requirements of the business logic in question.  This doesn't work as well with integration tests.


      On Mon, Jun 24, 2013 at 1:52 PM, Adam Sroka <adam.sroka@...> wrote:
       

      Problems with integration tests:

      1) They take longer to execute. This makes the feedback loop slower which means they run less often. 

      2) They consume more resources to execute. You may need beefier hardware and/or you may have problems doing other things while they run. 

      3) They often have complex dependencies, e.g. running web servers, databases, message buses, etc. These consume resources and may cause intermittent failures that are hard to diagnose. 

      4) They are uninformative, i.e. when they fail it may take considerable time/effort to find out why. 

      5) They touch many parts of the system at once. Assuming decisions are made in each of these parts it may take a very large number of tests to exercise all meaningful permutations. 


      On Fri, Jun 21, 2013 at 2:53 AM, <m.schneider@...> wrote:
       

      Hi,

      I'm working with a new team and try to convince the team members that it
      is important to write unit tests and have got covered at least methods
      which consist of logic. Also it is important (for me) to write unit
      tests for existing code if you touch it and it is not covered yet.
      Unfortunately some of the team members tell me that they do not want to
      write unit tests because we have got integration tests and those will
      test the correctness of the code and with that make unit tests
      unnecessary.

      What can I tell those guys why it is important to write unit tests even
      if you have got integration tests?

      Thanks,
      Martin



    • Show all 8 messages in this topic