API Testing framework

This is Syed Aslam Basha here from Information security and risk management team.

For one of my projects I had to test APIs, which takes input string, encode the input and return the encoded output strings. In this blog post am going to give the concept of API testing framework I used to test the APIs using reflection. We have other approaches of API testing like extending unit testing or using PEX.

The framework works in two phases:

Phase1:

  • The framework expects the path with the assembly to be tested
  • Analyzes the assembly, generates the input files and expected files along with folder structure

Phase2:

  • The input and expected files should be updated with required test data
  • Tests each API in the assembly with the set of test input data, compare with the expected data and generates report in output file
  • It generates two reports
    • First report gives information about each API, its input, output and expected values and status for each test data
    • Second report gives overall status of testing along with the API name and its pass/fail status

- Syed Aslam Basha ( syedab@microsoft.com )

Microsoft Information Security Tools (IST) Team

Test Lead

---------------------------------------------------------

Please leave a comment if the blog post has helped you.