locked
Web tests, Classic ASP, code coverage, and VS 2005 RRS feed

  • Question

  •  

    I’ve recently been task to update a classic asp page that we have and it’s quite complicated. I’d like to be sure that I’ve tested every scenario through the page, and as such hit a 100% of the code involved. 

    Google searches didn't turn up much, at least for the terms I used. I know I can use the web test to write tests, but is there a way to enable code coverage on the classic asp?

    Thanks
    Wayne

    Tuesday, November 11, 2008 4:05 PM

Answers

  • HI Wayne
     

    Code coverage works by inserting some code to an assembly. When we execute code in the instrumented assembly, the inserted code will send messages to a monitor process. Thus we know what part of code is executed.

     

    If your asp application relies on some COM assemblies, you can instrument those assemblies from command line with coverage switch and start tests.

     

    Please reference Command-Line Profiling Tools for more information. There are a few links in that page, you may follow How to: Gather Instrumentation Data Using Command-Line Tools. At step 3 for instrumentation, use command VSInstr fileName /coverage. Then you will get coverage data after code in COM is executed.


    Please mark the replies as answers if they help and unmark them if they provide no help.
    • Proposed as answer by Bill.Wang Monday, November 17, 2008 7:48 AM
    • Marked as answer by Bill.Wang Tuesday, November 18, 2008 1:30 PM
    Thursday, November 13, 2008 9:40 AM

All replies

  • HI Wayne
     

    Code coverage works by inserting some code to an assembly. When we execute code in the instrumented assembly, the inserted code will send messages to a monitor process. Thus we know what part of code is executed.

     

    If your asp application relies on some COM assemblies, you can instrument those assemblies from command line with coverage switch and start tests.

     

    Please reference Command-Line Profiling Tools for more information. There are a few links in that page, you may follow How to: Gather Instrumentation Data Using Command-Line Tools. At step 3 for instrumentation, use command VSInstr fileName /coverage. Then you will get coverage data after code in COM is executed.


    Please mark the replies as answers if they help and unmark them if they provide no help.
    • Proposed as answer by Bill.Wang Monday, November 17, 2008 7:48 AM
    • Marked as answer by Bill.Wang Tuesday, November 18, 2008 1:30 PM
    Thursday, November 13, 2008 9:40 AM
  • No com assemblies, was actually trying to ensure that the ASP code was fully covered by my tests. Given the description of how you tell code was executed and classic ASP doesn’t have assemblies I’m guessing I can’t do what I wanted.

    Thanks
    Wayne

    Monday, December 1, 2008 3:26 PM