software engineering principles dr. josé m. reyes Álamo

18
Software Engineering Principles Dr. José M. Reyes Álamo

Upload: harold-neal

Post on 13-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Software Engineering Principles

Dr. José M. Reyes Álamo

2

Outline

• Software engineering principles

• If and If/else statement

Software Engineering Principles

4

Involve your prospective users in the process as early and as often as possible.

5

Build an initial, simpler prototype and then add to it incrementally

6

Code and test in small increments—never more than a few blocks at a time.

7

Design the logic for your app before beginning to code

8

Divide and conquer.

9

Comment your source code or blocks so you can easily remember and others can understand them.

10

Learn to trace blocks manually so that you understand how they work.

Logic Control

if – if-else statement

12

An App is a Set of Event-Handlers

• Mobile and web apps have graphical user interfaces (GUIs) with which the user interacts. Such apps are better described as a set of event-handlers, with multiple recipes that are only performed in response to some event.

13

An App Consists of Event-Handlers That Can Ask Questions and Branch

• Many responses to events are not sequential, but contain branches and loops.

• The app is allowed to ask questions and determine its course based on the answers. We say that such apps have conditional branches:

Conditions are questions such as “has the score reached 100?” or “did the text I just receive is from Joe?”

Depending on the condition evaluation (true or false) either B1 or B2 are going to be executed, but not both.

14

If and ifelse statement

Test statement

If test statement is TRUE, then do the following…

If test statement is TRUE, then do the following..

If test statement is FALSE, then do the following…

If test statement is FALSE, skip the if statement

15

Conditions are Boolean

Conditions are Boolean, meaning they return true or false. They test the value of properties and variables using the following logical operators:                              

                                               These operators can be found in the Math and Logic drawers.

16

Algorithm – Pseudo CodeAlgorithm – Pseudo Code

// Use if statement to check the default size.defaultSize = 5;smallSize = 3;bigSize = 8;If defaultSize<8 && defaultSize>3

Display in LabelResult = The dot size is set to default;end

17

Some examples

18

OpenLab and Blackboard

• Check OpenLab for any new lab.

• Check Blackboard for any new quiz.

• Project:

– Brainstorm an idea

– Get professor's approval

– Post your idea in your portfolio

– Must work in teams of 2 or 3

– It must be an app and the topic is open: a game, a tool, an enhanced version of a previous app