locked
Any tool exist for automatic unit test code generation purpose RRS feed

  • Question

  • other than IntelliTest is there any tool we can use to generate unit test code for our whole project?

    see if we need to write unit test code for a whole project then we have to spend more time for that project....so more time required to finish the project to deliver to client.

    [TestMethod]
    publicvoid TestSumResultAreEqual()
    {
       MathLibrary.MathClass objMath = new MathClass(); 
       Assert.AreEqual(24, objMath.Sum(12, 12));
    }

    so why we waste time to write unit test code. so guide me how could i generate unit test code with any tools. thanks

    • Moved by Fei Hu Friday, December 1, 2017 1:52 AM
    Thursday, November 30, 2017 7:14 PM

Answers

  • other than IntelliTest is there any tool we can use to generate unit test code for our whole project?

    No, and it's a lazy developer's way of doing things. It's not an optimal way of writing unit tests.

    see if we need to write unit test code for a whole project then we have to spend more time for that project....so more time required to finish the project to deliver to client.

    You give the client a project that is bug free as much as possible is the point of unit and integration testing code in the project. Spending time doing unit and integration testing pays off in the long run in the development life cycle in developing a solution that bug free.so why we waste time to write unit test code.

    What is Test Driven Design?

    http://www.drdobbs.com/architecture-and-design/test-driven-design/240168102

    Why unit test?

    https://www.guru99.com/unit-testing-guide.html

     so guide me how could i generate unit test code with any tools.

    Time should be included in the project development life cycle for unit testing, and see my first reply about some solution to generate unit testing code, which should be done by the developer on a case by case to test the correctness of the code for a given method or function.

    • Proposed as answer by KareninstructorMVP Thursday, November 30, 2017 8:49 PM
    • Marked as answer by Sudip_inn Thursday, December 7, 2017 12:01 PM
    Thursday, November 30, 2017 8:44 PM
  • I'd say as DA924x mentioned on TDD (Test Driven Development) if you have the funds check out SpeckFlow which allows you to write up what to test in Excel and SpecFlow will generate a framework of test methods for you thinking that you have not written your code to test yet. They have templates right in Visual Studio to assist too e.g.

    We start off in TFS, write out stories and task followed by development of test then application code from the unit test.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, November 30, 2017 8:53 PM

All replies

  • other than IntelliTest is there any tool we can use to generate unit test code for our whole project?

    No, and it's a lazy developer's way of doing things. It's not an optimal way of writing unit tests.

    see if we need to write unit test code for a whole project then we have to spend more time for that project....so more time required to finish the project to deliver to client.

    You give the client a project that is bug free as much as possible is the point of unit and integration testing code in the project. Spending time doing unit and integration testing pays off in the long run in the development life cycle in developing a solution that bug free.so why we waste time to write unit test code.

    What is Test Driven Design?

    http://www.drdobbs.com/architecture-and-design/test-driven-design/240168102

    Why unit test?

    https://www.guru99.com/unit-testing-guide.html

     so guide me how could i generate unit test code with any tools.

    Time should be included in the project development life cycle for unit testing, and see my first reply about some solution to generate unit testing code, which should be done by the developer on a case by case to test the correctness of the code for a given method or function.

    • Proposed as answer by KareninstructorMVP Thursday, November 30, 2017 8:49 PM
    • Marked as answer by Sudip_inn Thursday, December 7, 2017 12:01 PM
    Thursday, November 30, 2017 8:44 PM
  • I'd say as DA924x mentioned on TDD (Test Driven Development) if you have the funds check out SpeckFlow which allows you to write up what to test in Excel and SpecFlow will generate a framework of test methods for you thinking that you have not written your code to test yet. They have templates right in Visual Studio to assist too e.g.

    We start off in TFS, write out stories and task followed by development of test then application code from the unit test.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, November 30, 2017 8:53 PM
  • Hello Sudip_inn,

    Your question is more related to unit test, I will move the thread to Visual Studio unit testing forum for suitable support.

    If you have some grammar or code errors in using C#, please feel free to contact us. We will try our best to give you a solution.

    Best Regards,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 1, 2017 1:51 AM
  • So far there is no that tool to generate Unit test code automatically in Visual Studio.

    I did not find any extension to work around it, of course you could share us with this tool if you find any, so far I'm afraid that we still have to write the unit test code manually.

    Your understanding and cooperation will be grateful. 

      

    Regards,

    Fletcher  


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Fletch Zhou Thursday, December 7, 2017 6:17 AM
    Thursday, December 7, 2017 6:17 AM