| || |
Automated SDK testing
We are building a product (internal) that creates SDKs for different APIs, for different programming languages.
This product is based on Swagger-codgen which gets a Swagger file and generates SDK in multiple languages. one of the results of the generating is a 'test' folder that contains basic unit tests functions (in mocha).
I'm trying to figure out how can you do the following:
When an SDK is generated (new one or new version) -
for each language (for example Java, JS) - run some integration test to make sure that the SDK is working.
I prefer it to be automated, and somehow make sure of backward compatibility, but any idea for solution will be welcomed.
Generally SDKs are easy to automate as Unit Tests. But it takes 2 key considerations in order to do so.
1) Mocking - If your SDK has heavy outside interaction, you'll need to do a lot of mocking to avoid using outside dependencies while testing.
2) Dependency Injection - The ability to inject mocks when running the SDK in a test environment.
Using these 2 concepts, you can use unit testing tool to test any backend and middleware layers.
If it is a web application, you can use the selenium framework for testing. This allows you to automate most of it.
SDK = Software Development Kit, generally it's referring to a software module, you won't be able to use Selenium directly. You'll need some sort of test app to create a UI in order for selenium to be effective.
Originally Posted by Shravan83