Unit 11.3C · Term 3

Publishing Applications

After building and programming your mobile application, the final steps are testing, debugging, and distributing it to users. This lesson covers the full lifecycle from testing on devices to generating an APK file, and discusses the software development lifecycle (SDLC) stages that professional developers follow. Understanding this process is essential for exam questions about software engineering practices.

Learning Objectives

  • 11.5.4.6 Test and debug a mobile application
  • 11.5.4.7 Publish / distribute a mobile application

Lesson Presentation

11.3C-publishing-apps.pdf · Slides for classroom use

Testing Your Application

Three Ways to Test

Method How Pros Cons
AI Companion (Live Testing) Install MIT AI2 Companion app → scan QR code from App Inventor Real-time updates, uses real sensors Requires Android phone + same Wi-Fi
USB Connection Connect phone via USB → select "USB" in Connect menu No Wi-Fi needed Requires driver installation
Emulator Connect → Emulator (built into App Inventor) No phone needed Slower, no real sensors

Types of Testing

Testing Type What It Checks Example
Functional Testing Does each feature work correctly? Does the "Add" button actually add a task to the list?
Usability Testing Is the app easy to use? Can a new user figure out the app without instructions?
Boundary Testing Does it handle extreme values? What happens with empty input? Very long text? Negative numbers?
Error / Exception Testing Does it handle errors gracefully? What happens if GPS is turned off when the app needs location?
Performance Testing Does it run smoothly? Is the app responsive with 100+ list items?
Compatibility Testing Does it work on different devices? Test on phones with different screen sizes

Writing a Test Plan

A test plan documents what you'll test, the expected result, and the actual result:

Test # Description Input Expected Result Actual Result Pass/Fail
1 Add a task Type "Buy milk", tap Add Task appears in list Task appears in list ✅ Pass
2 Add empty task Leave empty, tap Add Error message shown Error message shown ✅ Pass
3 Delete task Select task, tap Delete Task removed from list Task removed from list ✅ Pass
4 Delete without selection Tap Delete (nothing selected) Nothing happens / message App crashes ❌ Fail
5 Data persists Add task, close app, reopen Task still in list Task still in list ✅ Pass

Debugging

Debugging is the process of finding and fixing errors (bugs) in your code.

Common App Inventor Errors

Error Cause Fix
"Select list item: List index too large" Trying to access an index beyond the list length Check length of list before accessing
"Attempt to get item number 0" Lists start at index 1, not 0 Use index starting from 1
"Expected a number, got text" Trying to do math with text input Check if input is a number first
Screen appears blank Components not added or set to invisible Check the Components panel
Button click does nothing No event handler blocks for that button Add the "when Button.Click" blocks

Debugging Strategies

1. Trace Labels
Add a Label to the screen and set its text to variable values. For example: set LabelDebug.Text to join("Score=", get global score). This shows you what values your variables hold at any moment.
2. Step-by-Step Testing
Test each feature one at a time. If something breaks, you know exactly which part caused it.
3. Notifier Alerts
Use Notifier.ShowAlert to display intermediate values: call Notifier1.ShowAlert("Count is: " + length of list)
4. Do It / Watch
In the Blocks editor during live testing, right-click a block and choose "Do It" to execute just that block and see its result.

Building & Distributing Your App

Exporting from App Inventor

Option Menu Path Result
Build APK Build → App (provide QR code for .apk) APK file you can install on any Android device
Download APK Build → App (save .apk to my computer) Downloads the .apk file to your computer
Export project (.aia) Projects → Export selected project (.aia) to my computer Project source file (can be imported to another account)

Distributing the APK

  • Direct sharing — Send the .apk file via email, USB, or messaging apps. The recipient must enable "Install from unknown sources" in their phone settings.
  • Gallery — Publish to the MIT App Inventor Gallery (gallery.appinventor.mit.edu) for others to view and remix.
  • Google Play Store — Requires a developer account ($25 one-time fee). Must provide app description, screenshots, privacy policy, and meet Google's guidelines.
  • Alternative stores — Amazon Appstore, APKPure, or hosting the APK on a website.

Before Publishing Checklist

  • ✅ All features tested and working
  • ✅ All edge cases handled (empty input, large data, network errors)
  • ✅ App icon set (Screen1 → Icon property)
  • ✅ App title set correctly
  • ✅ Version number updated (Screen1 → VersionCode, VersionName)
  • ✅ Test on at least 2 different screen sizes
  • ✅ Remove debug labels and test data

Software Development Lifecycle (SDLC)

The SDLC describes the stages that every software project goes through:

Stage Description Your App Example
1. Analysis Understand the problem. What does the user need? "Students need a way to track homework tasks"
2. Design Plan the solution: UI mockups, data structure, algorithms Sketch screens, list components needed
3. Implementation Build the application (write code / blocks) Create the app in App Inventor
4. Testing Verify the app works correctly Run test plan, fix bugs
5. Deployment Release the app to users Build APK, distribute
6. Maintenance Fix issues, add features, update Add new features based on user feedback

Iterative Development

Modern development often uses iterative (repeated cycle) approaches: build a basic version → test → get feedback → improve → repeat. Each cycle produces a better version. This is different from the waterfall model where each stage is completed fully before moving to the next.

Pitfalls & Common Errors

Not Removing Debug Elements

Before building the final APK, remove all debug labels, test data, and console-style outputs. Users should not see "Debug: score=42".

Skipping Edge Case Testing

Most bugs occur at boundaries: empty lists, maximum values, no internet connection. Always test with unusual or extreme inputs.

No Version Control

Export your .aia file regularly. If something breaks, you can revert to a working version. App Inventor does not have built-in undo for deleted screens or components.

Pro-Tips for Exams

Testing Questions Format

  • When asked "describe how you would test your application," always mention normal, boundary, and erroneous test data
  • Provide a test table with: test number, description, input, expected outcome, actual outcome, pass/fail
  • Mention different types of testing (functional, usability, boundary)
  • For SDLC questions, list all 6 stages and briefly describe what happens at each

Graded Tasks

Remember

Name the 6 stages of the SDLC. Define: functional testing, boundary testing, usability testing.

Understand

Explain the difference between the waterfall model and iterative development. Which is better for mobile app development and why?

Apply

Create a complete test plan (minimum 8 tests) for a calculator app. Include tests for: normal input, edge cases (division by zero, very large numbers), and UI interaction.

Analyze

A student tests their app by only trying normal inputs and it passes all tests. The app crashes in class when a student enters an emoji in a number field. Explain why the testing was insufficient and what should have been done differently.

Create

Choose one app you've built in this unit. Document the full SDLC: write the problem analysis, include UI design sketches, show the implementation (screenshots of blocks), provide a complete test plan with results, and describe how you would publish and maintain it.

Self-Check Quiz

1. What file format does App Inventor produce when you build an app?
Click to reveal: .apk (Android Package Kit)
2. What three types of test data should you always include?
Click to reveal: Normal data (valid input), Boundary data (edge cases), Erroneous data (invalid input)
3. What file format is used to export an App Inventor project source?
Click to reveal: .aia
4. Name 3 ways to distribute an APK file.
Click to reveal: Direct sharing (email/USB), MIT Gallery, Google Play Store, alternative app stores, website hosting.
5. What is the difference between the waterfall model and iterative development?
Click to reveal: Waterfall completes each stage fully before moving to the next (sequential). Iterative repeats the cycle, improving the product each time (incremental).