locked
What are the unit testing tools can be used for verification of C# source code? RRS feed

  • Question

  • Hello All,

    We have a software which is developed in C# for safety critical application, but not sure which unit testing tools can be used to verify it.

    Expecting similar to RTRT, LDRA, vector cast tool which can be used to verify ADA and C source code and provide the coverage like structural coverage(code coverage), statement, decision and MCDC coverages.

    please suggest similar verification tools for C#

    Thanks and Regards,

    Hari

    Hello All,<o:p></o:p>

    We have a software which is developed in C# for safety critical application, but not sure which unit testing tools can be used to verify it.<o:p></o:p>

    Expecting similar to RTRT, LDRA, vector cast tool which can be used to verify ADA and C source code and provide the coverage like structural coverage(code coverage), statement, decision and MCDC coverages.<o:p></o:p>

    please suggest similar verification tools for C#<o:p></o:p>

    <o:p> </o:p>



    click "Proposed As Answer by" if this post solves your problem or "Vote As Helpful" if a post has been useful to you Happy Programming! Hari

    Thursday, March 28, 2019 12:17 PM

All replies

  • Hello,

    If the software is your's (is easier as you have the code) or if a third party library then you can write unit test from the available unit test projects in Visual Studio. I'd suggest writing up test cases using Gherkin.


    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Thursday, March 28, 2019 12:44 PM
  • In regards to the verifiable side of the fence also note that code coverage is an option you can turn on for unit tests to verify you are covering all the code.

    But note that unit testing is verifying behavior, not correctness. In general I would never throw Ada (a verifiably correct language) into the same bowl as C (not verifiable). C# is considered verifiable if you avoid anything outside of C# (aka P/Invoke) but in most apps you'll have at least a little of that. 


    Michael Taylor http://www.michaeltaylorp3.net

    Thursday, March 28, 2019 1:54 PM
  • Hi Hariprasadbrk,

    Thank you for posting here.

    For your question is more related to unit test, you could post a new thread in Unit Test forum for suitable support.

    The Visual C# forum discuss and ask questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Wendy


    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, March 29, 2019 3:14 AM
  • Hi friend,

    Welcome to MSDN forum.

    As in VS, to do unit tests you can use the C# test projects like what Kareninstructor shows. 

    You can find the detailed introduction according to Unit Test Basices.

    The Unit Test project in VS can provide many functions for testing C# code. Like code coverage, live Unit Testing, IntellitestAssert Class, Data-Driven Test, Microsoft fakes and so on.

    You can check if this framework can satisfy your needs. Hope all above helps. 

    Any update please feel free to contact us.

    Best Regards

    Lance


    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, March 29, 2019 5:30 AM