locked
Authentication in unit testing RRS feed

  • Question

  • [Heavily edited based on the first reply]

    I am working on developing a set of unit tests as part of a VS2008 solution that requires I submit a user name and password so the software being tested can login to another server in order to exercise some file transfer functionality.  Currently I have hard coded the authentication information in code so the test does work but I can't have my user name and password hardcoded for all to see as we utilize a software version control system.

    Is there a standard of some sort that is used to prevent someone from having to hard code their authentication information directly into the test? The environment I work in seriously frowns on that.

    • Edited by edowney Friday, June 5, 2015 4:04 PM
    Thursday, June 4, 2015 5:59 PM

Answers

  • Hi edowney,

    >>It requires I submit a user name and password so the software being tested can login to another server in order to exercise some file transfer functionality. 

    >>Currently I have hard coded the authentication information in code so the test does work but I can't have my user name and password hardcoded for all to see as we utilize a software version control system.

    Could you tell me which kind of app/project did you really test in your VS 2008? What do you mean "login to another server"? Do you run your test project locally or remotely using the TFS or other tools?

    It seems that the real issue is that you have a test project, but you want to limit the user to visit or run your test project, am I right? If so, my understanding it is not the test project issue, the real issue would be related how you really control your test projects. For example, you could use some version control tools like TFS to manage your test projects, so that it could control the access permission for different testers.

    But if you mean that you want to get the result like that the project folder/file is encrypted with code, I'm afraid that it would be not the test issue. But I think you could get better response from the lanague development forum here:

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral%2Cvbgeneral%2Cvcgeneral&filter=alltypes&sort=lastpostdesc

    If I have misunderstood this issue, please feel free to let me know.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, June 10, 2015 7:07 AM

All replies

  • Hi edowney,

    Thanks for posting in the MSDN forum.

    Would you mind letting us know more information about this issue? Do you use the Visual Studio to create a unit test project? If so, which VS version did you use? Which kind of app did you really test?

    >>require I submit a user name and password.  Is there a standard of some sort that is used to prevent someone from having to hard code their authentication information directly into the test?

    How did you create the authentication for the username and password in your unit test project? If you run your test project in VS IDE, we would have the test project code and the class method we want to test, do you mean that someone could download/copy the test project from your machine or others? 

    Maybe you could share us more information about the real situation in you side, so we could understand this issue better. Of course, we have to make sure that whether it is the Visual Studio unit test issue.

    If I have misunderstood this issue, please feel free to let me know.

    Sincerely,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, June 5, 2015 7:51 AM
  • Hi edowney,

    >>It requires I submit a user name and password so the software being tested can login to another server in order to exercise some file transfer functionality. 

    >>Currently I have hard coded the authentication information in code so the test does work but I can't have my user name and password hardcoded for all to see as we utilize a software version control system.

    Could you tell me which kind of app/project did you really test in your VS 2008? What do you mean "login to another server"? Do you run your test project locally or remotely using the TFS or other tools?

    It seems that the real issue is that you have a test project, but you want to limit the user to visit or run your test project, am I right? If so, my understanding it is not the test project issue, the real issue would be related how you really control your test projects. For example, you could use some version control tools like TFS to manage your test projects, so that it could control the access permission for different testers.

    But if you mean that you want to get the result like that the project folder/file is encrypted with code, I'm afraid that it would be not the test issue. But I think you could get better response from the lanague development forum here:

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral%2Cvbgeneral%2Cvcgeneral&filter=alltypes&sort=lastpostdesc

    If I have misunderstood this issue, please feel free to let me know.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, June 10, 2015 7:07 AM