Why should you test code? The answer is to convince your self that your code has no bugs. We can’t complete this class without rudimentary knowledge of how you test code you have written. In industry as an intern you will have to write, test and debug your code.
So the reason you test is to convince yourself of the absence of bugs. Debugging is when you find a bug. Once testing finds bugs then you debug them. In this TestThis code you do not know if there are bugs or not. )
So consider this brief lab as important in your Android toolkit. The idea of testing is to prove the absence of bugs. Debugging is getting rid of bugs that you’ve identified. In this lab you have to write test cases for unit testing of the code. We are providing you with a version of MyRuns1, in which we have included a test class called- ProfileActivityTest.
To help, we have even written two test cases to help you get started. We have created methods for you to write your own test cases.
Before you start this assignment take care to read the following notes on unit testing below from the class webpage so you fully understand the idea behind testing your Android code. Do not blindly dive in and start the assignment without reading these notes -- message: reading the class notes on testing will save you time
Next: once you understand the code to be tested (see below) and the test package run the code with your phone plugged in. You should see the unit test examples of the UI of your phone -- they are displayed quickly so watch the display.
Finally, start writing each test case and make sure it “asserts” correctly. You will see in the notes that we describe each test case at a high level. You need to write the test case code and run the tests. The examples we give you will guide you.