Application Testing Task
This is one of two possible non-team individual tasks you can do to demonstrate some personal non-trivial agile development skill. You don't need to do if you are satisfied with your grade including your retrospective score.
This task is about automating the testing of your application, with both unit and end to end tests.
Testing Framework
Use the following tools to write and run your tests:
- Karma test runner
- Jasmine
- Protractor for testing a web app
- Appium for testing a hybrid app
Make sure you have not installed Node or Appium with sudo. Appium Getting Started
See How to run npm without sudo.
Your task
If you choose this task, you need to
- Work with your team to decide which part of your client app you're going to test and what you're going to test for
- Install the testing tools locally
- Write at two or three unit tests and two or three end-to-end tests
- Document that the tests can fail
- Easy if you are doing TDD
- If you are doing test-after development, temporarily inserting a plausible mistake into the app code that breaks just the function you are testing, not the entire site
- Fix the code and verify the tests pass
- Merge your branch into master
- Submit documentation requested for the Testing Assignment on Canvas
Make this a useful task, not just a demonstration of how to write tests. The app should be better off for having these tests. Useful tests include
- End to end tests that make sure that a normal happy path through the user screens encounters no error messages.
- End to end tests for common edge cases, e.g., a new user with no data
- Unit tests for non-trivial logic, e.g., anything that sorts, sums, filters, matches, ...
Tips
Merge testing changes frequently with master, to catch any integration issues, like library conflicts. E.g., as soon as you install the testing libraries, merge to master. Just avoid committing and merging when there are failing tests.
The AngularJS Phonecat tutorial includes some nice simple examples of writing both unit tests and end-to-end tests. Note that they create a separate unit directory for unit tests, rather than creating files with _test in their name as the Angular seed project does. That makes more sense to me.
Note: It should be possible to control Appium with JavaScript and NodeJS, but in spring, no one managed to get this to work. Several students were able to control Appium using Java. They had to install the Java SDK and Eclipse. Try JavaScript first. Document what happens, post to the discussion board any tips, successes, obstacles, etc.