Mark Dixon, SoCCE SOFT 136Page 1 02 – Software Development Life-Cycle.

Slides:



Advertisements
Similar presentations
VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.
Advertisements

Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Chapter 1: An Introduction to Visual Basic 2012
Mark Dixon, SoCCE SOFT 131Page 1 22 – Visual BASIC 2005.
Mark Dixon, SoCCE SOFT 136Page 1 05 – Conditional Execution.
Mark Dixon Page 1 05 – Conditional Execution. Mark Dixon Page 2 Admin: Test (next week) In class test –teaching week 6 50 minutes short answer (5 - 6.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon, SoCCE SOFT 131Page 1 SOFT – Module Introduction & Overview.
Mark Dixon, SoCCE SOFT 131Page 1 03 – User Interface Design, and Sound and Graphics.
Mark Dixon Page 1 02 – Dynamic HTML (client-side scripting)
Mark Dixon, SoCCE SOFT 131Page 1 03 – Debugging & Graphics.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Software Development Lifecycle, & User Interface Design.
Slide 1 ICS 012 Visual Programming I Ahmed Esmat Second.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Conditional Execution.
Mark Dixon, SoCCE SOFT 131Page 1 13 – Control Arrays & Container Controls.
Mark Dixon, SoCCE SOFT 131Page 1 03 – Debugging, Sound, and Graphics.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Software Development Lifecycle, & User Interface Design.
Adding Controls to User Forms. Adding Controls A user form isn’t much use without some controls We’re going to add controls and write code for them Note.
Controls General Discussion. VB Controls Visual Basic Controls A control is the generic name for any object placed on a form Controls may be images,
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
02 – Client-side code: JavaScript
Chapter 1 P. 1 Writing Windows applications with Visual Basic Figure 1.1 The first program works as follows: (These operations can be performed in any.
Chapter 3 Introducing Visual Basic.NET. 3.1 Visual Basic.NET Windows Programming -Used to create Windows, Web, and Console applications -Uses predefined.
Visual Basic Games: Week 3 Global variables, parameters, Select, KeyDown Enable, Visible, Focus State of Game Read chapter 3.
M Dixon 1 04 – Data Types & Debugging. Questions: Expressions a)What is the result of: 7 + Int(8.245) b)Write an expression to: put a random number into.
Mark Dixon 1 05 – Conditional Execution. Mark Dixon 2 Admin: Test (next week) In class test –teaching week 6 50 minutes short answer (5 - 6 words) currently.
Basic Computer and Word Functions, part 1 Read the information and use to answer the questions in the Basic Computer and Word Functions Study Guide.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Dynamic HTML (client-side scripting)
Irwin/McGraw-Hill © The McGraw-Hill Companies, Inc., Visual Basic Projects Project Structure and VB’s Programming Tools chapter TWO.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
Mark Dixon Page 1 06 – Conditional Execution. Mark Dixon Page 2 Admin: Test (next week) In class test –teaching week 6 50 minutes short answer (5 - 6.
Mark Dixon, SoCCE SOFT 136Page 1 SOFT – Module Introduction & Overview.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
Mark Dixon, SoCCE SOFT 131Page 1 05 – Variables. Mark Dixon, SoCCE SOFT 131Page 2 Admin: Test (next week) In class test –teaching week 6 –university week.
Chapter Two Creating a First Project in Visual Basic.
Mark Dixon Page 1 03 – Dynamic HTML (client-side scripting)
M Dixon 1 03 – Dynamic HTML (client-side scripting)
Mark Dixon Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon 1 03 – Information Processing. Mark Dixon 2 Questions: Events Consider the following code: a) How many unique events does it contain? b) Name.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Conditional Execution.
Standard Grade Programming using VB 1 Programming Visual Basic.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Dynamic HTML (client-side scripting)
Mark Dixon Page 1 03 – Dynamic HTML (client-side scripting)
Mark Dixon, SoCCE SOFT 131Page 1 16 – Visual BASIC 6.0.
Mark Dixon Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon Page 1 04 – Information Processing: Expressions, Operators & Functions.
VB Objects & Events (Exercises) School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 3, Friday 1/31/2003)
Mark Dixon 1 06 – Conditional Execution. Mark Dixon 2 Admin: Test (next week) In class test –teaching week 7 50 minutes short answer (5 - 6 words max)
M Dixon 1 02 – Dynamic HTML (client-side scripting)
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Mark Dixon Page 1 04 – Conditional Execution. Mark Dixon Page 2 Questions: Expressions a)What is the result of: 10 * Int( ) b)How many functions.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Mark Dixon Page 1 03 – Information Processing: Expressions, Operators & Functions.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
Mark Dixon Page 1 03 – Information Processing: Expressions, Operators & Functions.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Mark Dixon, SoCCE SOFT 131Page 1 03 – Conditional Execution.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Chapter 1: An Introduction to Visual Basic 2015
CIS16 Application Development Programming with Visual Basic
Presentation transcript:

Mark Dixon, SoCCE SOFT 136Page 1 02 – Software Development Life-Cycle

Mark Dixon, SoCCE SOFT 136Page 2 Admin Technicians (Babbage 205) can provide you with free copies of (bring your own blank CDs): –MS Visual Studio 6.0 (4 CDs), includes Visual BASIC 6.0 Visual InterDev 6.0 Visual C++ 6.0

Mark Dixon, SoCCE SOFT 136Page 3 Questions: Events Consider the following code: a) How many unique events does it contain? b) Name the event(s). Private Sub btnAns_Click() Me.BackColor = vbBlue lblComment.Caption = "Correct, well done!" End Sub 1 Click

Mark Dixon, SoCCE SOFT 136Page 4 Questions: Properties Consider the following code: a) How many properties does it contain? b) Name the properties. 2 BackColor, Caption Private Sub btnAns_Click() Me.BackColor = vbBlue lblComment.Caption = "Correct, well done!" End Sub

Mark Dixon, SoCCE SOFT 136Page 5 Questions: Keywords Consider the following code: a) How many unique keywords does it contain? b) Name the keywords. 3 Private, Sub, End Private Sub btnAns_Click() Me.BackColor = vbBlue lblComment.Caption = "Correct, well done!" End Sub

Mark Dixon, SoCCE SOFT 136Page 6 Questions: Objects Consider the following code: a) How many objects does it contain? b) Name the objects. 3 btnAns, Me, lblComment Private Sub btnAns_Click() Me.BackColor = vbBlue lblComment.Caption = "Correct, well done!" End Sub

Mark Dixon, SoCCE SOFT 136Page 7 Object naming conventions all objects have name property used to identify them in code (identifier) txtSurname.Caption = "Smith" 3 letter prefix to denote type, followed by short meaningful word/phrase: –frm: form(e.g. frmMain, frmAdd) –pic: picture box(e.g. picDisplay, picFace) –txt: text box(e.g. txtMonth, txtDrink) –lbl: label(e.g. lblName, lblAge) –btn: command button(e.g. btnClear, btnExit) makes it easy to read code

Mark Dixon, SoCCE SOFT 136Page 8 Session Aims & Objectives Aims –introduce you to fundamental software development lifecycle concepts Objectives, by end of this week’s sessions, you should be able to: –Run through the software development cycle. Implement simple software design –Create (draw) user interface –Put instructions in: »correct event handler procedure for desired result »correct sequence for desired result Test this design –Identify and correct simple logical and syntax errors –Identify & correct simple user interface (usability) problems

Mark Dixon, SoCCE SOFT 136Page 9 Project Files: Create New Folder Create new folder for each project (on U: drive), use Windows Explorer:

Mark Dixon, SoCCE SOFT 136Page 10 Project Files: Create New Folder Save all project files into that folder (using VB6) –project file (.vbp) –form files (.frm)

Mark Dixon, SoCCE SOFT 136Page 11 Version Control: Copy Folder At regular intervals copy whole folder to create new version –drag the folder and hold down CTRL key

Mark Dixon, SoCCE SOFT 136Page 12 Version Control: Rename Folder Rename the copy of the folder, using the date and time it was created:

Mark Dixon, SoCCE SOFT 136Page 13 Software Development Cycle Software development follows this pattern: –analyse problem – what does the user need? –design solution – how can I help? –implement (code) solution – build it! –test & debug solution (code) – does it work? However, it is: –cyclic/iterative (not linear)

Mark Dixon, SoCCE SOFT 136Page 14 Example 1: Ball v1 - Analysis User Requirements –describe user's objectives no mention of technology Software Requirements –Functional list facilities to be provided (often numbered) –Non-functional list desired characteristics (often more subjective) SPECIFICATION User Requirements –keep play school children occupied Software Requirements –Functional: move cartoon character around the screen –Non-functional character should be interesting and colourful

Mark Dixon, SoCCE SOFT 136Page 15 Example 1: Ball v1 - Design User interface design: Functional design: Trigger (when)Actions (what) click event of Right buttonmove ball character right click event of Left buttonmove ball character left click event of Up buttonmove ball character up click event of Down buttonmove ball character down

Mark Dixon, SoCCE SOFT 136Page 16 Example 1: Ball v1 - Form Properties (setting at design-time): –initial value only –change using properties window name: used internally to identify object (programmer) caption: displayed on button (user) left: horizontal position

Mark Dixon, SoCCE SOFT 136Page 17 Example 1: Ball v1 - Code Option Explicit Private Sub btnRight_Click() picBallChar.Left = picBallChar.Left End Sub Properties (setting at run-time) –use code, assignment operator (=) –can change while program is running btnRight picBallChar BallChar

Mark Dixon, SoCCE SOFT 136Page 18 Testing & Debugging: Errors 3 error types : –syntax: computer unable to understand your instructions (program does not execute), e.g. variable not defined (probably most common) –run-time: program can't execute instruction and exits (future lecture) Device unavailable (e.g. floppy drive) –logical: program executes but does not not match specification (do what was intended), e.g. clicking on button does nothing, when you thought you attached code to it clicking on blue button changes colour to red (when it should change to blue)

Mark Dixon, SoCCE SOFT 136Page 19 Computer –just symbol matching –No intelligence Example: Hello Errors Sub Command1_Cluck LabelL.Caption = "Hello" End Sub L instead of 1: causes syntax error (variable not defined) u instead of i: causes logical error (Command1 button does nothing)

Mark Dixon, SoCCE SOFT 136Page 20 Question: Errors The following example is from lecture 1, –Spot the errors (you should find 6), and –decide whether they are syntax or logical Private Sub btnBlue_Cluck() lblResult.BackColor = vbRed End Sub Private Sub btnRed_lick() lblResult.BackColor vbRed End Sub Private Sub lb1Result_DblClick() lblResult.BackColour = vbWhite End Sub

Mark Dixon, SoCCE SOFT 136Page 21 Debugging: Testing Functional Decomposition –break it into logical chunks Incremental Development –type a bit –test it Testing –test all/most combinations Regression Testing –repeat all previous tests

Mark Dixon, SoCCE SOFT 136Page 22 Sequence Execution sequence controlled in two ways: –procedures controlled by order of events –instructions (lines) controlled by order in code Private Sub btnBlue_Click() lblResult.BackColor = vbBlue End Sub Private Sub btnRed_Click() lblResult.BackColor = vbGreen lblResult.BackColor = vbRed End Sub Private Sub lblResult_DblClick() lblResult.BackColor = vbWhite End Sub VB

Mark Dixon, SoCCE SOFT 136Page 23 Example: Ball v2 (animation) Option Explicit Private Sub Form_Load() tmrBall.Enabled = False End Sub Private Sub btnGo_Click() tmrBall.Interval = 100 tmrBall.Enabled = True End Sub Private Sub tmrBall_Timer() picBall.Left = picBall.Left End Sub Need a –picture box –command button –timer control Trigger (when)Actions (what) click event of Go buttonball character moves left continuously

Mark Dixon, SoCCE SOFT 136Page 24 Example: Garden Wildlife

Mark Dixon, SoCCE SOFT 136Page 25 Questions: Parts of Code consider the following code: Private Sub btnThing_Click() lblResult.BackColor = vbRed lblResult.Caption = "Testing" End Sub –name all objects –name all properties –name all keywords –name all events btnThing, lblResult BackColor, Caption Private, Sub, End Click

Mark Dixon, SoCCE SOFT 136Page 26 Questions: BallChar Code consider the following code: –how many event procedures? –name all properties –name all objects –name all events 3 Enabled, Interval, Left Form, btnGo, tmrBall, picBall Load, Click, Timer Option Explicit Private Sub Form_Load() tmrBall.Enabled = False End Sub Private Sub btnGo_Click() tmrBall.Interval = 100 tmrBall.Enabled = True End Sub Private Sub tmrBall_Timer() picBall.Left = picBall.Left End Sub

Mark Dixon, SoCCE SOFT 136Page 27 Tutorial Exercise: Ball Char v1 LEARNING OBJECTIVE: to understand objects, events, properties, and event handler procedures, TASK 1: Get the Right button from the Ball Character example working. (code provided, images in resources area on server). TASK 2: Get the Left, Down, and Up buttons working. (You will need to work out what code to use. Use the code provided as inspiration) HINT: there isn't a right property, there is a top property

Mark Dixon, SoCCE SOFT 136Page 28 Tutorial Exercise: Ball Char v2 LEARNING OBJECTIVE: to understand objects, events, properties, and event handler procedures, TASK 1: Get Ball Character example v2 (from the lecture) working. (code provided, images in resources area on server). TASK 2: Add a button that places the ball character back on the left hand side Task 3: Make the ball character blink when clicked

Mark Dixon, SoCCE SOFT 136Page 29 Tutorial Exercise: Garden LEARNING OBJECTIVE: to understand objects, events, properties, and event handler procedures, TASK 1: Get the Garden Animals example working. Clinking an image should change the document (page) background colour to something suitable for the animal (e.g. ladybird – red), and display the name of the animal below the images. (no code provided, but images in resources area on server)