(AIS) Testing and Cleaning Up Your App Lesson

Testing and Cleaning Up Your App

App Inventor makes it easy to test your app while you are designing it and fix any bugs along the way. If you are using the Emulator, you can open the emulator while you are programming the app to get immediately feedback.  

A bug is an error which stops your code working as expected. There are two main types of bugs which can occur in a program:

            ●   Syntax error
This happens when the rules of the language have been broken, e.g. by misspelling a command. Syntax errors usually stop the code from running. Languages like App Inventor provide code in ready-written blocks, so you won't make many syntax errors.

            ●   Logic error
This means your code runs, but doesn't do what you expect.
Unfortunately, it's still possible to make logic errors in App Inventor although it will not allow you to connect certain blocks if it isn't logically correct.

Finding and fixing these errors in a program is known as debugging.

Adding Comments

right click on code block to open this screen:
Duplicate
Add Comment
Collapse Block
Disable Block
Add to Backpack (0)
Delete 3 Blocks
Help

To add comments, right click on the component and choose Add Comment.

It adds a blue icon to the upper left corner. A comment text block will appear. Type your comment into the block that describes what the block will do.

use ? for button to set Text label

Cleaning Up and Arranging Blocks

If you have complex or many blocks of code, the blocks may overlap each other. You can automatically re-arrange blocks by doing the following.

Move the mouse pointer to any part of the white space outside the blocks

  • On Windows, right-click the mouse button
  • On Mac OS X, press Ctrl and click the mouse button

A pop up menu appears with several options to automatically arrange the blocks:

pop up menu selection:
Download Blocks as Image
Collapse Blocks
Expand Blocks
Arrange Blocks Horizontally
Arrange Blocks Vertically
Sort Blocks by Category
Paste All Blocks from Backpack (0)
Copy All Blocks to Backpack
Empty the Backpack
Help

Usability Testing

Usability Testing is a technique used in user-centered interaction design to evaluate a product by testing it on users. Usability testing focuses on measuring a human-made product's capacity to meet its intended purpose.

Go through the learning object below to learn more about how and why it is used in product development.

Before you submit your app for your final project, you will need to do the following;

  • Test your app using the emulator or on your device.  Make any corrections in logic that need to be made.
  • Create comments for your code.  You should have comments for each event handler method and procedure with a brief explanation of what the block of code does.
  • Create comments for global variables.
  • Delete any unused blocks and clean up the appearance of the blocks so it is presented logically and can be seen clearly.

[CC BY 4.0] UNLESS OTHERWISE NOTED | IMAGES: LICENSED AND USED ACCORDING TO TERMS OF SUBSCRIPTION