Exam Prep: Collaborative SDLC Research Document

Here is the document:

SDLC – Waterfall Model – Exam Prep Research

You may wish to do additional research as needed if you feel the explanation and/or research done for a given stage of the SDLC is not adequate.

OTL / Homework

Read the document above.  Write down any questions that occur to you for any section of the SDLC.  You may ask the questions that occur to you of the students who completed the research for that section tomorrow.

(Corollary: Each team should be prepared to answer questions from other students about their work.  Teams will be evaluated for Communication marks based on the quality of their responses.)

As well, review the example documents provided to help flesh out your understanding of the phases of the waterfall model of the SDLC.

Exam Prep: SDLC Example Documents

Here are a number of example documents for the waterfall model of the Software Development Lifecycle:

SOCS Housing Board – Timelines and Planning Document

SOCS Housing Board – User Level Requirements

SOCS Housing Board – Software Requirements Specification

SOCS Housing Board – Software Design Document

SOCS Housing Board – Interface Design Document

These are all documents that I authored as part of my senior computer science thesis and project in fourth year studies at the University of Guelph.  Vanity link — here is a news article that was published just after the housing board went public.

UPDATE

Here is the video where we discussed these example documents in class:

Discussion of SDLC Example Documents

Debugging with NimbleKit

Successful debugging of a program begins with one major rule: verify your assumptions.

That is, you may believe your code successfully does A B and C.

However, upon closer inspection, you realize that instructions A and B complete successfully, but C does not.

How do you get to this point, however?  That is, with NimbleKit-based iOS applications — how do you identify instruction C as the culprit?

In an ideal world, we’d be able to use modern debugging tools — namely, to be able to step through the code line by line, inspect variable values, set breakpoints, et cetera.  Sadly, while Xcode fully supports this type of debugging — due to the Javascript-based nature of NimbleKit — we cannot use Xcode’s excellent debugging tools.

What else can we use?

Option 1 – Alert box dialogs

The first option — easiest for quick and dirty inspection of variable values — we can use NKAlert.

Example — not sure that a parameter is being received from a page?  You could use code like this:

var passedID = NKGetParameter(“nid”);
NKAlert(“alert”, “passedID is ” + passedID); // DEBUG

The second line of code will cause an alert dialog to pop up, allowing you to see if passedID actually contains a value.

However, using anything more than one alert dialog can get tedious — what if you need to check the value of three variables?  Five?  The flood of alert dialogs very quickly gets annoying, and prevents you from “normally” navigating within your application.

Option 2 – Writing to a log file

Second option — best for intensive debugging — and for the ability to cut and paste information being logged — NKLog.

A common problem is a complex SQL query that is not running properly (causing, for example, your table view to display no data).

If you use an NKAlert line, you can “see” the query as it will be run by NimbleKit — for example:

var query = “UPDATE notes ” +
“SET ” +
“title = ‘” + title + “‘, ” +
“body = ‘” + body + “‘, ” +
“lastmodified = ‘” + dateTimeStamp + “‘ ” +
“WHERE id = ” + passedID;
NKAlert(“alert”, query); // DEBUG

The problem is that, for the query, while visually inspecting it can help — it’d be better to actually be able to cut and paste the query into Base, and verify that the query works and is returning the data you expect.

How to do this?  NKLog to the rescue.  Watch this video, and follow along to get the full details:

How to Use NKLog for Debugging with NimbleKit

Basically, to get NKLog to work with your own project, add these two lines to “main.m” in the “Other Sources” folder of your Xcode project:

// Modify the first argument of the next line to reflect the path to your own Desktop
freopen( “/Users/rgordon/Desktop/stderr.txt”, “w”, stderr );

Then modify the first argument of the second line to reflect the actual path to your own Desktop folder.  (Again — the video has all the details).

Good luck and happy debugging!

Resources to Help with Implementation

Most programmers do not have the entire API (application programming interface) memorized (OK, nobody does).

However, it’s important to know where to look to find answers.

Your first stop when you find yourself asking “Can NimbleKit do this?” is to look in the official NimbleKit documentation.

Next, the NimbleKit discussion forums are sometimes a useful resource as well.

Finally, since JavaScript is the lingua franca of NimbleKit, you should keep a JavaScript resource on hand — as usual, W3Schools has an excellent JavaScript resource.

Last note — I am always available to lend assistance when needed.  Good luck and have fun!

Art Assets; Attribution (Citing Source of Creative Works); Open Clip Art

The original source of all artwork used in your applications must be attributed on an About page in your application.

If you have many images in your application that are copyrighted (for example, Derek and Kevin are writing an application that is a “helper app” for a commercial game) it is sufficient to state that “All artwork remains under copyright of _________________” where _________________ is the company/organization that holds the copyright.  As an educational institution, this kind of blanket copyright notice is sufficient for our purposes.  If you intend to publish your application on the App Store, and are using copyrighted images, you should do additional research on your own to verify that your work does not infringe on any copyrights.

The following website is a great source of public-domain artwork:

Open Clip Art Library

Public domain images allow you to “copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.”  See the Open Clip Art Library license page for more info.

“Instant Alpha” Tutorial Video

Here is a short video showing how to “crop out” background pixels from an image, quickly:

How to Use Instant Alpha in Preview dot app

It’s alive! “Notes” Example App Complete

I’ve completed the Notes example app — building on what you learned by making the Food Groups app, this example app will fill in any remaining blanks in your knowledge — most importantly — it demonstrates how to write new data to the database — and — how to use iOS style forms / user interfaces.

Here is a brief tour of the Notes app (7 min movie).

Here is a list of things the application demonstrates (you can dig into the code in the class repository to see how each of these things was implemented):

  • delete / cancel button depending on whether note is new or not
  • delete button demonstrates how to remove a record from the database and how to use an “alert sheet” to confirm “destructive” user actions (anything that results in a major loss of data is considered “destructive” and should usually be confirmed)
  • swipe to delete in table view enabled (but no callback ability, so we can’t actually remove the note from the database — yet)
  • iOS style forms (courtesy of code obtained from iWebKit — review “Forms Example” also in our class repository for other examples of iOS style form elements and how to implement them)
  • database writes demonstrated as notes are saved automatically when navigating back to the table view
  • iOS settings page can be used to store application preferences (“note preview” vs. “last modified date” in table view subtitle)
  • live updates of navigation bar based on user input
  • whitespace trimming used to cause notes saved without a title to be defaulted to a title of “Untitled”
  • special character escaping / unescaping used to avoid SQL injection attacks (i.e.: single quotes — ‘ — mark the end of a string in an SQL query — see what happens if you try writing data to your database that includes single quotes that are not escaped…)

Using the iOS Settings page with your NimbleKit app

This documentation from Apple is key; other than that, the process involved is to add a Settings bundle file in Xcode via:

File > New File… > Resource > Settings Bundle

Immediately run your app in the iOS Simulator, go to the Settings screen, and you will see an entry for your app with default / example settings provided by Xcode.

Refer to the Apple documentation linked to above to learn how to modify the Root.plist file inside the Settings bundle.

See the Settings bundle included in the Notes Example app that I have made available on the class repository.

Finally, refer to the NimbleKit documentation for NKSettings to see how to read from / write to your application’s settings.

(In the Notes Example app, a setting is provided that switches the “subtitle” line of the table view — options are showing the “last modified date” or a “note preview”.)

Tagging App Releases in Subversion

Here is how to tag a release of your program (i.e.: when you reach a particular milestone and want a “snapshot” of your program at that point in time):

svn copy http://svn3.xp-dev.com/svn/4u-s11-prj-example/trunk/Notes%20Example/ http://svn3.xp-dev.com/svn/4u-s11-prj-example/tags/release-2 -m “tagging the version 2 release of the Notes Example project.”

I will explain further and demonstrate:

a) how to adapt this command to your own project
b) why it’s useful to you

… on Monday.

Source Control in Xcode: Turning on Status Column

First task today: turn on the source control status column in Xcode. (video link)

Second task today: continue working on your projects.

Reminder: due to be handed in tomorrow (Friday) at end of class at latest…

  • point-form notes on Apple HIG (individual)
  • application definition statement for your app (group)
  • app comparison document (group)
  • 10 hand-drawn prototypes for “main screen” of app, along with recorded commentary (group)
  • complete paper prototype(s) of app, along with recorded commentary (group)
  • pixel-perfect prototype(s) of app, along with recorded commentary (group)

How to hand in?

Anything in paper form — label with both group members names on every page please.  Hand in all paper sheets in a duotang or other similar organizing device.

Anything in electronic form — ensure individual / both group member’s name are in each file name; ensure file is named logically — if I have to guess and can’t identify a file — marks will be lost.

For individuals, put all files to be handed in into a folder that has your name on it (i.e.: folder named “Saqib Latif”) and drop entire folder into the Mac Lab ICS4U-T Drop Box folder.

For groups, put all files to be handed in into a folder that has both names on it (i.e.: folder named “Saqib Latif and Parth Pandya”) and drop entire folder into the Mac Lab ICS4U-T Drop Box folder.

Where should we be in our project?

Ideally you have made an E-R diagram for your app’s database, and started to use MySQL Workbench to produce a physical database layout.  You have also done an export from MySQL Workbench into Base and started to populate your database with default data (where appropriate).

You have started coding your app in Xcode and have started using your repository for all code management.

Source Control: Subversion and Xcode

Repositories have now been set up at XP-Dev.com.

Recall that all of you set up accounts at XP-Dev.com earlier this semester, using the username format:

npark.firstname.lastname

As well, that you tied these accounts (I believe) to Gmail accounts created with the format:

npark.firstname.lastname@gmail.com

First task today: verify that you can log in to your XP-Dev.com account.

Project repositories have been set up using the names of the group members in alphabetical order.  For example:

4u-s11-prj-parth-saqib

The repository URL for Parth and Saqib’s repository, then, will be:

http://svn3.xp-dev.com/svn/4u-s11-prj-parth-saqib/

Second task today: make required changes to the Subversion configuration file at this location in your account…

~/.subversion/config

I (Mr. Gordon) will attempt to copy the necessary changes to your configuration file automatically.  If that does not work, you will need to use Terminal.app and follow the instructions described here.  (If you have to modify the file manually, I will still lead you through it.)

Modifying this file is necessary so that certain binary files (like those in the /build directory of your Xcode project) are not checked into the repository — we only want the text / source code files to be checked in.

Third task today: Add our class example repository to Xcode (video illustration, 2:30).

Fourth task today: Check out the Food Groups code from the class repository (video illustration, 2:00).

Fifth task today: Add your group’s repository to Xcode (use the video about adding the class repository as a guide).

Sixth task today: ONE of the two group members should import your group’s project into their repository (NOT both students — just one). Here is an example (using the class repository — you should check in the code to your group’s repository).

Seventh task today: The OTHER group member should try checking out the project from the project repository.  Be sure to checkout the code to a NEW location in your home folder (NOT the same place as it already exists).  Here is an example video showing how to do this with the Forms Example project in the class repository.  Apply the same steps to check out your project from your group’s repository.

Eighth (whew!) and final task today: With the checked out version of your project — make Xcode aware that the project is under source control.  Here is video showing you how to do that.