Unit testing tools for .NET ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    Unit testing tools for .NET ?

    Hi!

    I'm looking for unit-testing tools for .NET.
    Somthing like Java has --> http://www.junit.org


    regards,


    gicio


  • Aravind C

    #2
    Re: Unit testing tools for .NET ?

    HI Gicio,

    Please take alook at NUnit -
    NUnit is the most popular unit test framework for .NET.


    Regards,
    Aravind C


    <gicio@web.de > wrote in message news:bonpl2$1fp mro$1@news.hans enet.net...[color=blue]
    > Hi!
    >
    > I'm looking for unit-testing tools for .NET.
    > Somthing like Java has --> http://www.junit.org
    >
    >
    > regards,
    >
    >
    > gicio
    >
    >[/color]


    Comment

    • Jon Skeet [C# MVP]

      #3
      Re: Unit testing tools for .NET ?

      <gicio@web.de > wrote:[color=blue]
      > I'm looking for unit-testing tools for .NET.
      > Somthing like Java has --> http://www.junit.org[/color]

      See http://nunit.sf.net - and please limit your cross-posting in
      future.

      --
      Jon Skeet - <skeet@pobox.co m>
      Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

      If replying to the group, please do not mail me too

      Comment

      • Sebastien Lambla

        #4
        Re: Unit testing tools for .NET ?

        I may add the excellent NUnit Addin for integration with visual studio.net



        You can also look at mock objects, which are a different approach of unit
        testing...

        --
        Sebastien Lambla



        "Jon Skeet [C# MVP]" <skeet@pobox.co m> a écrit dans le message de news:
        MPG.1a197cc1298 92e43989a63@msn ews.microsoft.c om...[color=blue]
        > <gicio@web.de > wrote:[color=green]
        > > I'm looking for unit-testing tools for .NET.
        > > Somthing like Java has --> http://www.junit.org[/color]
        >
        > See http://nunit.sf.net - and please limit your cross-posting in
        > future.
        >
        > --
        > Jon Skeet - <skeet@pobox.co m>
        > http://www.pobox.com/~skeet
        > If replying to the group, please do not mail me too[/color]


        Comment

        • SBC

          #5
          Re: Unit testing tools for .NET ?

          There's also csUnit (http://www.csunit.org/index.php).
          There's also a weblog posting about unit testing tools:


          SBC


          "Sebastien Lambla" <sebastien.lamb la@6sens.com> wrote in message
          news:uWvGgn4pDH A.1488@TK2MSFTN GP12.phx.gbl...[color=blue]
          > I may add the excellent NUnit Addin for integration with visual studio.net
          >
          > http://weblogs.asp.net/NUnitAddin/
          >
          > You can also look at mock objects, which are a different approach of unit
          > testing...
          >
          > --
          > Sebastien Lambla
          > http://thetechnologist.is-a-geek.com/blog/
          >
          >
          > "Jon Skeet [C# MVP]" <skeet@pobox.co m> a écrit dans le message de news:
          > MPG.1a197cc1298 92e43989a63@msn ews.microsoft.c om...[color=green]
          > > <gicio@web.de > wrote:[color=darkred]
          > > > I'm looking for unit-testing tools for .NET.
          > > > Somthing like Java has --> http://www.junit.org[/color]
          > >
          > > See http://nunit.sf.net - and please limit your cross-posting in
          > > future.
          > >
          > > --
          > > Jon Skeet - <skeet@pobox.co m>
          > > http://www.pobox.com/~skeet
          > > If replying to the group, please do not mail me too[/color]
          >
          >[/color]


          Comment

          • Ben Rush

            #6
            Re: Unit testing tools for .NET ?

            I would be interested in hearing some real-world success stories using Unit
            testing. Our company employed it and I have to honestly say that it really
            didn't help much. I would completely accept the fact that we did it
            incorrect, or used it improperly since this was our first time using it, but
            it just didn't save us from that many bugs.

            Do people typically have the developers who write the code write the unit
            tests? Do you people typically have their QA department write the tests?

            The most practical use we found for unit testing was for "after-the-fact"
            testing. In other words, we identified what area caused a bug, and then
            wrote a unit test to make sure that it was fixed. That way we can regression
            test easier in the future. But, I'm interested in other people's thoughts
            and experiences on this topic. I hear a lot of people point towards NUnit,
            but I never hear how it was used in the field.

            We do web applications, so we used NunitASP as well, but used classic NUnit
            for our libraries.

            Thanks,
            Ben


            "SBC" <esb_us@attbi.c om> wrote in message
            news:uFGej35pDH A.1020@TK2MSFTN GP09.phx.gbl...[color=blue]
            > There's also csUnit (http://www.csunit.org/index.php).
            > There's also a weblog posting about unit testing tools:
            > http://weblogs.asp.net/sbchatterjee/posts/29566.aspx
            >
            > SBC
            >
            >
            > "Sebastien Lambla" <sebastien.lamb la@6sens.com> wrote in message
            > news:uWvGgn4pDH A.1488@TK2MSFTN GP12.phx.gbl...[color=green]
            > > I may add the excellent NUnit Addin for integration with visual[/color][/color]
            studio.net[color=blue][color=green]
            > >
            > > http://weblogs.asp.net/NUnitAddin/
            > >
            > > You can also look at mock objects, which are a different approach of[/color][/color]
            unit[color=blue][color=green]
            > > testing...
            > >
            > > --
            > > Sebastien Lambla
            > > http://thetechnologist.is-a-geek.com/blog/
            > >
            > >
            > > "Jon Skeet [C# MVP]" <skeet@pobox.co m> a écrit dans le message de news:
            > > MPG.1a197cc1298 92e43989a63@msn ews.microsoft.c om...[color=darkred]
            > > > <gicio@web.de > wrote:
            > > > > I'm looking for unit-testing tools for .NET.
            > > > > Somthing like Java has --> http://www.junit.org
            > > >
            > > > See http://nunit.sf.net - and please limit your cross-posting in
            > > > future.
            > > >
            > > > --
            > > > Jon Skeet - <skeet@pobox.co m>
            > > > http://www.pobox.com/~skeet
            > > > If replying to the group, please do not mail me too[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Nicholas Paldino [.NET/C# MVP]

              #7
              Re: Unit testing tools for .NET ?

              Ben,

              I think that having the developers write the testing code is not a good
              idea at all. Granted, they might actually have to ^write^ the code, but the
              user cases should be created by QA or whomever helps decide what the
              functionality should be and how the user will do it. It is a collaborative
              process, because some people can think of things that others can not, but
              generally, the people using the software (or the people who understand how
              it is going to be used) should create the tests.

              Hope this helps.


              --
              - Nicholas Paldino [.NET/C# MVP]
              - mvp@spam.guard. caspershouse.co m


              "Ben Rush" <kwendex@yahoo. com> wrote in message
              news:Otp7kV6pDH A.2820@TK2MSFTN GP10.phx.gbl...[color=blue]
              > I would be interested in hearing some real-world success stories using[/color]
              Unit[color=blue]
              > testing. Our company employed it and I have to honestly say that it really
              > didn't help much. I would completely accept the fact that we did it
              > incorrect, or used it improperly since this was our first time using it,[/color]
              but[color=blue]
              > it just didn't save us from that many bugs.
              >
              > Do people typically have the developers who write the code write the unit
              > tests? Do you people typically have their QA department write the tests?
              >
              > The most practical use we found for unit testing was for "after-the-fact"
              > testing. In other words, we identified what area caused a bug, and then
              > wrote a unit test to make sure that it was fixed. That way we can[/color]
              regression[color=blue]
              > test easier in the future. But, I'm interested in other people's thoughts
              > and experiences on this topic. I hear a lot of people point towards NUnit,
              > but I never hear how it was used in the field.
              >
              > We do web applications, so we used NunitASP as well, but used classic[/color]
              NUnit[color=blue]
              > for our libraries.
              >
              > Thanks,
              > Ben
              >
              >
              > "SBC" <esb_us@attbi.c om> wrote in message
              > news:uFGej35pDH A.1020@TK2MSFTN GP09.phx.gbl...[color=green]
              > > There's also csUnit (http://www.csunit.org/index.php).
              > > There's also a weblog posting about unit testing tools:
              > > http://weblogs.asp.net/sbchatterjee/posts/29566.aspx
              > >
              > > SBC
              > >
              > >
              > > "Sebastien Lambla" <sebastien.lamb la@6sens.com> wrote in message
              > > news:uWvGgn4pDH A.1488@TK2MSFTN GP12.phx.gbl...[color=darkred]
              > > > I may add the excellent NUnit Addin for integration with visual[/color][/color]
              > studio.net[color=green][color=darkred]
              > > >
              > > > http://weblogs.asp.net/NUnitAddin/
              > > >
              > > > You can also look at mock objects, which are a different approach of[/color][/color]
              > unit[color=green][color=darkred]
              > > > testing...
              > > >
              > > > --
              > > > Sebastien Lambla
              > > > http://thetechnologist.is-a-geek.com/blog/
              > > >
              > > >
              > > > "Jon Skeet [C# MVP]" <skeet@pobox.co m> a écrit dans le message de[/color][/color][/color]
              news:[color=blue][color=green][color=darkred]
              > > > MPG.1a197cc1298 92e43989a63@msn ews.microsoft.c om...
              > > > > <gicio@web.de > wrote:
              > > > > > I'm looking for unit-testing tools for .NET.
              > > > > > Somthing like Java has --> http://www.junit.org
              > > > >
              > > > > See http://nunit.sf.net - and please limit your cross-posting in
              > > > > future.
              > > > >
              > > > > --
              > > > > Jon Skeet - <skeet@pobox.co m>
              > > > > http://www.pobox.com/~skeet
              > > > > If replying to the group, please do not mail me too
              > > >
              > > >[/color]
              > >
              > >[/color]
              >
              >[/color]


              Comment

              • Jon Skeet [C# MVP]

                #8
                Re: Unit testing tools for .NET ?

                Nicholas Paldino [.NET/C# MVP] <mvp@spam.guard .caspershouse.c om> wrote:[color=blue]
                > I think that having the developers write the testing code is not a good
                > idea at all. Granted, they might actually have to ^write^ the code, but the
                > user cases should be created by QA or whomever helps decide what the
                > functionality should be and how the user will do it. It is a collaborative
                > process, because some people can think of things that others can not, but
                > generally, the people using the software (or the people who understand how
                > it is going to be used) should create the tests.[/color]

                Most unit tests I've written haven't had anything to do with the user
                experience - that should usually be more covered by system tests (or at
                least, it's considerably harder to unit test than business logic etc).

                IMO, unit tests should (if possible) be written before the code that
                they're testing is written. It shouldn't be about user input, it should
                be about as wacky and wild input as possible to the methods, as well as
                more normal input, of course.

                I don't unit test as often as I probably should, I'm afraid to say, but
                when I do it often has signficant results. Sometimes the unit test code
                ends up being longer than the code it's testing, but it usually finds
                problems which otherwise might not have been found.

                --
                Jon Skeet - <skeet@pobox.co m>
                Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

                If replying to the group, please do not mail me too

                Comment

                • William Stacey

                  #9
                  Re: Unit testing tools for .NET ?

                  I like csunit a little better for c#.

                  --
                  William Stacey, MVP

                  "SBC" <esb_us@attbi.c om> wrote in message
                  news:uFGej35pDH A.1020@TK2MSFTN GP09.phx.gbl...[color=blue]
                  > There's also csUnit (http://www.csunit.org/index.php).
                  > There's also a weblog posting about unit testing tools:
                  > http://weblogs.asp.net/sbchatterjee/posts/29566.aspx
                  >
                  > SBC
                  >
                  >
                  > "Sebastien Lambla" <sebastien.lamb la@6sens.com> wrote in message
                  > news:uWvGgn4pDH A.1488@TK2MSFTN GP12.phx.gbl...[color=green]
                  > > I may add the excellent NUnit Addin for integration with visual[/color][/color]
                  studio.net[color=blue][color=green]
                  > >
                  > > http://weblogs.asp.net/NUnitAddin/
                  > >
                  > > You can also look at mock objects, which are a different approach of[/color][/color]
                  unit[color=blue][color=green]
                  > > testing...
                  > >
                  > > --
                  > > Sebastien Lambla
                  > > http://thetechnologist.is-a-geek.com/blog/
                  > >
                  > >
                  > > "Jon Skeet [C# MVP]" <skeet@pobox.co m> a écrit dans le message de news:
                  > > MPG.1a197cc1298 92e43989a63@msn ews.microsoft.c om...[color=darkred]
                  > > > <gicio@web.de > wrote:
                  > > > > I'm looking for unit-testing tools for .NET.
                  > > > > Somthing like Java has --> http://www.junit.org
                  > > >
                  > > > See http://nunit.sf.net - and please limit your cross-posting in
                  > > > future.
                  > > >
                  > > > --
                  > > > Jon Skeet - <skeet@pobox.co m>
                  > > > http://www.pobox.com/~skeet
                  > > > If replying to the group, please do not mail me too[/color]
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  • Niall

                    #10
                    Re: Unit testing tools for .NET ?

                    I agree with Jon - the test should be written first, and absolutely must be
                    written by the same programmer as is writing the code. There seems to be
                    some confusion over what "unit tests" really are. As far as I've seen, unit
                    tests are small pieces of code written by a programmer to specifically
                    target pieces of required functionality, and ensure that the functionality
                    behaves properly. They're not usually high level tests, they are almost
                    always very small and specific.

                    Tests like someone saying "When I click this button, I want the form to save
                    and bring up the next one" is what I have heard called a User Acceptance
                    Test. A unit test would be more like code that calls a square root function
                    with 4 and makes sure it gets 2 back, then calls it with a few other
                    numbers, and calls it with -1 and makes sure it gets an exception, etc.

                    So with this definition of unit testing in mind, I think it's best that the
                    programmer who will be writing the business logic writes the test, and that
                    they do it first. They write the test to specify exactly what behaviour is
                    expected of the small piece of functionality they are about to write. Then
                    they write the functionality and use the test to tell if they have done it
                    properly. ANy time new functionality is needed or a bug is found, it should
                    be expressed as a test first, then implemented. This way, you end up with a
                    large collection of very small tests, such that when one fails, you get a
                    very strong indication of what has gone wrong, and hence you know where to
                    look.

                    User Acceptance Testing should definitely use tests written by people other
                    than the original programmer...

                    Niall

                    "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
                    news:MPG.1a19d3 30dff99a24989a6 8@msnews.micros oft.com...[color=blue]
                    > Nicholas Paldino [.NET/C# MVP] <mvp@spam.guard .caspershouse.c om> wrote:[color=green]
                    > > I think that having the developers write the testing code is not a[/color][/color]
                    good[color=blue][color=green]
                    > > idea at all. Granted, they might actually have to ^write^ the code, but[/color][/color]
                    the[color=blue][color=green]
                    > > user cases should be created by QA or whomever helps decide what the
                    > > functionality should be and how the user will do it. It is a[/color][/color]
                    collaborative[color=blue][color=green]
                    > > process, because some people can think of things that others can not,[/color][/color]
                    but[color=blue][color=green]
                    > > generally, the people using the software (or the people who understand[/color][/color]
                    how[color=blue][color=green]
                    > > it is going to be used) should create the tests.[/color]
                    >
                    > Most unit tests I've written haven't had anything to do with the user
                    > experience - that should usually be more covered by system tests (or at
                    > least, it's considerably harder to unit test than business logic etc).
                    >
                    > IMO, unit tests should (if possible) be written before the code that
                    > they're testing is written. It shouldn't be about user input, it should
                    > be about as wacky and wild input as possible to the methods, as well as
                    > more normal input, of course.
                    >
                    > I don't unit test as often as I probably should, I'm afraid to say, but
                    > when I do it often has signficant results. Sometimes the unit test code
                    > ends up being longer than the code it's testing, but it usually finds
                    > problems which otherwise might not have been found.
                    >
                    > --
                    > Jon Skeet - <skeet@pobox.co m>
                    > http://www.pobox.com/~skeet
                    > If replying to the group, please do not mail me too[/color]


                    Comment

                    • Alvin Bruney

                      #11
                      Re: Unit testing tools for .NET ?

                      Here is my two pence on this. I've missed the unit testing boat completely.
                      Using the debugger is so hard grained into me that it is extremely painful
                      to do otherwise. Maybe they should start unit tests in school, that way it
                      is part of the process. It would help if a department enforces this as part
                      of its programming requirements, but here, I practically am the dept so
                      enforcement sleeps late most mornings.

                      I'm all for it though, I see it's benefit in eliminating certain types of
                      bugs but bad habits run so deep. In the end, if you do things a certain way,
                      you always will unless you are motivated to do otherwise. The motivation is
                      less for me because what I am doing works reasonably well.

                      regards

                      --


                      -----------
                      Got TidBits?
                      Get it here: www.networkip.net/tidbits
                      "Niall" <asdf@me.com> wrote in message
                      news:eT3X71BqDH A.2592@TK2MSFTN GP10.phx.gbl...[color=blue]
                      > I agree with Jon - the test should be written first, and absolutely must[/color]
                      be[color=blue]
                      > written by the same programmer as is writing the code. There seems to be
                      > some confusion over what "unit tests" really are. As far as I've seen,[/color]
                      unit[color=blue]
                      > tests are small pieces of code written by a programmer to specifically
                      > target pieces of required functionality, and ensure that the functionality
                      > behaves properly. They're not usually high level tests, they are almost
                      > always very small and specific.
                      >
                      > Tests like someone saying "When I click this button, I want the form to[/color]
                      save[color=blue]
                      > and bring up the next one" is what I have heard called a User Acceptance
                      > Test. A unit test would be more like code that calls a square root[/color]
                      function[color=blue]
                      > with 4 and makes sure it gets 2 back, then calls it with a few other
                      > numbers, and calls it with -1 and makes sure it gets an exception, etc.
                      >
                      > So with this definition of unit testing in mind, I think it's best that[/color]
                      the[color=blue]
                      > programmer who will be writing the business logic writes the test, and[/color]
                      that[color=blue]
                      > they do it first. They write the test to specify exactly what behaviour is
                      > expected of the small piece of functionality they are about to write. Then
                      > they write the functionality and use the test to tell if they have done it
                      > properly. ANy time new functionality is needed or a bug is found, it[/color]
                      should[color=blue]
                      > be expressed as a test first, then implemented. This way, you end up with[/color]
                      a[color=blue]
                      > large collection of very small tests, such that when one fails, you get a
                      > very strong indication of what has gone wrong, and hence you know where to
                      > look.
                      >
                      > User Acceptance Testing should definitely use tests written by people[/color]
                      other[color=blue]
                      > than the original programmer...
                      >
                      > Niall
                      >
                      > "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
                      > news:MPG.1a19d3 30dff99a24989a6 8@msnews.micros oft.com...[color=green]
                      > > Nicholas Paldino [.NET/C# MVP] <mvp@spam.guard .caspershouse.c om> wrote:[color=darkred]
                      > > > I think that having the developers write the testing code is not a[/color][/color]
                      > good[color=green][color=darkred]
                      > > > idea at all. Granted, they might actually have to ^write^ the code,[/color][/color][/color]
                      but[color=blue]
                      > the[color=green][color=darkred]
                      > > > user cases should be created by QA or whomever helps decide what the
                      > > > functionality should be and how the user will do it. It is a[/color][/color]
                      > collaborative[color=green][color=darkred]
                      > > > process, because some people can think of things that others can not,[/color][/color]
                      > but[color=green][color=darkred]
                      > > > generally, the people using the software (or the people who understand[/color][/color]
                      > how[color=green][color=darkred]
                      > > > it is going to be used) should create the tests.[/color]
                      > >
                      > > Most unit tests I've written haven't had anything to do with the user
                      > > experience - that should usually be more covered by system tests (or at
                      > > least, it's considerably harder to unit test than business logic etc).
                      > >
                      > > IMO, unit tests should (if possible) be written before the code that
                      > > they're testing is written. It shouldn't be about user input, it should
                      > > be about as wacky and wild input as possible to the methods, as well as
                      > > more normal input, of course.
                      > >
                      > > I don't unit test as often as I probably should, I'm afraid to say, but
                      > > when I do it often has signficant results. Sometimes the unit test code
                      > > ends up being longer than the code it's testing, but it usually finds
                      > > problems which otherwise might not have been found.
                      > >
                      > > --
                      > > Jon Skeet - <skeet@pobox.co m>
                      > > http://www.pobox.com/~skeet
                      > > If replying to the group, please do not mail me too[/color]
                      >
                      >[/color]


                      Comment

                      • Niall

                        #12
                        Re: Unit testing tools for .NET ?

                        Well, the whole idea of test first is very foreign to programmers. Usually
                        programmers think of the problem, think about how they could implement it,
                        scratch out the framework of the solution, think a bit more about how to
                        make it fit the problem, and go.

                        At least this is the way I (used to) work. It seemed odd to me to write a
                        test before I wrote the code, because I didn't actually know exactly what I
                        was doing until I had started putting up the structure and had seen whether
                        my idea would fit or not. By making yourself test first, you're really
                        forcing your mind to split up thinking on "what you need to do" and "how
                        you'll do it". I find that this often results in both a more full
                        examination of requirements, as well as a better implementation. I guess
                        maybe things are different for me, as I'm in a reasonably large team where
                        unit testing is expected of us, so there is more pressure to pick up unit
                        testing, though certainly some have embraced it more than others.

                        Niall

                        "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
                        message news:%2362Q3rGq DHA.2536@tk2msf tngp13.phx.gbl. ..[color=blue]
                        > Here is my two pence on this. I've missed the unit testing boat[/color]
                        completely.[color=blue]
                        > Using the debugger is so hard grained into me that it is extremely painful
                        > to do otherwise. Maybe they should start unit tests in school, that way it
                        > is part of the process. It would help if a department enforces this as[/color]
                        part[color=blue]
                        > of its programming requirements, but here, I practically am the dept so
                        > enforcement sleeps late most mornings.
                        >
                        > I'm all for it though, I see it's benefit in eliminating certain types of
                        > bugs but bad habits run so deep. In the end, if you do things a certain[/color]
                        way,[color=blue]
                        > you always will unless you are motivated to do otherwise. The motivation[/color]
                        is[color=blue]
                        > less for me because what I am doing works reasonably well.
                        >
                        > regards
                        >
                        > --
                        >
                        >
                        > -----------
                        > Got TidBits?
                        > Get it here: www.networkip.net/tidbits
                        > "Niall" <asdf@me.com> wrote in message
                        > news:eT3X71BqDH A.2592@TK2MSFTN GP10.phx.gbl...[color=green]
                        > > I agree with Jon - the test should be written first, and absolutely must[/color]
                        > be[color=green]
                        > > written by the same programmer as is writing the code. There seems to be
                        > > some confusion over what "unit tests" really are. As far as I've seen,[/color]
                        > unit[color=green]
                        > > tests are small pieces of code written by a programmer to specifically
                        > > target pieces of required functionality, and ensure that the[/color][/color]
                        functionality[color=blue][color=green]
                        > > behaves properly. They're not usually high level tests, they are almost
                        > > always very small and specific.
                        > >
                        > > Tests like someone saying "When I click this button, I want the form to[/color]
                        > save[color=green]
                        > > and bring up the next one" is what I have heard called a User Acceptance
                        > > Test. A unit test would be more like code that calls a square root[/color]
                        > function[color=green]
                        > > with 4 and makes sure it gets 2 back, then calls it with a few other
                        > > numbers, and calls it with -1 and makes sure it gets an exception, etc.
                        > >
                        > > So with this definition of unit testing in mind, I think it's best that[/color]
                        > the[color=green]
                        > > programmer who will be writing the business logic writes the test, and[/color]
                        > that[color=green]
                        > > they do it first. They write the test to specify exactly what behaviour[/color][/color]
                        is[color=blue][color=green]
                        > > expected of the small piece of functionality they are about to write.[/color][/color]
                        Then[color=blue][color=green]
                        > > they write the functionality and use the test to tell if they have done[/color][/color]
                        it[color=blue][color=green]
                        > > properly. ANy time new functionality is needed or a bug is found, it[/color]
                        > should[color=green]
                        > > be expressed as a test first, then implemented. This way, you end up[/color][/color]
                        with[color=blue]
                        > a[color=green]
                        > > large collection of very small tests, such that when one fails, you get[/color][/color]
                        a[color=blue][color=green]
                        > > very strong indication of what has gone wrong, and hence you know where[/color][/color]
                        to[color=blue][color=green]
                        > > look.
                        > >
                        > > User Acceptance Testing should definitely use tests written by people[/color]
                        > other[color=green]
                        > > than the original programmer...
                        > >
                        > > Niall
                        > >
                        > > "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
                        > > news:MPG.1a19d3 30dff99a24989a6 8@msnews.micros oft.com...[color=darkred]
                        > > > Nicholas Paldino [.NET/C# MVP] <mvp@spam.guard .caspershouse.c om>[/color][/color][/color]
                        wrote:[color=blue][color=green][color=darkred]
                        > > > > I think that having the developers write the testing code is not[/color][/color][/color]
                        a[color=blue][color=green]
                        > > good[color=darkred]
                        > > > > idea at all. Granted, they might actually have to ^write^ the code,[/color][/color]
                        > but[color=green]
                        > > the[color=darkred]
                        > > > > user cases should be created by QA or whomever helps decide what the
                        > > > > functionality should be and how the user will do it. It is a[/color]
                        > > collaborative[color=darkred]
                        > > > > process, because some people can think of things that others can[/color][/color][/color]
                        not,[color=blue][color=green]
                        > > but[color=darkred]
                        > > > > generally, the people using the software (or the people who[/color][/color][/color]
                        understand[color=blue][color=green]
                        > > how[color=darkred]
                        > > > > it is going to be used) should create the tests.
                        > > >
                        > > > Most unit tests I've written haven't had anything to do with the user
                        > > > experience - that should usually be more covered by system tests (or[/color][/color][/color]
                        at[color=blue][color=green][color=darkred]
                        > > > least, it's considerably harder to unit test than business logic etc).
                        > > >
                        > > > IMO, unit tests should (if possible) be written before the code that
                        > > > they're testing is written. It shouldn't be about user input, it[/color][/color][/color]
                        should[color=blue][color=green][color=darkred]
                        > > > be about as wacky and wild input as possible to the methods, as well[/color][/color][/color]
                        as[color=blue][color=green][color=darkred]
                        > > > more normal input, of course.
                        > > >
                        > > > I don't unit test as often as I probably should, I'm afraid to say,[/color][/color][/color]
                        but[color=blue][color=green][color=darkred]
                        > > > when I do it often has signficant results. Sometimes the unit test[/color][/color][/color]
                        code[color=blue][color=green][color=darkred]
                        > > > ends up being longer than the code it's testing, but it usually finds
                        > > > problems which otherwise might not have been found.
                        > > >
                        > > > --
                        > > > Jon Skeet - <skeet@pobox.co m>
                        > > > http://www.pobox.com/~skeet
                        > > > If replying to the group, please do not mail me too[/color]
                        > >
                        > >[/color]
                        >
                        >[/color]


                        Comment

                        • Alvin Pruney

                          #13
                          Re: Unit testing tools for .NET ?

                          Built verification testing is perfect for automation as is pre checkin
                          automated testing to prevent build breaks.



                          "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> wrote in
                          message news:#62Q3rGqDH A.2536@tk2msftn gp13.phx.gbl...[color=blue]
                          > Here is my two pence on this. I've missed the unit testing boat[/color]
                          completely.[color=blue]
                          > Using the debugger is so hard grained into me that it is extremely painful
                          > to do otherwise. Maybe they should start unit tests in school, that way it
                          > is part of the process. It would help if a department enforces this as[/color]
                          part[color=blue]
                          > of its programming requirements, but here, I practically am the dept so
                          > enforcement sleeps late most mornings.
                          >
                          > I'm all for it though, I see it's benefit in eliminating certain types of
                          > bugs but bad habits run so deep. In the end, if you do things a certain[/color]
                          way,[color=blue]
                          > you always will unless you are motivated to do otherwise. The motivation[/color]
                          is[color=blue]
                          > less for me because what I am doing works reasonably well.
                          >
                          > regards
                          >
                          > --
                          >
                          >
                          > -----------
                          > Got TidBits?
                          > Get it here: www.networkip.net/tidbits
                          > "Niall" <asdf@me.com> wrote in message
                          > news:eT3X71BqDH A.2592@TK2MSFTN GP10.phx.gbl...[color=green]
                          > > I agree with Jon - the test should be written first, and absolutely must[/color]
                          > be[color=green]
                          > > written by the same programmer as is writing the code. There seems to be
                          > > some confusion over what "unit tests" really are. As far as I've seen,[/color]
                          > unit[color=green]
                          > > tests are small pieces of code written by a programmer to specifically
                          > > target pieces of required functionality, and ensure that the[/color][/color]
                          functionality[color=blue][color=green]
                          > > behaves properly. They're not usually high level tests, they are almost
                          > > always very small and specific.
                          > >
                          > > Tests like someone saying "When I click this button, I want the form to[/color]
                          > save[color=green]
                          > > and bring up the next one" is what I have heard called a User Acceptance
                          > > Test. A unit test would be more like code that calls a square root[/color]
                          > function[color=green]
                          > > with 4 and makes sure it gets 2 back, then calls it with a few other
                          > > numbers, and calls it with -1 and makes sure it gets an exception, etc.
                          > >
                          > > So with this definition of unit testing in mind, I think it's best that[/color]
                          > the[color=green]
                          > > programmer who will be writing the business logic writes the test, and[/color]
                          > that[color=green]
                          > > they do it first. They write the test to specify exactly what behaviour[/color][/color]
                          is[color=blue][color=green]
                          > > expected of the small piece of functionality they are about to write.[/color][/color]
                          Then[color=blue][color=green]
                          > > they write the functionality and use the test to tell if they have done[/color][/color]
                          it[color=blue][color=green]
                          > > properly. ANy time new functionality is needed or a bug is found, it[/color]
                          > should[color=green]
                          > > be expressed as a test first, then implemented. This way, you end up[/color][/color]
                          with[color=blue]
                          > a[color=green]
                          > > large collection of very small tests, such that when one fails, you get[/color][/color]
                          a[color=blue][color=green]
                          > > very strong indication of what has gone wrong, and hence you know where[/color][/color]
                          to[color=blue][color=green]
                          > > look.
                          > >
                          > > User Acceptance Testing should definitely use tests written by people[/color]
                          > other[color=green]
                          > > than the original programmer...
                          > >
                          > > Niall
                          > >
                          > > "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
                          > > news:MPG.1a19d3 30dff99a24989a6 8@msnews.micros oft.com...[color=darkred]
                          > > > Nicholas Paldino [.NET/C# MVP] <mvp@spam.guard .caspershouse.c om>[/color][/color][/color]
                          wrote:[color=blue][color=green][color=darkred]
                          > > > > I think that having the developers write the testing code is not[/color][/color][/color]
                          a[color=blue][color=green]
                          > > good[color=darkred]
                          > > > > idea at all. Granted, they might actually have to ^write^ the code,[/color][/color]
                          > but[color=green]
                          > > the[color=darkred]
                          > > > > user cases should be created by QA or whomever helps decide what the
                          > > > > functionality should be and how the user will do it. It is a[/color]
                          > > collaborative[color=darkred]
                          > > > > process, because some people can think of things that others can[/color][/color][/color]
                          not,[color=blue][color=green]
                          > > but[color=darkred]
                          > > > > generally, the people using the software (or the people who[/color][/color][/color]
                          understand[color=blue][color=green]
                          > > how[color=darkred]
                          > > > > it is going to be used) should create the tests.
                          > > >
                          > > > Most unit tests I've written haven't had anything to do with the user
                          > > > experience - that should usually be more covered by system tests (or[/color][/color][/color]
                          at[color=blue][color=green][color=darkred]
                          > > > least, it's considerably harder to unit test than business logic etc).
                          > > >
                          > > > IMO, unit tests should (if possible) be written before the code that
                          > > > they're testing is written. It shouldn't be about user input, it[/color][/color][/color]
                          should[color=blue][color=green][color=darkred]
                          > > > be about as wacky and wild input as possible to the methods, as well[/color][/color][/color]
                          as[color=blue][color=green][color=darkred]
                          > > > more normal input, of course.
                          > > >
                          > > > I don't unit test as often as I probably should, I'm afraid to say,[/color][/color][/color]
                          but[color=blue][color=green][color=darkred]
                          > > > when I do it often has signficant results. Sometimes the unit test[/color][/color][/color]
                          code[color=blue][color=green][color=darkred]
                          > > > ends up being longer than the code it's testing, but it usually finds
                          > > > problems which otherwise might not have been found.
                          > > >
                          > > > --
                          > > > Jon Skeet - <skeet@pobox.co m>
                          > > > http://www.pobox.com/~skeet
                          > > > If replying to the group, please do not mail me too[/color]
                          > >
                          > >[/color]
                          >
                          >[/color]


                          Comment

                          • Taylor

                            #14
                            Re: Unit testing tools for .NET ?

                            Why do you prefer csunit?


                            "William Stacey" <staceywREMOVE@ mvps.org> wrote in message
                            news:udpu8Y9pDH A.2232@TK2MSFTN GP09.phx.gbl...[color=blue]
                            > I like csunit a little better for c#.
                            >
                            > --
                            > William Stacey, MVP
                            >
                            > "SBC" <esb_us@attbi.c om> wrote in message
                            > news:uFGej35pDH A.1020@TK2MSFTN GP09.phx.gbl...[color=green]
                            > > There's also csUnit (http://www.csunit.org/index.php).
                            > > There's also a weblog posting about unit testing tools:
                            > > http://weblogs.asp.net/sbchatterjee/posts/29566.aspx
                            > >
                            > > SBC
                            > >
                            > >
                            > > "Sebastien Lambla" <sebastien.lamb la@6sens.com> wrote in message
                            > > news:uWvGgn4pDH A.1488@TK2MSFTN GP12.phx.gbl...[color=darkred]
                            > > > I may add the excellent NUnit Addin for integration with visual[/color][/color]
                            > studio.net[color=green][color=darkred]
                            > > >
                            > > > http://weblogs.asp.net/NUnitAddin/
                            > > >
                            > > > You can also look at mock objects, which are a different approach of[/color][/color]
                            > unit[color=green][color=darkred]
                            > > > testing...
                            > > >
                            > > > --
                            > > > Sebastien Lambla
                            > > > http://thetechnologist.is-a-geek.com/blog/
                            > > >
                            > > >
                            > > > "Jon Skeet [C# MVP]" <skeet@pobox.co m> a écrit dans le message de[/color][/color][/color]
                            news:[color=blue][color=green][color=darkred]
                            > > > MPG.1a197cc1298 92e43989a63@msn ews.microsoft.c om...
                            > > > > <gicio@web.de > wrote:
                            > > > > > I'm looking for unit-testing tools for .NET.
                            > > > > > Somthing like Java has --> http://www.junit.org
                            > > > >
                            > > > > See http://nunit.sf.net - and please limit your cross-posting in
                            > > > > future.
                            > > > >
                            > > > > --
                            > > > > Jon Skeet - <skeet@pobox.co m>
                            > > > > http://www.pobox.com/~skeet
                            > > > > If replying to the group, please do not mail me too
                            > > >
                            > > >[/color]
                            > >
                            > >[/color]
                            >
                            >[/color]


                            Comment

                            • Peter Provost

                              #15
                              Re: Unit testing tools for .NET ?

                              Don't forget that csUnit has been released under the GPL (NUnit is not)
                              which can have an impact on what you can do with it if you produce
                              commercial systems (if you want to ship your test libraries or include the
                              tests directly in your production assembly for example).

                              --
                              ----------------------------------------------------------------
                              Peter Provost
                              Weblog: http://www.peterprovost.org/
                              ----------------------------------------------------------------



                              "William Stacey" <staceywREMOVE@ mvps.org> wrote in message
                              news:udpu8Y9pDH A.2232@TK2MSFTN GP09.phx.gbl...[color=blue]
                              > I like csunit a little better for c#.
                              >
                              > --
                              > William Stacey, MVP
                              >
                              > "SBC" <esb_us@attbi.c om> wrote in message
                              > news:uFGej35pDH A.1020@TK2MSFTN GP09.phx.gbl...[color=green]
                              > > There's also csUnit (http://www.csunit.org/index.php).
                              > > There's also a weblog posting about unit testing tools:
                              > > http://weblogs.asp.net/sbchatterjee/posts/29566.aspx
                              > >
                              > > SBC
                              > >
                              > >
                              > > "Sebastien Lambla" <sebastien.lamb la@6sens.com> wrote in message
                              > > news:uWvGgn4pDH A.1488@TK2MSFTN GP12.phx.gbl...[color=darkred]
                              > > > I may add the excellent NUnit Addin for integration with visual[/color][/color]
                              > studio.net[color=green][color=darkred]
                              > > >
                              > > > http://weblogs.asp.net/NUnitAddin/
                              > > >
                              > > > You can also look at mock objects, which are a different approach of[/color][/color]
                              > unit[color=green][color=darkred]
                              > > > testing...
                              > > >
                              > > > --
                              > > > Sebastien Lambla
                              > > > http://thetechnologist.is-a-geek.com/blog/
                              > > >
                              > > >
                              > > > "Jon Skeet [C# MVP]" <skeet@pobox.co m> a écrit dans le message de[/color][/color][/color]
                              news:[color=blue][color=green][color=darkred]
                              > > > MPG.1a197cc1298 92e43989a63@msn ews.microsoft.c om...
                              > > > > <gicio@web.de > wrote:
                              > > > > > I'm looking for unit-testing tools for .NET.
                              > > > > > Somthing like Java has --> http://www.junit.org
                              > > > >
                              > > > > See http://nunit.sf.net - and please limit your cross-posting in
                              > > > > future.
                              > > > >
                              > > > > --
                              > > > > Jon Skeet - <skeet@pobox.co m>
                              > > > > http://www.pobox.com/~skeet
                              > > > > If replying to the group, please do not mail me too
                              > > >
                              > > >[/color]
                              > >
                              > >[/color]
                              >
                              >[/color]


                              Comment

                              Working...