Skip to content

App Developers: Using Scripting to Test Your App

Barry Demchak edited this page Jul 9, 2017 · 3 revisions

Without Cytoscape Automation, writing integration tests for your app is very difficult -- apps are usually built to be executed using a keyboard and mouse, which means that testing apps is often difficult and error prone.

Using Cytoscape Automation, you can write comprehensive and repeatable app integration tests using external frameworks (e.g., Jupyter and Eclipse) in the language of your choice (e.g., Python, R, Java and Javascript). These tests are intended to be executed with a running version of Cytoscape, and as such are not integrated with your app's Maven build.

There are several advantages of this type of testing:

  • It encourages the App writer to view their application from the viewpoint of a likely user (the R/Python/Javascript programmer).
  • It can involve code written by app users, themselves. Bug reporters can be encouraged to share code that replicates failure conditions, which can later be included as test cases.
  • Tests written in non-compiled languages (e.g., Python) often can be modified and rerun quickly, which greatly reduces overall development time.

Hint: When creating tests, it is often handy to have the Cytoscape Swagger pages open in a browser (via Cytoscape's Help --> Automation --> CyREST API menu) so you can use the Try it now! button to easily experiment with operations, parameters, and results.

Tests such as these should be included in a clearly named directory in your app's root directory, and should shared in a public repository such as GitHub. This directory should include a file clearly stating the intent of the tests and any necessary instructions on how to run them.

Comments should be provided in code to describe the tests and how they are to be executed.


Examples of integration tests can be found in some of our Sample Apps:

You can’t perform that action at this time.